Revision: 19070
          http://sourceforge.net/p/edk2/code/19070
Author:   lersek
Date:     2015-11-30 23:36:31 +0000 (Mon, 30 Nov 2015)
Log Message:
-----------
OvmfPkg: replace README fine print about X64 SMM S3 with PlatformPei check

At the moment, the "UefiCpuPkg/Universal/Acpi/S3Resume2Pei" module doesn't
support S3 resume if the platform has SMM enabled and the PEI phase is
built for X64. We document this in the README, but it is not conspicuous
enough.

Replace the "fine print" in the README with a runtime check in
PlatformPei.

Cc: Jordan Justen <[email protected]>
Suggested-by: Jordan Justen <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/PlatformPei/Platform.c
    trunk/edk2/OvmfPkg/PlatformPei/PlatformPei.inf
    trunk/edk2/OvmfPkg/README

Modified: trunk/edk2/OvmfPkg/PlatformPei/Platform.c
===================================================================
--- trunk/edk2/OvmfPkg/PlatformPei/Platform.c   2015-11-30 21:11:29 UTC (rev 
19069)
+++ trunk/edk2/OvmfPkg/PlatformPei/Platform.c   2015-11-30 23:36:31 UTC (rev 
19070)
@@ -22,6 +22,7 @@
 //
 // The Library classes this module consumes
 //
+#include <Library/BaseLib.h>
 #include <Library/DebugLib.h>
 #include <Library/HobLib.h>
 #include <Library/IoLib.h>
@@ -461,6 +462,27 @@
 }
 
 
+VOID
+S3Verification (
+  VOID
+  )
+{
+#if defined (MDE_CPU_X64)
+  if (FeaturePcdGet (PcdSmmSmramRequire) && mS3Supported) {
+    DEBUG ((EFI_D_ERROR,
+      "%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n", __FUNCTION__));
+    DEBUG ((EFI_D_ERROR,
+      "%a: Please disable S3 on the QEMU command line (see the README),\n",
+      __FUNCTION__));
+    DEBUG ((EFI_D_ERROR,
+      "%a: or build OVMF with \"OvmfPkgIa32X64.dsc\".\n", __FUNCTION__));
+    ASSERT (FALSE);
+    CpuDeadLoop ();
+  }
+#endif
+}
+
+
 /**
   Perform Platform PEI initialization.
 
@@ -488,6 +510,7 @@
     mS3Supported = TRUE;
   }
 
+  S3Verification ();
   BootModeInitialization ();
   AddressWidthInitialization ();
 

Modified: trunk/edk2/OvmfPkg/PlatformPei/PlatformPei.inf
===================================================================
--- trunk/edk2/OvmfPkg/PlatformPei/PlatformPei.inf      2015-11-30 21:11:29 UTC 
(rev 19069)
+++ trunk/edk2/OvmfPkg/PlatformPei/PlatformPei.inf      2015-11-30 23:36:31 UTC 
(rev 19070)
@@ -47,6 +47,7 @@
   gEfiXenInfoGuid
 
 [LibraryClasses]
+  BaseLib
   DebugLib
   HobLib
   IoLib

Modified: trunk/edk2/OvmfPkg/README
===================================================================
--- trunk/edk2/OvmfPkg/README   2015-11-30 21:11:29 UTC (rev 19069)
+++ trunk/edk2/OvmfPkg/README   2015-11-30 23:36:31 UTC (rev 19070)
@@ -170,11 +170,6 @@
 
   -global ICH9-LPC.disable_s3=1 \
 
-Dependent on the development status of the
-"UefiCpuPkg/Universal/Acpi/S3Resume2Pei" module, S3 resume may not work in
-OvmfPkg/OvmfPkgX64.dsc builds. In such cases, OvmfPkg/OvmfPkgIa32X64.dsc is
-recommended for running X64 guests.
-
 === Network Support ===
 
 OVMF provides a UEFI network stack by default. Its lowest level driver is the


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to