]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: replace README fine print about X64 SMM S3 with PlatformPei check
authorLaszlo Ersek <lersek@redhat.com>
Mon, 30 Nov 2015 23:36:31 +0000 (23:36 +0000)
committerlersek <lersek@Edk2>
Mon, 30 Nov 2015 23:36:31 +0000 (23:36 +0000)
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 <jordan.l.justen@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19070 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/PlatformPei/Platform.c
OvmfPkg/PlatformPei/PlatformPei.inf
OvmfPkg/README

index 0b112751571778b34d0ddf4b03e552fcf77b1182..6735b50d703520a7a9cbe3d71ca8d29b5c84f59f 100644 (file)
@@ -22,6 +22,7 @@
 //\r
 // The Library classes this module consumes\r
 //\r
+#include <Library/BaseLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/IoLib.h>\r
@@ -461,6 +462,27 @@ DebugDumpCmos (
 }\r
 \r
 \r
+VOID\r
+S3Verification (\r
+  VOID\r
+  )\r
+{\r
+#if defined (MDE_CPU_X64)\r
+  if (FeaturePcdGet (PcdSmmSmramRequire) && mS3Supported) {\r
+    DEBUG ((EFI_D_ERROR,\r
+      "%a: S3Resume2Pei doesn't support X64 PEI + SMM yet.\n", __FUNCTION__));\r
+    DEBUG ((EFI_D_ERROR,\r
+      "%a: Please disable S3 on the QEMU command line (see the README),\n",\r
+      __FUNCTION__));\r
+    DEBUG ((EFI_D_ERROR,\r
+      "%a: or build OVMF with \"OvmfPkgIa32X64.dsc\".\n", __FUNCTION__));\r
+    ASSERT (FALSE);\r
+    CpuDeadLoop ();\r
+  }\r
+#endif\r
+}\r
+\r
+\r
 /**\r
   Perform Platform PEI initialization.\r
 \r
@@ -488,6 +510,7 @@ InitializePlatform (
     mS3Supported = TRUE;\r
   }\r
 \r
+  S3Verification ();\r
   BootModeInitialization ();\r
   AddressWidthInitialization ();\r
 \r
index dc7729309b516a2c57cb473f4e0d5aff1b1fc9f5..11b38652924264466079b9f7f428012bd4612b51 100644 (file)
@@ -47,6 +47,7 @@
   gEfiXenInfoGuid\r
 \r
 [LibraryClasses]\r
+  BaseLib\r
   DebugLib\r
   HobLib\r
   IoLib\r
index 0f70fa7359d0d045151b9047b9f2cadff2371833..e6137ddc1f3695f07471d93fe53bb2a8829f43f0 100644 (file)
@@ -170,11 +170,6 @@ can be used on Windows.
 \r
   -global ICH9-LPC.disable_s3=1 \\r
 \r
-Dependent on the development status of the\r
-"UefiCpuPkg/Universal/Acpi/S3Resume2Pei" module, S3 resume may not work in\r
-OvmfPkg/OvmfPkgX64.dsc builds. In such cases, OvmfPkg/OvmfPkgIa32X64.dsc is\r
-recommended for running X64 guests.\r
-\r
 === Network Support ===\r
 \r
 OVMF provides a UEFI network stack by default. Its lowest level driver is the\r