This is the EDK2 companion to the QEMU RFC v2 series [1]. This series implements the firmware side of fixed PCI BAR placement. QEMU exports validated fixed BAR addresses through the `etc/fixed-bars` fw_cfg file. This series consumes that information in two steps.
Patch 1 adds minimal changes to `PciBusDxe` to honor fixed BAR addresses supplied through `EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL`. When both `_MIF` and `_MAF` flags are set in an ACPI address descriptor returned by `CheckDevice()`, the described address is treated as a fixed requirement. `UpdatePciInfo()` records the fixed address on the BAR and `ProgramBar()` uses it in place of the GCD-allocated address. Patch 2 introduces `QemuFixedBarsDxe`, a new OvmfPkg driver that installs `EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL` before `PciBusDxe` starts. It reads the `etc/fixed-bars` fw_cfg blob, reserves the required address ranges in the GCD, and returns fixed BAR addresses through `CheckDevice()`. After `PciEnumerationComplete`, it reprograms bridge memory windows along each fixed root-port hierarchy to cover the fixed BAR placements. Testing: The series was tested together with the QEMU companion patches on the AArch64 `virt` machine using multiple PCI topologies, including emulated devices, VFIO passthrough devices, PCIe switches, and PCIe root ports configured for fixed BAR placement. A git branch with this series applied is available at: https://github.com/tdavenvidia/edk2/tree/RFC-v2-fixed-bar-upstream [1] companion QEMU RFC v2 https://github.com/tdavenvidia/upstream-qemu/tree/RFC-v2-fixed-bar-upstream Tushar Dave (2): MdeModulePkg/PciBusDxe: honor fixed BAR addresses from IncompatiblePci ArmVirtPkg,OvmfPkg: add QemuFixedBarsDxe for fixed PCI BAR placement ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 + MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 1 + .../Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 12 + .../Bus/Pci/PciBusDxe/PciResourceSupport.c | 13 + OvmfPkg/QemuFixedBarsDxe/QemuFixedBarsDxe.c | 772 ++++++++++++++++++ OvmfPkg/QemuFixedBarsDxe/QemuFixedBarsDxe.inf | 43 + 7 files changed, 843 insertions(+) create mode 100644 OvmfPkg/QemuFixedBarsDxe/QemuFixedBarsDxe.c create mode 100644 OvmfPkg/QemuFixedBarsDxe/QemuFixedBarsDxe.inf -- 2.34.1
