OvmfPkg/PlatformPei: Allocate PEI FV as ACPI NVS if S3 is supported
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 4 Mar 2014 08:02:59 +0000 (08:02 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 4 Mar 2014 08:02:59 +0000 (08:02 +0000)
On S3 resume, we skip decompression of the PEI FV, and expect
to jump directly into it. For this to work, we need the OS to
leave the memory range untouched.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15299 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/PlatformPei/Fv.c

index 1ee417a091dbd3a9693a84df5a7999597d448ea3..3ed775c850832f472df524cf8f0522662ec5dae5 100644 (file)
@@ -13,6 +13,7 @@
 **/\r
 \r
 #include "PiPei.h"\r
+#include "Platform.h"\r
 #include <Library/DebugLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/PeiServicesLib.h>\r
@@ -36,12 +37,12 @@ PeiFvInitialization (
   //\r
   // Create a memory allocation HOB for the PEI FV.\r
   //\r
-  // Note: This should be changed to ACPI NVS when S3 resume is enabled.\r
+  // Allocate as ACPI NVS is S3 is supported\r
   //\r
   BuildMemoryAllocationHob (\r
     PcdGet32 (PcdOvmfPeiMemFvBase),\r
     PcdGet32 (PcdOvmfPeiMemFvSize),\r
-    EfiBootServicesData\r
+    mS3Supported ? EfiACPIMemoryNVS : EfiBootServicesData\r
     );\r
 \r
   //\r