> -----Original Message-----
> From: Tushar Dave <[email protected]>
> Sent: 16 September 2026 19:56
> To: [email protected]
> Cc: [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; Alex Williamson
> <[email protected]>; Jason Gunthorpe <[email protected]>; Shameer
> Kolothum Thodi <[email protected]>
> Subject: [PATCH 4/5] hw/arm/virt: export fixed BAR metadata via fw_cfg
>
> Export fixed BAR metadata from the virt machine through the
> "etc/fixed-bars" fw_cfg file during machine initialization.
>
> Fixed BAR placement requires firmware to preserve the PCI resource
> configuration established by QEMU. ACPI provides this via the PCI
> boot configuration preservation mechanism, _DSM function 5.
>
> Reject fixed BAR configuration when ACPI is disabled, and request PCI
> boot configuration preservation when ACPI is enabled.
>
> Signed-off-by: Tushar Dave <[email protected]>
> ---
> hw/arm/virt.c | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index 3eecf094bc..c5db663858 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -95,6 +95,7 @@
> #include "hw/cxl/cxl_host.h"
> #include "qemu/guest-random.h"
> #include "hw/watchdog/sbsa_gwdt.h"
> +#include "hw/pci/pci-fixed-bar.h"
>
> static GlobalProperty arm_virt_compat_defaults[] = {
> { TYPE_VIRTIO_IOMMU_PCI, "aw-bits", "48" },
> @@ -2438,6 +2439,21 @@ void virt_machine_done(Notifier *notifier, void
> *data)
> vms->memmap[VIRT_PLATFORM_BUS].size,
> vms->irqmap[VIRT_PLATFORM_BUS]);
> }
> + if (fixed_bars_write_blob(vms->fw_cfg,
> + vms->memmap[VIRT_PCIE_MMIO].base,
> + vms->memmap[VIRT_PCIE_MMIO].size,
> + vms->memmap[VIRT_HIGH_PCIE_MMIO].base,
> + vms->memmap[VIRT_HIGH_PCIE_MMIO].size)) {
Should we check for vms->highmem_mmio here? The memmap entry still
contains a base and size when highmem-mmio=off, but the aperture is
not mapped or advertised in ACPI.
> + if (!virt_is_acpi_enabled(vms)) {
virt_is_acpi_enabled() merely checks that ACPI is not explicitly disabled. With
the
default acpi=auto, it returns true even for direct kernel boot without firmware.
Should check vms->bootinfo.firmware_loaded as well.
Thanks,
Shameer