From 91e914f5876f35317638771103f64baf903a9bfc Mon Sep 17 00:00:00 2001 From: Chao Zhang Date: Tue, 12 Jan 2016 00:37:02 +0000 Subject: SecurityPkg: TcgDxe,Tcg2Dxe,TrEEDxe: New PCD for TCG event log and TCG2 final event log area TCG event log and TCG2 final event log area length can be configurable to meet platform event log requirement. PcdTcgLogAreaMinLen : 0x10000 based on minimum requirement in TCG ACPI Spec 00.37 PcdTcg2FinalLogAreaLen : 0x8000 based on experience value Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang Reviewed-by: Yao Jiewen Reviewed-by: Qin Long git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19639 6f19259b-4bc3-4df7-8a09-765794883524 --- SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c') diff --git a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c index 8f344fe93e..dfdee04688 100644 --- a/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c +++ b/SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c @@ -55,8 +55,6 @@ typedef struct { EFI_GUID *VendorGuid; } VARIABLE_TYPE; -#define EFI_TCG_LOG_AREA_SIZE 0x10000 - #define TREE_DEFAULT_MAX_COMMAND_SIZE 0x1000 #define TREE_DEFAULT_MAX_RESPONSE_SIZE 0x1000 @@ -949,19 +947,19 @@ SetupEventLog ( Status = gBS->AllocatePages ( AllocateMaxAddress, EfiACPIMemoryNVS, - EFI_SIZE_TO_PAGES (EFI_TCG_LOG_AREA_SIZE), + EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)), &Lasa ); if (EFI_ERROR (Status)) { return Status; } mTcgDxeData.EventLogAreaStruct[Index].Lasa = Lasa; - mTcgDxeData.EventLogAreaStruct[Index].Laml = EFI_TCG_LOG_AREA_SIZE; + mTcgDxeData.EventLogAreaStruct[Index].Laml = PcdGet32 (PcdTcgLogAreaMinLen); // // To initialize them as 0xFF is recommended // because the OS can know the last entry for that. // - SetMem ((VOID *)(UINTN)Lasa, EFI_TCG_LOG_AREA_SIZE, 0xFF); + SetMem ((VOID *)(UINTN)Lasa, PcdGet32 (PcdTcgLogAreaMinLen), 0xFF); } // @@ -969,10 +967,10 @@ SetupEventLog ( // if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_CLIENT) { mTcgClientAcpiTemplate.Lasa = mTcgDxeData.EventLogAreaStruct[0].Lasa; - mTcgClientAcpiTemplate.Laml = EFI_TCG_LOG_AREA_SIZE; + mTcgClientAcpiTemplate.Laml = PcdGet32 (PcdTcgLogAreaMinLen); } else { mTcgServerAcpiTemplate.Lasa = mTcgDxeData.EventLogAreaStruct[0].Lasa; - mTcgServerAcpiTemplate.Laml = EFI_TCG_LOG_AREA_SIZE; + mTcgServerAcpiTemplate.Laml = PcdGet32 (PcdTcgLogAreaMinLen); } // -- cgit v1.2.3