From 5bb4f9694a6d765a8f3a3474c6835b0f167428d5 Mon Sep 17 00:00:00 2001 From: Ceping Sun Date: Wed, 6 Mar 2024 07:06:26 +0800 Subject: OvmfPkg/PlatformPei: Build gCcEventEntryHobGuid at First Since the PEI Hob service is ready after PEIM loaded, TDVF should build the Hob for TdHob and Cfv event at first. Cc: Erdem Aktas Cc: Jiewen Yao Cc: Min Xu Cc: Gerd Hoffmann Cc: Elena Reshetova Signed-off-by: Ceping Sun --- OvmfPkg/OvmfPkgIa32.dsc | 5 ++++- OvmfPkg/OvmfPkgIa32X64.dsc | 5 ++++- OvmfPkg/PlatformPei/IntelTdx.c | 2 -- OvmfPkg/PlatformPei/Platform.c | 5 +++++ 4 files changed, 13 insertions(+), 4 deletions(-) (limited to 'OvmfPkg') diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index bd6e8abbcb..974ab62362 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -704,7 +704,10 @@ } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - OvmfPkg/PlatformPei/PlatformPei.inf + OvmfPkg/PlatformPei/PlatformPei.inf { + + NULL|OvmfPkg/IntelTdx/TdxHelperLib/TdxHelperLibNull.inf + } UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { !if $(SMM_REQUIRE) == TRUE diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index f28049a36a..c0e3210a83 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -717,7 +717,10 @@ } MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - OvmfPkg/PlatformPei/PlatformPei.inf + OvmfPkg/PlatformPei/PlatformPei.inf { + + NULL|OvmfPkg/IntelTdx/TdxHelperLib/TdxHelperLibNull.inf + } UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf { !if $(SMM_REQUIRE) == TRUE diff --git a/OvmfPkg/PlatformPei/IntelTdx.c b/OvmfPkg/PlatformPei/IntelTdx.c index 1cb6729e56..8aa796b3e9 100644 --- a/OvmfPkg/PlatformPei/IntelTdx.c +++ b/OvmfPkg/PlatformPei/IntelTdx.c @@ -40,8 +40,6 @@ IntelTdxInitialize ( return; } - TdxHelperBuildGuidHobForTdxMeasurement (); - PcdStatus = PcdSet64S (PcdConfidentialComputingGuestAttr, CCAttrIntelTdx); ASSERT_RETURN_ERROR (PcdStatus); diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 0114529778..dc81ce9e2b 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "Platform.h" #include "PlatformId.h" @@ -311,6 +312,10 @@ InitializePlatform ( DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); PlatformInfoHob = BuildPlatformInfoHob (); + if (TdIsEnabled ()) { + TdxHelperBuildGuidHobForTdxMeasurement (); + } + PlatformInfoHob->SmmSmramRequire = FeaturePcdGet (PcdSmmSmramRequire); PlatformInfoHob->SevEsIsEnabled = MemEncryptSevEsIsEnabled (); PlatformInfoHob->PcdPciMmio64Size = PcdGet64 (PcdPciMmio64Size); -- cgit v1.2.3