Skip to content

Commit

Permalink
OvmfPkg/QemuFwCfgS3Lib: Disable S3 detection in TDVF
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Min Xu <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: Elena Reshetova <[email protected]>
Signed-off-by: Ceping Sun <[email protected]>
  • Loading branch information
sunceping authored and mergify[bot] committed Sep 9, 2024
1 parent 043615a commit e571571
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OvmfPkg/Library/QemuFwCfgS3Lib/QemuFwCfgS3PeiDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <Library/BaseLib.h>
#include <Library/QemuFwCfgLib.h>
#include <Library/QemuFwCfgS3Lib.h>

Expand All @@ -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;
Expand Down

0 comments on commit e571571

Please sign in to comment.