@@ -288,7 +288,8 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *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);
@@ -358,15 +358,18 @@ static bool pxb_dev_realize_common(PCIDevice *dev, enum BusType type,
ds = qdev_new(type == CXL ? TYPE_PXB_CXL_HOST : TYPE_PXB_HOST);
if (type == PCIE) {
- bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS);
+ bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS,
+ true);
bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT;
} else if (type == CXL) {
- bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS);
+ bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS,
+ true);
bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT;
bus->flags |= PCI_BUS_CXL;
PXB_CXL_DEV(dev)->cxl_host_bridge = PXB_CXL_HOST(ds);
} else {
- bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS);
+ bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS,
+ true);
bus->flags = parent_bus->flags & ~PCI_BUS_IS_ROOT;
bds = qdev_new("pci-bridge");
bds->id = g_strdup(dev_name);
@@ -1193,7 +1193,7 @@ static void gt64120_realize(DeviceState *dev, Error **errp)
phb->bus = 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);
pci_create_simple(phb->bus, PCI_DEVFN(0, 0), "gt64120_pci");
memory_region_init_io(&phb->conf_mem, OBJECT(phb),
@@ -268,7 +268,7 @@ static void i440fx_pcihost_realize(DeviceState *dev, Error **errp)
memory_region_add_coalescing(&phb->conf_mem, 0, 4);
b = 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 = b;
d = pci_create_simple(b, 0, s->pci_type);
@@ -65,7 +65,7 @@ static void q35_host_realize(DeviceState *dev, Error **errp)
pci->bus = 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);
qdev_realize(DEVICE(&s->mch), BUS(pci->bus), &error_fatal);
}
@@ -43,7 +43,7 @@ static void remote_pcihost_realize(DeviceState *dev, Error **errp)
pci->bus = 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);
}
static void remote_pcihost_class_init(ObjectClass *klass, void *data)
@@ -571,13 +571,14 @@ void pci_root_bus_init(PCIBus *bus, size_t bus_size, DeviceState *parent,
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;
bus = 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;
}
@@ -622,7 +623,7 @@ PCIBus *pci_register_root_bus(DeviceState *parent, const char *name,
{
PCIBus *bus;
- bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename);
+ bus = pci_root_bus_new(parent, name, mem, io, devfn_min, typename, true);
pci_bus_irqs(bus, set_irq, irq_opaque, nirq);
pci_bus_map_irqs(bus, map_irq);
return bus;
Have pci_root_bus_new() callers set the 'bar_at_addr_0_refused' argument. No logical change. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- 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(-)