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>
This commit is contained in:
Ceping Sun 2024-05-07 06:33:57 +08:00 committed by mergify[bot]
parent 043615ae8b
commit e5715711a4
1 changed files with 5 additions and 0 deletions

View File

@ -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;