From patchwork Sun Oct 30 22:28:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 620037 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp2452576pvb; Sun, 30 Oct 2022 15:36:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OGQZXAiL1haSGZmYU12bDoaYtFxy1jp3v0pYil4UUnlOD4R3g+G7mzI8uZsoGFzJ3HGBH X-Received: by 2002:ad4:5d6e:0:b0:4bb:6acc:e712 with SMTP id fn14-20020ad45d6e000000b004bb6acce712mr8507936qvb.57.1667169417716; Sun, 30 Oct 2022 15:36:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667169417; cv=none; d=google.com; s=arc-20160816; b=lE/ZFTl0+sjILsEKNRjLCA/DGsCA+Td1eoqi1WQdk+EM2uvsRWWEZdKh9E5lxajDLg n16UxyzMhxWQ9SYd2YbwZuemKxFr4ugn13FqVqHahQYRfFktS0ZmS30Frc0rOJzvkpxa O/gOKswkZpVWzkWN+08QhmtkFf5adcfVOmo7mylDHWrHOggjCXp+mBxq/jhN+7LA1a5z DEpK0PwBy1AjbM342VzVIRk84dWYF7HFzH/uxG/AuXO7a9J6mADnl6XR2k7Eo9TM9qxg swF2G1ZhmlhW7U61knLmTje4pYGKBHv088Mdd3sBsWngFbQvebdQTzmG8h/GDDYe7Gq3 rUQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=92o+6CBAVgkiKf8oTcJaZlQEwbuXO48JKqQmwQlE4NM=; b=L+LeO9DDiYDKluWPr7jLXhgIcNivmDYfbiKaeNfI8U9MXyr8GK0HUktnaIdR7FTjNj 2P6+ImdvIi2UU4sRTBncXuKfZjkexyiowaSRCAGyWTuC6v+L0dV1rmQBn9e6BV+XPFWC di57cdYW025nbO16FjDQKugGKW7qBcXfS9J+kk8mx7lZhhMReYAVvhNDmUmJW2rYXVO7 GRVALCKyNPImSPRiOfK+Ajw6AxwYGFb7PHFF7UhU20NDMmflgPOz2P8AzUJG1xsBmyLa npA8TtzrLDp8bPVo4qCcJTj8NlAJ+TTz0RQdTwjOgI8jxIFKTi/8xNKVo93u+LPE6oBO whvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lEKBuZdJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s5-20020a05620a254500b006f988e553b3si2969695qko.249.2022.10.30.15.36.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 30 Oct 2022 15:36:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lEKBuZdJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1opGtk-000050-CX; Sun, 30 Oct 2022 18:35:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1opGs4-0003W6-RP for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:33:38 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1opGs3-0000Fb-8g for qemu-devel@nongnu.org; Sun, 30 Oct 2022 18:33:36 -0400 Received: by mail-wr1-x432.google.com with SMTP id bk15so13631859wrb.13 for ; Sun, 30 Oct 2022 15:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=92o+6CBAVgkiKf8oTcJaZlQEwbuXO48JKqQmwQlE4NM=; b=lEKBuZdJcEluQ+wWzBveOuvCz93WdsS4nwYT4dU5R+pxAAdps5ie5t0HkRLckFkxbo RWMLn0GXpuRLBX95YPIpkbgQfDF4YTqxSRl6WirvNNcrJ08H9MqSMbXvufW3jcx9n7X0 BlWwkYrAerSYmysqbPFFagyZyX0Jh/IrPpLgJI41sdL11xRbGK5J5+fJlmtdWoJIboHN MgwDA+dbWCjhD1Sv6PLY8sTjaEg92thxu4Mh0SAaQVRTtzD0qbyTYImSfQcrjtMTyKHs MHKIC6FYzayafiuIBxX1W5TClLSVfbbS3UrpGI+X+iFGZE0fL2ST5P3yLLNOyq6fWnSW 5Ssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=92o+6CBAVgkiKf8oTcJaZlQEwbuXO48JKqQmwQlE4NM=; b=3vbwQkCwlHYdCLVFYDt3bmS+ZR/qpCOQ15/5wb3kvW+OVJW0+uYo4cmZ5O+exkiLGK ZPLnuGWMt+olzzeZH59oQg8j6Q/h6ADVK1ybVV6eZ9d685TqGFHeo5Z616pqcUVSc9e5 hP5LxU+EpqVn/URkj6cJIpA1JWAQgur55uh1SMh8MBFqEZeAeXJ/P1mKpE4jUIoSQZqT 0/ex3F5mNL5bZBLi1HI2gfdt/o2vbbWYrJ+ArCbhEuJ3oI937EZ3YcIHBD6immHZVJev QKPCxgPBTA3RPg1Wxs8U0hrO7R4KDGdiBVoYXeweYcSmXODhRilFt/kLsarHMUW0nq/k a0Gw== X-Gm-Message-State: ACrzQf0HkYo8/eBX9im5N8RuIO1qaDzZnwJqQvhf0hCz+jr2I+GYA7K3 xa+V7jRu0w18Z8eoqAgxK43DNKbu4Kanag== X-Received: by 2002:adf:aa8c:0:b0:236:6e59:99ff with SMTP id h12-20020adfaa8c000000b002366e5999ffmr5789416wrc.688.1667169213872; Sun, 30 Oct 2022 15:33:33 -0700 (PDT) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id r10-20020a05600c35ca00b003c6f1732f65sm2964076wmq.38.2022.10.30.15.33.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 30 Oct 2022 15:33:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aleksandar Rikalo , Huacai Chen , Stefan Pejic , Jiaxun Yang , Aurelien Jarno , Paul Burton , Bernhard Beschow , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 44/55] hw/isa/piix3: Prefer pci_address_space() over get_system_memory() Date: Sun, 30 Oct 2022 23:28:30 +0100 Message-Id: <20221030222841.42377-45-philmd@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221030222841.42377-1-philmd@linaro.org> References: <20221030222841.42377-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow get_system_memory() accesses global state while pci_address_space() uses whatever has been passed to the device instance, so avoid the global. Moreover, PIIX4 uses pci_address_space() here as well. Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20221022150508.26830-7-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/isa/piix3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index 723ad0a896..0bea4aefe7 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -301,7 +301,7 @@ static void pci_piix3_realize(PCIDevice *dev, Error **errp) PIIX3State *d = PIIX3_PCI_DEVICE(dev); ISABus *isa_bus; - isa_bus = isa_bus_new(DEVICE(d), get_system_memory(), + isa_bus = isa_bus_new(DEVICE(d), pci_address_space(dev), pci_address_space_io(dev), errp); if (!isa_bus) { return;