]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg/XenPlatformPei: Rework memory detection
authorAnthony PERARD <anthony.perard@citrix.com>
Tue, 13 Aug 2019 11:31:07 +0000 (12:31 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 21 Aug 2019 16:03:49 +0000 (18:03 +0200)
commit24465c380a3e6fb90f9efaf03184b658059e4ccd
treef3e1e7081bea0d115d797caf8a342df8c57a751d
parenta749e1f93be67a799fcfb437253a533e462b90ee
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>
OvmfPkg/XenPlatformPei/MemDetect.c
OvmfPkg/XenPlatformPei/Platform.c
OvmfPkg/XenPlatformPei/Platform.h
OvmfPkg/XenPlatformPei/Xen.c