From nobody Mon Nov 17 08:32:58 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1732620361; cv=none; d=zohomail.com; s=zohoarc; b=M2kVrtRtsTHxJX8muAoNcCFJrl5yEOYztfZLFFpcd0hZPzILeli+t4ecUNjZPNH0wgnkJ7wzA9OZd1FLSioW1aeL6UKyP9O4FEG4P0DdKoYed84j5zXTGJK6eBlXZzwO1hl/oJcYdpAsq/nkWrqS9bWQ6LoLfVng8Kou3GzE4Nw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1732620361; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WlPdyc/DTHUeKFvLcv8XiL1CJLw++4u5ykrc9rCsGw0=; b=emIS2beaDh7k7qvccCbmkFeybtzPTTDikSU4R0BDA1010hrZJ5L54b9XlAhU77BX8AyJxXh0c4Kw5jNbQSfco2+DzgcU10617WgS/jVp5J7vLApZ57386ud/SrGV6GmFc4Cy9wRZ6BQcGIOyyjlPimkniYmqT4TwiEGHjYwPlsA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1732620361198731.2565696559282; Tue, 26 Nov 2024 03:26:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFtgT-0006Mk-EV; Tue, 26 Nov 2024 06:24:45 -0500 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 1tFtfA-00041V-MO for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:26 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFtf5-0002pZ-2B for qemu-devel@nongnu.org; Tue, 26 Nov 2024 06:23:21 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-53dde9acbb0so3240619e87.3 for ; Tue, 26 Nov 2024 03:23:16 -0800 (PST) Received: from localhost.localdomain ([176.176.143.205]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4349d60de86sm90041125e9.35.2024.11.26.03.23.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 26 Nov 2024 03:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732620194; x=1733224994; darn=nongnu.org; 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=WlPdyc/DTHUeKFvLcv8XiL1CJLw++4u5ykrc9rCsGw0=; b=kL3XWD4GFgeZTLHRbeakLUGuvKuZVApvnRo89G5+ETHvGhglGVFX7UAbd1CTX4wn5I YIi+HluaTdhjBjfZH4Nig4OoWdBb0rzgUJ2TGJrcx2XKxh9/9awkcR61QLsFIUdDuhhg T3YjKQVl7XNbE2sF3sjl9cRqNEhLOoRo9DuJRMzs3wN4n7k3jv2DhHvZ1WI3Z3jXiUWa od9nlaqu0ML5uyjo7qJ5j2rlyL9iKLi2eSCLAsMxj1m1zqiKKcbX7xZiTveiRJQfldzb pMLvcxftqBmfTyXoGPSSveg89Zl4qzyEwJHd3W5iplS1hKAK/29uAfxqkAlQ5LKtL/ZK AsGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732620194; x=1733224994; 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=WlPdyc/DTHUeKFvLcv8XiL1CJLw++4u5ykrc9rCsGw0=; b=WIb48BXwGO1wn1Ma6sjgMXQi/XoGgEYlyRJWPpqIjNOwd0EotaDLNXcLWVC4UAa2S9 /2Zf/2JgWCwsuaEnB+XLDag4/xLldkI77yNGSLG2NdIPellNn0g17W/8hOD0+XjEcVSX qeqRRXUPUaN2SW1vvOLUvAMnAN/KY6mWoOkcDGjEySkyZbdF5nT0rVg9HtVJyXuAJlWF ToXRdCQEUqyXSIxfbeB+Z4jzUcciOkFG6RzWkxPkTuzFAVZNx/DpGAsY6OdpFBDp029P lthr1SEGM7bQM0R/mSXhIwq0VxbFVs8dv3723gUxp7+6+XlBk1zdZxi1odH+Ao00gMa5 pbUQ== X-Gm-Message-State: AOJu0YwlAygWSF2cH6PYxWlj8ltt9ANVOmNJsbKuNkOMjClTNpSWng12 0M2DOefNm3A5ZHnan0WG5vp23fDKOhzW89k6oPgNZdgr2VlTzNQ8AeniXEq8VgUEwnHR3H+7xkJ e X-Gm-Gg: ASbGncvWcG+eIQgPM3uAgXApxFLLLCC0M1y7t8WPcnidJqL0riDUXSLxXKCjYqTmKVn eaOz4m9CJMClZqzrhYPkWgw+2nXoJ0WNCHNwqX7Th6mSZgyglYlRjegDm+8fEQJvWNo97j5n6fN R32aTqOyKmJ+QR/6U8EWaktwy/iXQ/s426vZPoUwSnNtepGhyy2FMA8Z1fWxgm/lAuolxgrYYzF QHZMsy4qyXQ0s9kpxVutojNreuvNO+NX/KmUaE6OtkHnp+EpsjkxQt/iFcMiUm3EpVPj+Ix X-Google-Smtp-Source: AGHT+IHl4P76Zn9v74qJkH7XPImD4yqbhApgnoCfXWDHkPezXOG5kjcaZJpW7cIhbBeU8MgQWJsrow== X-Received: by 2002:a05:6512:2209:b0:536:73b5:d971 with SMTP id 2adb3069b0e04-53dd39b0ddcmr7303704e87.38.1732620194134; Tue, 26 Nov 2024 03:23:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth , "Michael S. Tsirkin" , qemu-riscv@nongnu.org, Marcel Apfelbaum , Peter Maydell , qemu-arm@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-10.0 v2 07/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_new() Date: Tue, 26 Nov 2024 12:22:06 +0100 Message-ID: <20241126112212.64524-8-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241126112212.64524-1-philmd@linaro.org> References: <20241126112212.64524-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.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=unavailable 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1732620362974019100 Have pci_root_bus_new() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/pci/pci.h | 3 ++- hw/pci-bridge/pci_expander_bridge.c | 9 ++++++--- hw/pci-host/gt64120.c | 2 +- hw/pci-host/i440fx.c | 2 +- hw/pci-host/q35.c | 2 +- hw/pci-host/remote.c | 2 +- hw/pci/pci.c | 7 ++++--- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index b499846083f..f5454db0eb5 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -288,7 +288,8 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, De= viceState *parent, bool bar_at_addr_0_refused); PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename); + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused); void pci_root_bus_cleanup(PCIBus *bus); void pci_bus_irqs(PCIBus *bus, pci_set_irq_fn set_irq, void *irq_opaque, int nirq); diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expand= er_bridge.c index bbf615f544b..d4b472a8305 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -358,15 +358,18 @@ static bool pxb_dev_realize_common(PCIDevice *dev, en= um BusType type, =20 ds =3D qdev_new(type =3D=3D CXL ? TYPE_PXB_CXL_HOST : TYPE_PXB_HOST); if (type =3D=3D PCIE) { - bus =3D pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCI= E_BUS); + bus =3D pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCI= E_BUS, + true); bus->flags =3D parent_bus->flags & ~PCI_BUS_IS_ROOT; } else if (type =3D=3D CXL) { - bus =3D pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL= _BUS); + bus =3D pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL= _BUS, + true); bus->flags =3D parent_bus->flags & ~PCI_BUS_IS_ROOT; bus->flags |=3D PCI_BUS_CXL; PXB_CXL_DEV(dev)->cxl_host_bridge =3D PXB_CXL_HOST(ds); } else { - bus =3D pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_P= XB_BUS); + bus =3D pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_P= XB_BUS, + true); bus->flags =3D parent_bus->flags & ~PCI_BUS_IS_ROOT; bds =3D qdev_new("pci-bridge"); bds->id =3D g_strdup(dev_name); diff --git a/hw/pci-host/gt64120.c b/hw/pci-host/gt64120.c index 14fc803d279..3cc92e7200f 100644 --- a/hw/pci-host/gt64120.c +++ b/hw/pci-host/gt64120.c @@ -1193,7 +1193,7 @@ static void gt64120_realize(DeviceState *dev, Error *= *errp) phb->bus =3D pci_root_bus_new(dev, "pci", &s->pci0_mem, get_system_io(), - PCI_DEVFN(18, 0), TYPE_PCI_BUS); + PCI_DEVFN(18, 0), TYPE_PCI_BUS, true); =20 pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci"); memory_region_init_io(&phb->conf_mem, OBJECT(phb), diff --git a/hw/pci-host/i440fx.c b/hw/pci-host/i440fx.c index 4f0a0438d77..35a54b953a7 100644 --- a/hw/pci-host/i440fx.c +++ b/hw/pci-host/i440fx.c @@ -268,7 +268,7 @@ static void i440fx_pcihost_realize(DeviceState *dev, Er= ror **errp) memory_region_add_coalescing(&phb->conf_mem, 0, 4); =20 b =3D pci_root_bus_new(dev, NULL, s->pci_address_space, - s->io_memory, 0, TYPE_PCI_BUS); + s->io_memory, 0, TYPE_PCI_BUS, true); phb->bus =3D b; =20 d =3D pci_create_simple(b, 0, s->pci_type); diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c index f3e713318ed..e47ba7aa0c2 100644 --- a/hw/pci-host/q35.c +++ b/hw/pci-host/q35.c @@ -65,7 +65,7 @@ static void q35_host_realize(DeviceState *dev, Error **er= rp) pci->bus =3D pci_root_bus_new(DEVICE(s), "pcie.0", s->mch.pci_address_space, s->mch.address_space_io, - 0, TYPE_PCIE_BUS); + 0, TYPE_PCIE_BUS, true); =20 qdev_realize(DEVICE(&s->mch), BUS(pci->bus), &error_fatal); } diff --git a/hw/pci-host/remote.c b/hw/pci-host/remote.c index bfb25ef6af8..646e14de4e9 100644 --- a/hw/pci-host/remote.c +++ b/hw/pci-host/remote.c @@ -43,7 +43,7 @@ static void remote_pcihost_realize(DeviceState *dev, Erro= r **errp) =20 pci->bus =3D pci_root_bus_new(DEVICE(s), "remote-pci", s->mr_pci_mem, s->mr_sys_io, - 0, TYPE_PCIE_BUS); + 0, TYPE_PCIE_BUS, true); } =20 static void remote_pcihost_class_init(ObjectClass *klass, void *data) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index f7158fb9573..5fea39e4dfa 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -571,13 +571,14 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, = DeviceState *parent, =20 PCIBus *pci_root_bus_new(DeviceState *parent, const char *name, MemoryRegion *mem, MemoryRegion *io, - uint8_t devfn_min, const char *typename) + uint8_t devfn_min, const char *typename, + bool bar_at_addr_0_refused) { PCIBus *bus; =20 bus =3D PCI_BUS(qbus_new(typename, parent, name)); pci_root_bus_internal_init(bus, parent, mem, io, devfn_min, - true); + bar_at_addr_0_refused); return bus; } =20 @@ -622,7 +623,7 @@ PCIBus *pci_register_root_bus(DeviceState *parent, cons= t char *name, { PCIBus *bus; =20 - bus =3D pci_root_bus_new(parent, name, mem, io, devfn_min, typename); + bus =3D pci_root_bus_new(parent, name, mem, io, devfn_min, typename, t= rue); pci_bus_irqs(bus, set_irq, irq_opaque, nirq); pci_bus_map_irqs(bus, map_irq); return bus; --=20 2.45.2