In a later patch we will want to mark the flash memory as a
runtime services data memory range. This will allow a new runtime
services firmware block driver to read & write flash memory when
the OS has set up virtual memory protection.

Since this memory range will appear as runtime services data, we
need to adjust the limit when scanning for PCI window 32 down to
just below the flash device. If we don't adjust the limit, then
the algorithm in PopulateFwData will fail because it will see a
EfiGcdMemoryTypeSystemMemory memory range just below 4GB.

v2:
 * This patch replaces the v1 patch:
   "OvmfPkg/AcpiPlatformDxe/Qemu: Allow high runtime memory regions"

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
---
 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf |    1 +
 OvmfPkg/AcpiPlatformDxe/Qemu.c              |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf 
b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
index acc2247..90178e0 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -62,6 +62,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile
   gUefiCpuPkgTokenSpaceGuid.PcdCpuLocalApicBaseAddress
   gPcAtChipsetPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress
 
 [Depex]
   gEfiAcpiTableProtocolGuid
diff --git a/OvmfPkg/AcpiPlatformDxe/Qemu.c b/OvmfPkg/AcpiPlatformDxe/Qemu.c
index 8a6ecf7..06bd463 100644
--- a/OvmfPkg/AcpiPlatformDxe/Qemu.c
+++ b/OvmfPkg/AcpiPlatformDxe/Qemu.c
@@ -250,7 +250,7 @@ PopulateFwData(
       Desc = &AllDesc[CurDesc];
       ExclTop = Desc->BaseAddress + Desc->Length;
 
-      if (ExclTop <= BASE_4GB) {
+      if (ExclTop <= (UINT64) PcdGet32 (PcdOvmfFdBaseAddress)) {
         switch (Desc->GcdMemoryType) {
           case EfiGcdMemoryTypeNonExistent:
             break;
-- 
1.7.10.4


------------------------------------------------------------------------------
November Webinars for C, C++, Fortran Developers
Accelerate application performance with scalable programming models. Explore
techniques for threading, error checking, porting, and tuning. Get the most 
from the latest Intel processors and coprocessors. See abstracts and register
http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to