OvmfPkg/PlatformInitLib: Set dynamic MMIO window size to 1/4

Large multi-GPU passthrough configurations can exhaust the current
MMIO window sizing rule (1/8 of guest physical address space),
especially with newer GPUs that have very large BAR requirements and
alignment overhead.

With 46-bit guest physical addressing, the 1/8 rule provides an 8TB
MMIO window. Newer GPUs with 512GB VRAM can exhaust an 8TB window
when passing through up to 8 devices.

Increase the MMIO window size to 1/4 of guest physical address space.
This provides a 16TB MMIO window on a 46-bit setup.

Tested with 8-GPU passthrough (512GB VRAM per GPU). With this
change, all GPUs are visible and functional in the VM; without it,
one GPU was unusable.

Signed-off-by: ramkumar.s <ramkumar.s@nutanix.com>
This commit is contained in:
ramkumar.s 2026-08-21 04:52:36 +00:00 committed by Ard Biesheuvel
parent d98a39d4ce
commit 7735ed4f8e

View file

@ -815,7 +815,7 @@ PlatformDynamicMmioWindow (
UINT64 AddrSpace, MmioSpace;
AddrSpace = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth);
MmioSpace = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth - 3);
MmioSpace = LShiftU64 (1, PlatformInfoHob->PhysMemAddressWidth - 2);
if (PlatformInfoHob->PcdPciMmio64Override) {
DEBUG ((DEBUG_INFO, "%a: using fwcfg override for mmio window\n", __func__));