[edk2-devel] [PATCH v2 5/5] OvmfPkg/SmmControl2Dxe: use PcdAcpiS3Enable to detect S3 support

Lin, Gary (HPS OE-Linux) gary.lin at hpe.com
Fri Aug 13 06:13:05 UTC 2021


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

Cc: Ard Biesheuvel <ardb+tianocore at kernel.org>
Cc: Jiewen Yao <jiewen.yao at intel.com>
cc: Jordan Justen <jordan.l.justen at intel.com>
Cc: Jim Fehlig <jfehlig at suse.com>
Cc: Joey Li <jlee at suse.com>
Signed-off-by: Gary Lin <gary.lin at hpe.com>
---
 OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf | 2 ++
 OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c   | 4 +---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
index b8fdea8deb84..4cad56516f49 100644
--- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
+++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.inf
@@ -39,6 +39,7 @@ [Sources]
 

 [Packages]

   MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

   OvmfPkg/OvmfPkg.dec

   UefiCpuPkg/UefiCpuPkg.dec

 

@@ -62,6 +63,7 @@ [Protocols]
 [Pcd]

   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout ## SOMETIMES_PRODUCES

   gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode      ## SOMETIMES_PRODUCES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable

 

 [FeaturePcd]

   gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire

diff --git a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
index 9547c202880f..be04baf7b288 100644
--- a/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
+++ b/OvmfPkg/SmmControl2Dxe/SmmControl2Dxe.c
@@ -25,8 +25,6 @@
 #include <Library/IoLib.h>

 #include <Library/PcdLib.h>

 #include <Library/PciLib.h>

-#include <Library/QemuFwCfgLib.h>

-#include <Library/QemuFwCfgS3Lib.h>

 #include <Library/UefiBootServicesTableLib.h>

 #include <Protocol/S3SaveState.h>

 #include <Protocol/SmmControl2.h>

@@ -238,7 +236,7 @@ SmmControl2DxeEntryPoint (
   //

   mSmiFeatureNegotiation = NegotiateSmiFeatures ();

 

-  if (QemuFwCfgS3Enabled ()) {

+  if (PcdGetBool (PcdAcpiS3Enable)) {

     VOID *Registration;

 

     //

-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79250): https://edk2.groups.io/g/devel/message/79250
Mute This Topic: https://groups.io/mt/84857782/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list