summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/Library/QemuFwCfgS3Lib
diff options
context:
space:
mode:
authorCeping Sun <cepingx.sun@intel.com>2024-05-07 06:33:57 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-09 02:57:02 +0000
commite5715711a41b3a323b1605e41e5875d377e7c9c2 (patch)
tree77b1ad22bee9b27e4965c174387d0909afe57d89 /OvmfPkg/Library/QemuFwCfgS3Lib
parent043615ae8b0df9635b509643fe1d5cedb6e1a64d (diff)
downloadedk2-e5715711a41b3a323b1605e41e5875d377e7c9c2.tar.gz
edk2-e5715711a41b3a323b1605e41e5875d377e7c9c2.tar.bz2
edk2-e5715711a41b3a323b1605e41e5875d377e7c9c2.zip
OvmfPkg/QemuFwCfgS3Lib: Disable S3 detection in TDVF
Refer to the section 2.1 of tdx-virtual-firmware-design-guide spec, APCI S3 is not supported in TDVF. Therefore, TDVF should not read the S3 status via fw_cfg and always set it as unsupported. spec: https://cdrdv2.intel.com/v1/dl/getContent/733585 Cc: Erdem Aktas <erdemaktas@google.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Elena Reshetova <elena.reshetova@intel.com> Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
Diffstat (limited to 'OvmfPkg/Library/QemuFwCfgS3Lib')
-rw-r--r--OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c b/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c
index 270f050336..e0c21461ce 100644
--- a/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c
+++ b/OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c
@@ -7,6 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
+#include <Library/BaseLib.h>
#include <Library/QemuFwCfgLib.h>
#include <Library/QemuFwCfgS3Lib.h>
@@ -32,6 +33,10 @@ QemuFwCfgS3Enabled (
UINTN FwCfgSize;
UINT8 SystemStates[6];
+ if (TdIsEnabled ()) {
+ return FALSE;
+ }
+
Status = QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSize);
if ((Status != RETURN_SUCCESS) || (FwCfgSize != sizeof SystemStates)) {
return FALSE;