summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/XenPlatformPei/Platform.c
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2019-08-13 12:31:07 +0100
committerLaszlo Ersek <lersek@redhat.com>2019-08-21 18:03:49 +0200
commit24465c380a3e6fb90f9efaf03184b658059e4ccd (patch)
treef3e1e7081bea0d115d797caf8a342df8c57a751d /OvmfPkg/XenPlatformPei/Platform.c
parenta749e1f93be67a799fcfb437253a533e462b90ee (diff)
downloadedk2-24465c380a3e6fb90f9efaf03184b658059e4ccd.tar.gz
edk2-24465c380a3e6fb90f9efaf03184b658059e4ccd.tar.bz2
edk2-24465c380a3e6fb90f9efaf03184b658059e4ccd.zip
OvmfPkg/XenPlatformPei: Rework memory detection
When running as a Xen PVH guest, there is no CMOS to read the memory size from. Rework GetSystemMemorySize(Below|Above)4gb() so they can work without CMOS by reading the e820 table. Rework XenPublishRamRegions to also care for the reserved and ACPI entry in the e820 table. The region that was added by InitializeXen() isn't needed as that same entry is in the e820 table provided by hvmloader. MTRR settings aren't modified anymore, on HVM it's already done by hvmloader, on PVH it is supposed to have sane default. MTRR will need to be done properly but keeping what's already been done by programs that have run before OVMF will do for now. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689 Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20190813113119.14804-24-anthony.perard@citrix.com>
Diffstat (limited to 'OvmfPkg/XenPlatformPei/Platform.c')
-rw-r--r--OvmfPkg/XenPlatformPei/Platform.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c
index 6aaafc3ee9..2f42ca6ccd 100644
--- a/OvmfPkg/XenPlatformPei/Platform.c
+++ b/OvmfPkg/XenPlatformPei/Platform.c
@@ -103,6 +103,17 @@ AddReservedMemoryBaseSizeHob (
}
VOID
+AddReservedMemoryRangeHob (
+ EFI_PHYSICAL_ADDRESS MemoryBase,
+ EFI_PHYSICAL_ADDRESS MemoryLimit,
+ BOOLEAN Cacheable
+ )
+{
+ AddReservedMemoryBaseSizeHob (MemoryBase,
+ (UINT64)(MemoryLimit - MemoryBase), Cacheable);
+}
+
+VOID
AddIoMemoryRangeHob (
EFI_PHYSICAL_ADDRESS MemoryBase,
EFI_PHYSICAL_ADDRESS MemoryLimit