]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: S3 Suspend: enable creation/saving of an S3 Boot Script
authorLaszlo Ersek <lersek@redhat.com>
Tue, 4 Mar 2014 08:03:50 +0000 (08:03 +0000)
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 4 Mar 2014 08:03:50 +0000 (08:03 +0000)
"MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf" produces
the EFI_S3_SAVE_STATE_PROTOCOL which allows creation and saving of an S3
Boot Script, to be replayed in PEI during S3 Resume. The script contains
opcodes and opcode arguments to configure CPU, PCI and IO resources.

S3SaveStateDxe relies on the S3BootScriptLib library. The Null
implementation is not useful for actually saving the boot script, we need
the PiDxeS3BootScriptLib instance.

The PiDxeS3BootScriptLib library instance depends on LockBoxLib,
implemented for OVMF in one of the previous patches.

PiDxeS3BootScriptLib also depends on SmbusLib. For now we opt for the Null
instance of the latter. It means that SMBus commands in the boot script
will have no effect when interpreted during S3 Resume. This should be fine
for OvmfPkg and QEMU.

  EFI_S3_SAVE_STATE_PROTOCOL [S3SaveStateDxe]
    S3BootScriptLib [PiDxeS3BootScriptLib]
      SmbusLib [BaseSmbusLibNull]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]

When the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is installed by any DXE driver
(purely as a form of notification), the S3SaveStateDxe driver saves the
boot script to EfiACPIMemoryNVS, and links it into the LockBox.

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@15304 6f19259b-4bc3-4df7-8a09-765794883524

OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32.fdf
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgIa32X64.fdf
OvmfPkg/OvmfPkgX64.dsc
OvmfPkg/OvmfPkgX64.fdf

index 771d3a574c6aee1de709b4eb4cf992c0ff05eb98..40f31c4ba403c23f6d41bffe04d76f93a7d259a1 100644 (file)
   TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
 !endif\r
 \r
+  S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
+  SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
+\r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
   OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
   OvmfPkg/AcpiTables/AcpiTables.inf\r
   OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
   #\r
   # Network Support\r
index 970dc6e17d629ebf1b6ed36a61d1ea0c6be1a079..0ec93b51f9f80dd3eed62bb1b6bb44f995ab5d80 100644 (file)
@@ -322,6 +322,7 @@ INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 INF  OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
 INF  RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf\r
 INF  OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+INF  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
 INF  RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf\r
 \r
index 37181f4347cafea47455956e085d95d11129028a..38454934a9cc1e7573571facf0bc0049313e83b7 100644 (file)
   TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
 !endif\r
 \r
+  S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
+  SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
+\r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
   OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
   OvmfPkg/AcpiTables/AcpiTables.inf\r
   OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
   #\r
   # Network Support\r
index 7c33dcc17608f0197ce7837c4e80bfb15a7184ce..42dff856ae2d355daffcd406aa365c47c66dd267 100644 (file)
@@ -322,6 +322,7 @@ INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 INF  OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
 INF  RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf\r
 INF  OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+INF  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
 INF  RuleOverride = BINARY USE = X64 FatBinPkg/EnhancedFatDxe/Fat.inf\r
 \r
index 87a7c73b846538130b00ff19693acb5fa0c6652e..5ceaa324ea9e44bc8cff4df4f108bf518594ea7e 100644 (file)
   TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf\r
 !endif\r
 \r
+  S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf\r
+  SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf\r
+\r
 [LibraryClasses.common]\r
 !if $(SECURE_BOOT_ENABLE) == TRUE\r
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
   OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
   OvmfPkg/AcpiTables/AcpiTables.inf\r
   OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
   #\r
   # Network Support\r
index c0f99f1a33c8a768cb79685189dc91225fdfc1f0..2b808dd7442c9ce0591958b655defb835257adb1 100644 (file)
@@ -322,6 +322,7 @@ INF  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
 INF  OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf\r
 INF  RuleOverride=ACPITABLE OvmfPkg/AcpiTables/AcpiTables.inf\r
 INF  OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf\r
+INF  MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf\r
 \r
 INF  RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf\r
 \r