diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c index a811e72ee3..e60478fdb4 100644 --- a/OvmfPkg/XenPlatformPei/Platform.c +++ b/OvmfPkg/XenPlatformPei/Platform.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -423,6 +424,8 @@ InitializeXenPlatform ( IN CONST EFI_PEI_SERVICES **PeiServices ) { + EFI_STATUS Status; + DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); DebugDumpCmos (); @@ -433,6 +436,16 @@ InitializeXenPlatform ( CpuDeadLoop (); } + // + // This S3 conditional test is mainly for HVM Direct Kernel Boot since + // QEMU fwcfg isn't really supported other than that. + // + if (QemuFwCfgS3Enabled ()) { + DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n")); + Status = PcdSetBoolS (PcdAcpiS3Enable, TRUE); + ASSERT_EFI_ERROR (Status); + } + XenConnect (); BootModeInitialization (); diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf index 597cb6fcd7..20c27ff34b 100644 --- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf +++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf @@ -57,6 +57,7 @@ ResourcePublicationLib PeiServicesLib PeimEntryPoint + QemuFwCfgS3Lib MtrrLib MemEncryptSevLib PcdLib @@ -79,6 +80,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode