audk/OvmfPkg/XenPlatformPei
Igor Druzhinin e68c2a22ca OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen
We faced a problem with passing through a PCI device with 64GB BAR to UEFI
guest. The BAR is expectedly programmed into 64-bit PCI aperture at 64G
address which pushes physical address space to 37 bits. That is above
36-bit width that OVMF exposes currently to a guest without tweaking
PcdPciMmio64Size knob.

The reverse calculation using this knob was inhereted from QEMU-KVM
platform code where it serves the purpose of finding max accessible
physical address without necessary trusting emulated CPUID physbits value
(that could be different from host physbits). On Xen we expect to use
CPUID policy to level the data correctly to prevent situations with guest
physbits > host physbits e.g. across migrations.

The next aspect raising concern - resource consumption for DXE IPL page
tables and time required to map the whole address space in case of using
CPUID bits directly. That could be mitigated by enabling support for 1G
pages in DXE IPL configuration. 1G pages are available on most CPUs
produced in the last 10 years and those without don't have many phys bits.

Remove all the redundant code now (including PcdPciMmio64.. handling
that's not used on Xen anyway) and grab physbits directly from CPUID that
should be what baremetal UEFI systems do.

Signed-off-by: Igor Druzhinin <igor.druzhinin@citrix.com>
Message-Id: <1610509335-23314-1-git-send-email-igor.druzhinin@citrix.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Julien Grall <julien@xen.org>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>
[lersek@redhat.com: fix up authorship from groups.io-mangled From line]
[lersek@redhat.com: wrap commit message at 74 characters]
2021-01-19 17:00:08 +00:00
..
AmdSev.c OvmfPkg: Obtain SEV encryption mask with the new MemEncryptSevLib API 2021-01-07 19:34:39 +00:00
ClearCache.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Cmos.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Cmos.h OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
Fv.c OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
MemDetect.c OvmfPkg/XenPlatformPei: Use CPUID to get physical address width on Xen 2021-01-19 17:00:08 +00:00
Platform.c OvmfPkg/XenPlatformPei: Ignore missing PCI Host Bridge on Xen PVH 2019-08-21 18:03:49 +02:00
Platform.h OvmfPkg/XenPlatformPei: Rework memory detection 2019-08-21 18:03:49 +02:00
Xen.c OvmfPkg/XenPlatformPei: Reserve VGA memory region, to boot Linux 2019-08-21 18:03:49 +02:00
Xen.h OvmfPkg: Introduce XenPlatformPei 2019-08-21 18:03:49 +02:00
XenPlatformPei.inf OvmfPkg/XenPlatformPei: Reinit XenHypercallLib 2019-08-21 18:03:49 +02:00