@@ -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;
};
@@ -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 */
@@ -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);
@@ -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 */
@@ -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;
@@ -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;
@@ -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. */
@@ -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),
@@ -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);
@@ -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);
@@ -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. */
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(-)