summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2022-12-07 06:32:15 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-12-23 11:53:40 +0000
commitbf65d7ee8842a93116534f727abcad235dd3e233 (patch)
treeb5c4af68da8ac320f705485abd7768ce57c3c588 /OvmfPkg
parent16acacf24c2c1fa2eff9148ae8ec952d74e3ab03 (diff)
downloadedk2-bf65d7ee8842a93116534f727abcad235dd3e233.tar.gz
edk2-bf65d7ee8842a93116534f727abcad235dd3e233.tar.bz2
edk2-bf65d7ee8842a93116534f727abcad235dd3e233.zip
OvmfPkg/PlatformInitLib: pass through reservations from qemu
qemu uses the etc/e820 fw_cfg file not only for memory, but also for reservations. Handle reservations by adding resource descriptor hobs for them. A typical qemu configuration has a small reservation between lapic and flash: # sudo cat /proc/iomem [ ... ] fee00000-fee00fff : Local APIC feffc000-feffffff : Reserved <= HERE ffc00000-ffffffff : Reserved [ ... ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/Library/PlatformInitLib/MemDetect.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/OvmfPkg/Library/PlatformInitLib/MemDetect.c b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
index 6dbdbf9306..0c49568526 100644
--- a/OvmfPkg/Library/PlatformInitLib/MemDetect.c
+++ b/OvmfPkg/Library/PlatformInitLib/MemDetect.c
@@ -229,6 +229,22 @@ PlatformScanOrAdd64BitE820Ram (
));
}
}
+ } else if (E820Entry.Type == EfiAcpiAddressRangeReserved) {
+ if (AddHighHob) {
+ DEBUG ((
+ DEBUG_INFO,
+ "%a: Reserved: Base=0x%Lx Length=0x%Lx\n",
+ __FUNCTION__,
+ E820Entry.BaseAddr,
+ E820Entry.Length
+ ));
+ BuildResourceDescriptorHob (
+ EFI_RESOURCE_MEMORY_RESERVED,
+ 0,
+ E820Entry.BaseAddr,
+ E820Entry.Length
+ );
+ }
}
}