From 289b23ec12e2909df9660c8e14cf7e62e955554e Mon Sep 17 00:00:00 2001 From: Levi Yun Date: Thu, 5 Jun 2025 11:26:07 +0100 Subject: [PATCH] ArmPlatformPkg/PeilessSec: apply PeilessSecMeasureLib in PeilessSec To add event logs like Tcg2Pei, apply PeilessSecMeasureLib in PeilessSec. Signed-off-by: Yeoreum Yun --- ArmPlatformPkg/ArmPlatformPkg.ci.yaml | 1 + ArmPlatformPkg/ArmPlatformPkg.dsc | 7 +++++++ ArmPlatformPkg/PeilessSec/PeilessSec.c | 3 +++ ArmPlatformPkg/PeilessSec/PeilessSec.h | 1 + ArmPlatformPkg/PeilessSec/PeilessSec.inf | 2 ++ 5 files changed, 14 insertions(+) diff --git a/ArmPlatformPkg/ArmPlatformPkg.ci.yaml b/ArmPlatformPkg/ArmPlatformPkg.ci.yaml index e161d2c0fe..f2f9e6b822 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.ci.yaml +++ b/ArmPlatformPkg/ArmPlatformPkg.ci.yaml @@ -50,6 +50,7 @@ "EmbeddedPkg/EmbeddedPkg.dec", "MdeModulePkg/MdeModulePkg.dec", "MdePkg/MdePkg.dec", + "SecurityPkg/SecurityPkg.dec", "UefiCpuPkg/UefiCpuPkg.dec" ], # For host based unit tests diff --git a/ArmPlatformPkg/ArmPlatformPkg.dsc b/ArmPlatformPkg/ArmPlatformPkg.dsc index 9576a424ea..d792487c19 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dsc +++ b/ArmPlatformPkg/ArmPlatformPkg.dsc @@ -39,6 +39,8 @@ ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLibNull.inf ArmMmuLib|UefiCpuPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf + ArmSmcLib|MdePkg/Library/ArmSmcLib/ArmSmcLib.inf + ArmSvcLib|MdePkg/Library/ArmSvcLib/ArmSvcLib.inf BaseLib|MdePkg/Library/BaseLib/BaseLib.inf BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf @@ -80,10 +82,15 @@ PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf [LibraryClasses.common.SEC] + ArmFfaLib|MdeModulePkg/Library/ArmFfaLib/ArmFfaSecLib.inf ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf MemoryAllocationLib|EmbeddedPkg/Library/PrePiMemoryAllocationLib/PrePiMemoryAllocationLib.inf PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf + Tpm2CommandLib|SecurityPkg/Library/Tpm2CommandLib/Tpm2CommandLib.inf + Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibFfa/Tpm2DeviceSecLibFfa.inf + HashLib|SecurityPkg/Library/HashLibTpm2/HashLibTpm2PeilessSecLib.inf + PeilessSecMeasureLib|SecurityPkg/Library/PeilessSecMeasureLib/PeilessSecMeasureLib.inf [LibraryClasses.AARCH64.MM_STANDALONE] HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf diff --git a/ArmPlatformPkg/PeilessSec/PeilessSec.c b/ArmPlatformPkg/PeilessSec/PeilessSec.c index b9b7196a51..267c34397a 100644 --- a/ArmPlatformPkg/PeilessSec/PeilessSec.c +++ b/ArmPlatformPkg/PeilessSec/PeilessSec.c @@ -180,6 +180,9 @@ SecMain ( Status = DecompressFirstFv (); ASSERT_EFI_ERROR (Status); + Status = MeasurePeilessSec (); + ASSERT_EFI_ERROR (Status); + // Load the DXE Core and transfer control to it Status = LoadDxeCoreFromFv (NULL, 0); ASSERT_EFI_ERROR (Status); diff --git a/ArmPlatformPkg/PeilessSec/PeilessSec.h b/ArmPlatformPkg/PeilessSec/PeilessSec.h index 73b6b25b5a..abe885e689 100644 --- a/ArmPlatformPkg/PeilessSec/PeilessSec.h +++ b/ArmPlatformPkg/PeilessSec/PeilessSec.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/ArmPlatformPkg/PeilessSec/PeilessSec.inf b/ArmPlatformPkg/PeilessSec/PeilessSec.inf index f5e0726adb..a70afcf91d 100644 --- a/ArmPlatformPkg/PeilessSec/PeilessSec.inf +++ b/ArmPlatformPkg/PeilessSec/PeilessSec.inf @@ -30,6 +30,7 @@ EmbeddedPkg/EmbeddedPkg.dec MdeModulePkg/MdeModulePkg.dec MdePkg/MdePkg.dec + SecurityPkg/SecurityPkg.dec [LibraryClasses] ArmLib @@ -40,6 +41,7 @@ DebugLib HobLib MemoryInitPeiLib + PeilessSecMeasureLib PerformanceLib PlatformPeiLib PrePiHobListPointerLib