Skip to content

Commit

Permalink
OvmfPkg/PeilessStartupLib: Cache and measure FwCfg item
Browse files Browse the repository at this point in the history
Since OVMF would initialize the platform info with fwcfg,
TDVF needs to cache and measure the fwcfg at first.

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: Min Xu <[email protected]>
Signed-off-by: Ceping Sun <[email protected]>
  • Loading branch information
sunceping committed Dec 20, 2024
1 parent 383d699 commit a0c618c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OvmfPkg/IntelTdx/IntelTdxX64.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@
PeilessStartupLib|OvmfPkg/Library/PeilessStartupLib/PeilessStartupLib.inf
CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
TdxMeasurementLib|OvmfPkg/IntelTdx/TdxMeasurementLib/SecPeiTdxMeasurementLib.inf
TdxHelperLib|OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib.inf
TpmMeasurementLib|OvmfPkg/Library/SecTpmMeasurementLib/SecTpmMeasurementLib.inf

[LibraryClasses.common.DXE_CORE]
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf
Expand Down Expand Up @@ -545,7 +547,6 @@
OvmfPkg/IntelTdx/Sec/SecMain.inf {
<LibraryClasses>
NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
NULL|OvmfPkg/IntelTdx/TdxHelperLib/SecTdxHelperLib.inf
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/SecCryptLib.inf
}

Expand Down
1 change: 1 addition & 0 deletions OvmfPkg/IntelTdx/Sec/SecMain.inf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
PeilessStartupLib
PlatformInitLib
CcProbeLib
TdxHelperLib

[Pcd]
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPageTablesBase
Expand Down
6 changes: 6 additions & 0 deletions OvmfPkg/Library/PeilessStartupLib/PeilessStartup.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <ConfidentialComputingGuestAttr.h>
#include <Guid/MemoryTypeInformation.h>
#include <OvmfPlatforms.h>
#include <Base.h>
#include <Library/QemuFwCfgLib.h>
#include "PeilessStartupInternal.h"

#define GET_GPAW_INIT_STATE(INFO) ((UINT8) ((INFO) & 0x3f))
Expand All @@ -47,6 +49,10 @@ InitializePlatform (
DEBUG ((DEBUG_INFO, "InitializePlatform in Pei-less boot\n"));
PlatformDebugDumpCmos ();

if (RETURN_ERROR (QemuFwCfgInitCache ())) {
DEBUG ((DEBUG_ERROR, "QemuFwCfgInitCache failed !\n"));
}

PlatformInfoHob->DefaultMaxCpuNumber = 64;
PlatformInfoHob->PcdPciMmio64Size = 0x800000000;

Expand Down

0 comments on commit a0c618c

Please sign in to comment.