]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OvmfPkg/AcpiPlatformDxe/BootScript.c
OvmfPkg/MemEncryptSevLib: find pages of initial SMRAM save state map
[mirror_edk2.git] / OvmfPkg / AcpiPlatformDxe / BootScript.c
index a7d2f9e38f5742f2b9894b5234a5705d39e56a30..1a188bfd615cd914720faefe6ba5475632caa338 100644 (file)
@@ -249,7 +249,10 @@ FatalError:
                         because the ownership of S3Context has been transfered.\r
 \r
   @retval EFI_SUCCESS The translation of S3Context to ACPI S3 Boot Script\r
-                      opcodes has been successfully executed or queued.\r
+                      opcodes has been successfully executed or queued. (This\r
+                      includes the case when S3Context was empty on input and\r
+                      no ACPI S3 Boot Script opcodes have been necessary to\r
+                      produce.)\r
 \r
   @return             Error codes from underlying functions.\r
 **/\r
@@ -260,6 +263,11 @@ TransferS3ContextToBootScript (
 {\r
   RETURN_STATUS Status;\r
 \r
+  if (S3Context->Used == 0) {\r
+    ReleaseS3Context (S3Context);\r
+    return EFI_SUCCESS;\r
+  }\r
+\r
   Status = QemuFwCfgS3CallWhenBootScriptReady (AppendFwCfgBootScript,\r
              S3Context, sizeof (SCRATCH_BUFFER));\r
   return (EFI_STATUS)Status;\r