We will not be running DXE on S3 resume, so we don't
need to do these initialization items:
 * Reserve EMU Variable memory range
 * Declare Firmware volumes
 * Add memory HOBs

v5:
 * Move MiscInitialization back to running on S3 resume

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <[email protected]>
---
 OvmfPkg/PlatformPei/MemDetect.c | 16 ++++++++++------
 OvmfPkg/PlatformPei/Platform.c  |  8 +++++---
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c
index 722f651..c16f694 100644
--- a/OvmfPkg/PlatformPei/MemDetect.c
+++ b/OvmfPkg/PlatformPei/MemDetect.c
@@ -147,18 +147,22 @@ QemuInitializeRam (
   LowerMemorySize = GetSystemMemorySizeBelow4gb ();
   UpperMemorySize = GetSystemMemorySizeAbove4gb ();
 
-  //
-  // Create memory HOBs
-  //
-  AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
-  AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
+  if (mBootMode != BOOT_ON_S3_RESUME) {
+    //
+    // Create memory HOBs
+    //
+    AddMemoryRangeHob (BASE_1MB, LowerMemorySize);
+    AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
+  }
 
   MtrrSetMemoryAttribute (BASE_1MB, LowerMemorySize - BASE_1MB, 
CacheWriteBack);
 
   MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
 
   if (UpperMemorySize != 0) {
-    AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize);
+    if (mBootMode != BOOT_ON_S3_RESUME) {
+      AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize);
+    }
 
     MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
   }
diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 00c688d..11b4cb7 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -375,11 +375,13 @@ InitializePlatform (
     InitializeXen ();
   }
 
-  ReserveEmuVariableNvStore ();
+  if (mBootMode != BOOT_ON_S3_RESUME) {
+    ReserveEmuVariableNvStore ();
 
-  PeiFvInitialization ();
+    PeiFvInitialization ();
 
-  MemMapInitialization ();
+    MemMapInitialization ();
+  }
 
   MiscInitialization ();
 
-- 
1.9.rc1


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to