summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorAnthony PERARD <anthony.perard@citrix.com>2019-08-13 12:31:08 +0100
committerLaszlo Ersek <lersek@redhat.com>2019-08-21 18:03:49 +0200
commit77d35f50080ad8dc1995a79f4056ee0567188c7c (patch)
treeccd434c787873ce37d72e0c95cf547459dd4fcc6 /OvmfPkg
parent24465c380a3e6fb90f9efaf03184b658059e4ccd (diff)
downloadedk2-77d35f50080ad8dc1995a79f4056ee0567188c7c.tar.gz
edk2-77d35f50080ad8dc1995a79f4056ee0567188c7c.tar.bz2
edk2-77d35f50080ad8dc1995a79f4056ee0567188c7c.zip
OvmfPkg/XenPlatformPei: Reserve VGA memory region, to boot Linux
Linux panic if the VGA region isn't reserved. When Linux is booted on EFI system, it expects the memory at 0xa0000 to _not_ be conventional memory. Otherwise a variable isn't initialised properly and Linux panic when a virtual console/terminal is asked to be created. See for more detail: https://lists.xenproject.org/archives/html/xen-devel/2019-03/msg02139.html 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-25-anthony.perard@citrix.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/XenPlatformPei/Xen.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/OvmfPkg/XenPlatformPei/Xen.c b/OvmfPkg/XenPlatformPei/Xen.c
index c4506def9a..c41fecdc48 100644
--- a/OvmfPkg/XenPlatformPei/Xen.c
+++ b/OvmfPkg/XenPlatformPei/Xen.c
@@ -294,6 +294,12 @@ XenPublishRamRegions (
Status = XenGetE820Map (&E820Map, &E820EntriesCount);
ASSERT_EFI_ERROR (Status);
+ AddMemoryBaseSizeHob (0, 0xA0000);
+ //
+ // Video memory + Legacy BIOS region, to allow Linux to boot.
+ //
+ AddReservedMemoryBaseSizeHob (0xA0000, BASE_1MB - 0xA0000, TRUE);
+
LapicBase = PcdGet32 (PcdCpuLocalApicBaseAddress);
LapicEnd = LapicBase + SIZE_1MB;
AddIoMemoryRangeHob (LapicBase, LapicEnd);
@@ -312,6 +318,16 @@ XenPublishRamRegions (
Base = ALIGN_VALUE (Entry->BaseAddr, (UINT64)EFI_PAGE_SIZE);
End = (Entry->BaseAddr + Entry->Length) & ~(UINT64)EFI_PAGE_MASK;
+ //
+ // Ignore the first 1MB, this is handled before the loop.
+ //
+ if (Base < BASE_1MB) {
+ Base = BASE_1MB;
+ }
+ if (Base >= End) {
+ continue;
+ }
+
switch (Entry->Type) {
case EfiAcpiAddressRangeMemory:
AddMemoryRangeHob (Base, End);