qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: qemu-ppc@nongnu.org, qemu-s390x@nongnu.org,
	"Thomas Huth" <thuth@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	qemu-riscv@nongnu.org,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: [PATCH-for-10.0 v2 10/13] hw/pci-host/gpex: Expose 'refuse-bar-at-addr-0' property
Date: Tue, 26 Nov 2024 12:22:09 +0100	[thread overview]
Message-ID: <20241126112212.64524-11-philmd@linaro.org> (raw)
In-Reply-To: <20241126112212.64524-1-philmd@linaro.org>

Expose the "refuse-bar-at-addr-0" property so machines
using a GPEX host bridge can set this flag on the bus.
While the default property is set to 'false', all caller
set it to 'true' so there is no logical change so far.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/pci-host/gpex.h | 1 +
 hw/arm/sbsa-ref.c          | 2 ++
 hw/arm/virt.c              | 2 ++
 hw/i386/microvm.c          | 2 ++
 hw/loongarch/virt.c        | 2 ++
 hw/mips/loongson3_virt.c   | 2 ++
 hw/openrisc/virt.c         | 2 ++
 hw/pci-host/gpex.c         | 4 +++-
 hw/riscv/virt.c            | 2 ++
 hw/xen/xen-pvh-common.c    | 2 ++
 hw/xtensa/virt.c           | 2 ++
 11 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h
index dce883573ba..44c6463afb3 100644
--- a/include/hw/pci-host/gpex.h
+++ b/include/hw/pci-host/gpex.h
@@ -64,6 +64,7 @@ struct GPEXHost {
     int irq_num[GPEX_NUM_IRQS];
 
     bool allow_unmapped_accesses;
+    bool refuse_bar_at_addr_0;
 
     struct GPEXConfig gpex_cfg;
 };
diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c
index e3195d54497..f6cf43cf0c9 100644
--- a/hw/arm/sbsa-ref.c
+++ b/hw/arm/sbsa-ref.c
@@ -647,6 +647,8 @@ static void create_pcie(SBSAMachineState *sms)
     int i;
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* Map ECAM space */
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 1a381e9a2bd..06affc3638b 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1510,6 +1510,8 @@ static void create_pcie(VirtMachineState *vms)
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     ecam_id = VIRT_ECAM_ID(vms->highmem_ecam);
diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c
index 86637afa0f3..2231fd8f9cf 100644
--- a/hw/i386/microvm.c
+++ b/hw/i386/microvm.c
@@ -108,6 +108,8 @@ static void create_gpex(MicrovmMachineState *mms)
     int i;
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* Map only the first size_ecam bytes of ECAM space */
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 9a635d1d3d3..b5a26d3c23d 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -712,6 +712,8 @@ static void virt_devices_init(DeviceState *pch_pic,
     int i;
 
     gpex_dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(gpex_dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     d = SYS_BUS_DEVICE(gpex_dev);
     sysbus_realize_and_unref(d, &error_fatal);
     pci_bus = PCI_HOST_BRIDGE(gpex_dev)->bus;
diff --git a/hw/mips/loongson3_virt.c b/hw/mips/loongson3_virt.c
index f3b6326cc59..21af0b5bc86 100644
--- a/hw/mips/loongson3_virt.c
+++ b/hw/mips/loongson3_virt.c
@@ -430,6 +430,8 @@ static inline void loongson3_virt_devices_init(MachineState *machine,
     LoongsonMachineState *s = LOONGSON_MACHINE(machine);
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
     pci_bus = PCI_HOST_BRIDGE(dev)->bus;
 
diff --git a/hw/openrisc/virt.c b/hw/openrisc/virt.c
index 47d2c9bd3c7..cde9379a992 100644
--- a/hw/openrisc/virt.c
+++ b/hw/openrisc/virt.c
@@ -380,6 +380,8 @@ static void openrisc_virt_pcie_init(OR1KVirtState *state,
     int i;
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* Map ECAM space. */
diff --git a/hw/pci-host/gpex.c b/hw/pci-host/gpex.c
index 299f4d4f840..b888f4e831d 100644
--- a/hw/pci-host/gpex.c
+++ b/hw/pci-host/gpex.c
@@ -136,7 +136,7 @@ static void gpex_host_realize(DeviceState *dev, Error **errp)
     pci->bus = pci_register_root_bus(dev, "pcie.0", gpex_set_irq,
                                      pci_swizzle_map_irq_fn, s, &s->io_mmio,
                                      &s->io_ioport, 0, 4, TYPE_PCIE_BUS,
-                                     true);
+                                     s->refuse_bar_at_addr_0);
 
     pci_bus_set_route_irq_fn(pci->bus, gpex_route_intx_pin_to_irq);
     qdev_realize(DEVICE(&s->gpex_root), BUS(pci->bus), &error_fatal);
@@ -155,6 +155,8 @@ static Property gpex_host_properties[] = {
      */
     DEFINE_PROP_BOOL("allow-unmapped-accesses", GPEXHost,
                      allow_unmapped_accesses, true),
+    DEFINE_PROP_BOOL("refuse-bar-at-addr-0", GPEXHost,
+                     refuse_bar_at_addr_0, false),
     DEFINE_PROP_UINT64(PCI_HOST_ECAM_BASE, GPEXHost, gpex_cfg.ecam.base, 0),
     DEFINE_PROP_SIZE(PCI_HOST_ECAM_SIZE, GPEXHost, gpex_cfg.ecam.size, 0),
     DEFINE_PROP_UINT64(PCI_HOST_PIO_BASE, GPEXHost, gpex_cfg.pio.base, 0),
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 45a8c4f8190..8999fc348cb 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -1158,6 +1158,8 @@ static inline DeviceState *gpex_pcie_init(MemoryRegion *sys_mem,
                             pio_base, NULL);
     object_property_set_int(OBJECT(GPEX_HOST(dev)), PCI_HOST_PIO_SIZE,
                             pio_size, NULL);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
 
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
diff --git a/hw/xen/xen-pvh-common.c b/hw/xen/xen-pvh-common.c
index 218ac851cf7..3131a2dd280 100644
--- a/hw/xen/xen-pvh-common.c
+++ b/hw/xen/xen-pvh-common.c
@@ -139,6 +139,8 @@ static inline void xenpvh_gpex_init(XenPVHMachineState *s,
 
     object_initialize_child(OBJECT(s), "gpex", &s->pci.gpex,
                             TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(s), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     dev = DEVICE(&s->pci.gpex);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
diff --git a/hw/xtensa/virt.c b/hw/xtensa/virt.c
index 5310a888613..dcb39a67868 100644
--- a/hw/xtensa/virt.c
+++ b/hw/xtensa/virt.c
@@ -62,6 +62,8 @@ static void create_pcie(MachineState *ms, CPUXtensaState *env, int irq_base,
     int i;
 
     dev = qdev_new(TYPE_GPEX_HOST);
+    object_property_set_bool(OBJECT(dev), "refuse-bar-at-addr-0",
+                             true, &error_fatal);
     sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
 
     /* Map only the first size_ecam bytes of ECAM space. */
-- 
2.45.2



  parent reply	other threads:[~2024-11-26 11:28 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-26 11:21 [PATCH-for-10.0 v2 00/13] hw/boards: Remove legacy MachineClass::pci_allow_0_address flag Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 01/13] hw/pci: Do not declare PCIBus::flags mask as enum Philippe Mathieu-Daudé
2024-11-27  9:37   ` Philippe Mathieu-Daudé
2024-12-04  6:49     ` Thomas Huth
2024-11-26 11:22 ` [PATCH-for-10.0 v2 02/13] hw/pci-bridge: Initialize bridge with parent bus flags Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 03/13] hw/pci: Factor machine_refuses_bar_at_addr_0() helper out Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 04/13] hw/pci: Introduce PCIBusFlag::PCI_BUS_BAR_AT_ADDR0_REFUSED Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 05/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_internal_init() Philippe Mathieu-Daudé
2024-12-05 16:44   ` Peter Maydell
2024-12-05 21:24     ` Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 06/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_init() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 07/13] hw/pci: Propagate bar_at_addr_0_refused to pci_root_bus_new() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 08/13] hw/pci: Propagate bar_at_addr_0_refused to pci_register_root_bus() Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 09/13] hw/ppc/spapr: Create host bridge setting bar_at_addr_0_refused=false Philippe Mathieu-Daudé
2024-11-26 11:22 ` Philippe Mathieu-Daudé [this message]
2024-12-05 16:47   ` [PATCH-for-10.0 v2 10/13] hw/pci-host/gpex: Expose 'refuse-bar-at-addr-0' property Peter Maydell
2024-12-05 21:25     ` Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 11/13] hw/arm/virt: Create GPEX host bridge without refuse-bar-at-addr-0 Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 12/13] hw/riscv/virt: " Philippe Mathieu-Daudé
2024-11-26 11:22 ` [PATCH-for-10.0 v2 13/13] hw/pci/pci: Remove legacy MachineClass::pci_allow_0_address flag Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241126112212.64524-11-philmd@linaro.org \
    --to=philmd@linaro.org \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).