for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) {\r
if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) {\r
mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat;\r
- Status = gBS->AllocatePages (\r
- AllocateAnyPages,\r
- EfiBootServicesData,\r
- EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),\r
- &Lasa\r
- );\r
+ if (PcdGet8(PcdTpm2AcpiTableRev) >= 4) {\r
+ Status = gBS->AllocatePages (\r
+ AllocateAnyPages,\r
+ EfiACPIMemoryNVS,\r
+ EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),\r
+ &Lasa\r
+ );\r
+ } else {\r
+ Status = gBS->AllocatePages (\r
+ AllocateAnyPages,\r
+ EfiBootServicesData,\r
+ EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),\r
+ &Lasa\r
+ );\r
+ }\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
mTcgDxeData.EventLogAreaStruct[Index].Lasa = Lasa;\r
mTcgDxeData.EventLogAreaStruct[Index].Laml = PcdGet32 (PcdTcgLogAreaMinLen);\r
+\r
+ if ((PcdGet8(PcdTpm2AcpiTableRev) >= 4) ||\r
+ (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)) {\r
+ //\r
+ // Report TCG2 event log address and length, so that they can be reported in TPM2 ACPI table.\r
+ // Ignore the return status, because those fields are optional.\r
+ //\r
+ PcdSet32S(PcdTpm2AcpiTableLaml, (UINT32)mTcgDxeData.EventLogAreaStruct[Index].Laml);\r
+ PcdSet64S(PcdTpm2AcpiTableLasa, mTcgDxeData.EventLogAreaStruct[Index].Lasa);\r
+ }\r
+\r
//\r
// To initialize them as 0xFF is recommended\r
// because the OS can know the last entry for that.\r