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

Lin, Gary (HPS OE-Linux) posted 4 patches 4 years, 5 months ago
There is a newer version of this series
[edk2-devel] [PATCH v3 4/4] OvmfPkg/SmmControl2Dxe: use PcdAcpiS3Enable to detect S3 support
Posted by Lin, Gary (HPS OE-Linux) 4 years, 5 months ago
https://bugzilla.tianocore.org/show_bug.cgi?id=3573

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

v3:
  - Add the bugzilla link

Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Jim Fehlig <jfehlig@suse.com>
Cc: Joey Li <jlee@suse.com>
Signed-off-by: Gary Lin <gary.lin@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 (#79711): https://edk2.groups.io/g/devel/message/79711
Mute This Topic: https://groups.io/mt/85080304/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] [PATCH v3 4/4] OvmfPkg/SmmControl2Dxe: use PcdAcpiS3Enable to detect S3 support
Posted by Gerd Hoffmann 4 years, 5 months ago
On Mon, Aug 23, 2021 at 03:09:25PM +0800, Lin, Gary (HPS OE-Linux) wrote:
> https://bugzilla.tianocore.org/show_bug.cgi?id=3573
> 
> To avoid the potential inconsistency between PcdAcpiS3Enable and
> QemuFwCfgS3Enabled(), this commit modifies SmmControl2Dxe to detect
> S3 support by PcdAcpiS3Enable as modules in MdeModulePkg do.

Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#79759): https://edk2.groups.io/g/devel/message/79759
Mute This Topic: https://groups.io/mt/85080304/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-