]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
OvmfPkg/QemuFwCfgS3Lib: Disable S3 detection in TDVF
authorCeping Sun <cepingx.sun@intel.com>
Mon, 6 May 2024 22:33:57 +0000 (06:33 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 9 Sep 2024 02:57:02 +0000 (02:57 +0000)
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>
OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c

index 270f0503367c54b9406869f1e01b25736a9f3ad5..e0c21461ce0e4c6aae38e1d4131595ae33ba4e69 100644 (file)
@@ -7,6 +7,7 @@
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 **/\r
 \r
+#include <Library/BaseLib.h>\r
 #include <Library/QemuFwCfgLib.h>\r
 #include <Library/QemuFwCfgS3Lib.h>\r
 \r
@@ -32,6 +33,10 @@ QemuFwCfgS3Enabled (
   UINTN                 FwCfgSize;\r
   UINT8                 SystemStates[6];\r
 \r
+  if (TdIsEnabled ()) {\r
+    return FALSE;\r
+  }\r
+\r
   Status = QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSize);\r
   if ((Status != RETURN_SUCCESS) || (FwCfgSize != sizeof SystemStates)) {\r
     return FALSE;\r