All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tushar Dave <tdave@nvidia.com>
To: devel@edk2.groups.io
Cc: gaoliming@byosoft.com.cn, ardb+tianocore@kernel.org,
	sami.mujawar@arm.com, jiewen.yao@intel.com, kraxel@redhat.com,
	qemu-devel@nongnu.org, alwilliamson@nvidia.com, jgg@nvidia.com,
	skolothumtho@nvidia.com
Subject: [RFC PATCH v2 0/2] MdeModulePkg, OvmfPkg: fixed PCI BAR placement
Date: Wed, 26 Aug 2026 19:45:28 -0500	[thread overview]
Message-ID: <20260827004530.600410-1-tdave@nvidia.com> (raw)

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



             reply	other threads:[~2026-08-27  0:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27  0:45 Tushar Dave [this message]
2026-08-27  0:45 ` [RFC PATCH v2 1/2] MdeModulePkg/PciBusDxe: honor fixed BAR addresses from IncompatiblePci Tushar Dave
2026-08-27  0:45 ` [RFC PATCH v2 2/2] ArmVirtPkg, OvmfPkg: add QemuFixedBarsDxe for fixed PCI BAR placement Tushar Dave via qemu development

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260827004530.600410-1-tdave@nvidia.com \
    --to=tdave@nvidia.com \
    --cc=alwilliamson@nvidia.com \
    --cc=ardb+tianocore@kernel.org \
    --cc=devel@edk2.groups.io \
    --cc=gaoliming@byosoft.com.cn \
    --cc=jgg@nvidia.com \
    --cc=jiewen.yao@intel.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sami.mujawar@arm.com \
    --cc=skolothumtho@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.