Hi Marc, On 10/3/21 6:46 PM, Marc Zyngier wrote: > Currently, the highmem PCIe region is oddly keyed on the highmem > attribute instead of highmem_ecam. Move the enablement of this PCIe > region over to highmem_ecam. > > Signed-off-by: Marc Zyngier <maz@xxxxxxxxxx> > --- > hw/arm/virt-acpi-build.c | 10 ++++------ > hw/arm/virt.c | 4 ++-- > 2 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c > index 037cc1fd82..d7bef0e627 100644 > --- a/hw/arm/virt-acpi-build.c > +++ b/hw/arm/virt-acpi-build.c > @@ -157,10 +157,9 @@ static void acpi_dsdt_add_virtio(Aml *scope, > } > > static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > - uint32_t irq, bool use_highmem, bool highmem_ecam, > - VirtMachineState *vms) > + uint32_t irq, VirtMachineState *vms) > { > - int ecam_id = VIRT_ECAM_ID(highmem_ecam); > + int ecam_id = VIRT_ECAM_ID(vms->highmem_ecam); > struct GPEXConfig cfg = { > .mmio32 = memmap[VIRT_PCIE_MMIO], > .pio = memmap[VIRT_PCIE_PIO], > @@ -169,7 +168,7 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, > .bus = vms->bus, > }; > > - if (use_highmem) { > + if (vms->highmem_ecam) { highmem_ecam is more restrictive than use_highmem: vms->highmem_ecam &= vms->highmem && (!firmware_loaded || aarch64); If I remember correctly there was a problem using highmem ECAM with 32b AAVMF FW. However 5125f9cd2532 ("hw/arm/virt: Add high MMIO PCI region, 512G in size") introduced high MMIO PCI region without this constraint. So to me we should keep vms->highmem here Eric > cfg.mmio64 = memmap[VIRT_HIGH_PCIE_MMIO]; > } > > @@ -712,8 +711,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, VirtMachineState *vms) > acpi_dsdt_add_fw_cfg(scope, &memmap[VIRT_FW_CFG]); > acpi_dsdt_add_virtio(scope, &memmap[VIRT_MMIO], > (irqmap[VIRT_MMIO] + ARM_SPI_BASE), NUM_VIRTIO_TRANSPORTS); > - acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), > - vms->highmem, vms->highmem_ecam, vms); > + acpi_dsdt_add_pci(scope, memmap, (irqmap[VIRT_PCIE] + ARM_SPI_BASE), vms); > if (vms->acpi_dev) { > build_ged_aml(scope, "\\_SB."GED_DEVICE, > HOTPLUG_HANDLER(vms->acpi_dev), > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > index 7170aaacd5..8021d545c3 100644 > --- a/hw/arm/virt.c > +++ b/hw/arm/virt.c > @@ -1362,7 +1362,7 @@ static void create_pcie(VirtMachineState *vms) > mmio_reg, base_mmio, size_mmio); > memory_region_add_subregion(get_system_memory(), base_mmio, mmio_alias); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > /* Map high MMIO space */ > MemoryRegion *high_mmio_alias = g_new0(MemoryRegion, 1); > > @@ -1416,7 +1416,7 @@ static void create_pcie(VirtMachineState *vms) > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", > 2, base_ecam, 2, size_ecam); > > - if (vms->highmem) { > + if (vms->highmem_ecam) { > qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", > 1, FDT_PCI_RANGE_IOPORT, 2, 0, > 2, base_pio, 2, size_pio,