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 <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: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
This commit is contained in:
Ceping Sun
2025-01-20 02:14:34 -05:00
committed by mergify[bot]
parent 81c2c92074
commit 2eac71a1ee
2 changed files with 7 additions and 0 deletions

View File

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

View File

@@ -7,6 +7,8 @@
**/
#include <PiPei.h>
#include <Base.h>
#include <Library/QemuFwCfgLib.h>
#include <Library/HobLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
@@ -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;