From 2eac71a1ee084fcb10bbf322928cab925e483ec8 Mon Sep 17 00:00:00 2001 From: Ceping Sun Date: Mon, 20 Jan 2025 02:14:34 -0500 Subject: [PATCH] OvmfPkg/IntelTdx: Cache and measure FwCfg Since OVMF would initialize the platform info with FwCfg, TDVF needs to cache and measure the FwCfg at first. Cc: Erdem Aktas Cc: Jiewen Yao Cc: Min Xu Cc: Gerd Hoffmann Cc: Elena Reshetova Signed-off-by: Min Xu Signed-off-by: Ceping Sun --- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 + OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc index d97697eeb3..8d0afba23e 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -240,6 +240,7 @@ PeilessStartupLib|OvmfPkg/Library/PeilessStartupLib/PeilessStartupLib.inf CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf TdxMeasurementLib|OvmfPkg/IntelTdx/TdxMeasurementLib/SecPeiTdxMeasurementLib.inf + TpmMeasurementLib|SecurityPkg/Library/SecTpmMeasurementLib/SecTpmMeasurementLib.inf [LibraryClasses.common.DXE_CORE] HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf diff --git a/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c b/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c index 2b9566d0ee..170860f4f5 100644 --- a/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c +++ b/OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c @@ -7,6 +7,8 @@ **/ #include +#include +#include #include #include #include @@ -48,6 +50,10 @@ InitializePlatform ( DEBUG ((DEBUG_INFO, "InitializePlatform in Pei-less boot\n")); PlatformDebugDumpCmos (); + if (RETURN_ERROR (QemuFwCfgInitCache (PlatformInfoHob))) { + DEBUG ((DEBUG_ERROR, "QemuFwCfgInitCache failed !\n")); + } + PlatformInfoHob->DefaultMaxCpuNumber = 64; PlatformInfoHob->PcdPciMmio64Size = 0x800000000;