OvmfPkg/LockBoxLib: use PcdAcpiS3Enable to detect S3 support

To avoid the potential inconsistency between PcdAcpiS3Enable and
QemuFwCfgS3Enabled(), this commit modifies LockBoxLib to detect
S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3573
Signed-off-by: Gary Lin <gary.lin@hpe.com>
Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
Tested-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Lin, Gary (HPS OE-Linux)
2021-08-31 09:31:13 +08:00
committed by mergify[bot]
parent cb0d24637d
commit 28152333bc
2 changed files with 2 additions and 5 deletions

View File

@@ -12,8 +12,6 @@
#include <Library/UefiBootServicesTableLib.h> #include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseMemoryLib.h> #include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h> #include <Library/DebugLib.h>
#include <Library/QemuFwCfgLib.h>
#include <Library/QemuFwCfgS3Lib.h>
#include <Protocol/LockBox.h> #include <Protocol/LockBox.h>
#include <LockBoxLib.h> #include <LockBoxLib.h>
@@ -117,7 +115,7 @@ LockBoxDxeLibInitialize (
Status = LockBoxLibInitialize (); Status = LockBoxLibInitialize ();
if (!EFI_ERROR (Status)) { if (!EFI_ERROR (Status)) {
if (QemuFwCfgS3Enabled ()) { if (PcdGetBool (PcdAcpiS3Enable)) {
// //
// When S3 enabled, the first driver run with this library linked will // When S3 enabled, the first driver run with this library linked will
// have this library constructor to install LockBox protocol on the // have this library constructor to install LockBox protocol on the

View File

@@ -33,8 +33,6 @@
BaseMemoryLib BaseMemoryLib
DebugLib DebugLib
UefiBootServicesTableLib UefiBootServicesTableLib
QemuFwCfgLib
QemuFwCfgS3Lib
[Protocols] [Protocols]
gEfiLockBoxProtocolGuid ## SOMETIMES_PRODUCES gEfiLockBoxProtocolGuid ## SOMETIMES_PRODUCES
@@ -42,6 +40,7 @@
[Pcd] [Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageBase
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize gUefiOvmfPkgTokenSpaceGuid.PcdOvmfLockBoxStorageSize
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable
[FeaturePcd] [FeaturePcd]
gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire