From: Ceping Sun Date: Mon, 6 May 2024 22:33:57 +0000 (+0800) Subject: OvmfPkg/QemuFwCfgS3Lib: Disable S3 detection in TDVF X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e5715711a41b3a323b1605e41e5875d377e7c9c2;p=people%2Faperard%2Fovmf.git 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 Cc: Jiewen Yao Cc: Min Xu Cc: Gerd Hoffmann Cc: Elena Reshetova Signed-off-by: Ceping Sun --- 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 #include #include @@ -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;