a TPM DXE Driver. A GUIDed HOB is generated for each measurement \r
made in the PEI Phase.\r
\r
-Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
\r
extern EFI_GUID gTpmErrorHobGuid;\r
\r
+///\r
+/// The Global ID of a GUIDed HOB used to record TPM2 Startup Locality.\r
+/// HOB payload is UINT8 according to Startup Locality Event.\r
+///\r
+#define EFI_TPM2_STARTUP_LOCALITY_HOB_GUID \\r
+ { \\r
+ 0xef598499, 0xb25e, 0x473a, { 0xbf, 0xaf, 0xe7, 0xe5, 0x7d, 0xce, 0x82, 0xc4 } \\r
+ }\r
+\r
+extern EFI_GUID gTpm2StartupLocalityHobGuid;\r
+\r
#endif\r
# Include/Guid/TcgEventHob.h\r
gTpmErrorHobGuid = { 0xef598499, 0xb25e, 0x473a, { 0xbf, 0xaf, 0xe7, 0xe5, 0x7d, 0xce, 0x82, 0xc4 }}\r
\r
+ ## HOB GUID used to record TPM2 startup locality\r
+ ## Include/Guid/TcgEventHob.h\r
+ gTpm2StartupLocalityHobGuid = { 0x397b0c9, 0x22e8, 0x459e, { 0xa4, 0xff, 0x99, 0xbc, 0x65, 0x27, 0x9, 0x29 }}\r
+\r
## HOB GUID used to pass all PEI measured FV info to DXE Driver.\r
# Include/Guid/MeasuredFvHob.h\r
gMeasuredFvHobGuid = { 0xb2360b42, 0x7173, 0x420a, { 0x86, 0x96, 0x46, 0xca, 0x6b, 0xab, 0x10, 0x60 }}\r
UINT32 HashAlgorithmMaskCopied;\r
TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct;\r
UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + sizeof(UINT32) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];\r
- TCG_PCR_EVENT_HDR FirstPcrEvent;\r
+ TCG_PCR_EVENT_HDR NoActionEvent;\r
TCG_EfiSpecIdEventAlgorithmSize *DigestSize;\r
TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;\r
UINT8 *VendorInfoSize;\r
UINT32 NumberOfAlgorithms;\r
+ TCG_EfiStartupLocalityEvent StartupLocalityEvent;\r
\r
DEBUG ((EFI_D_INFO, "SetupEventLog\n"));\r
\r
VendorInfoSize = (UINT8 *)TempDigestSize;\r
*VendorInfoSize = 0;\r
\r
- //\r
- // FirstPcrEvent\r
- //\r
- FirstPcrEvent.PCRIndex = 0;\r
- FirstPcrEvent.EventType = EV_NO_ACTION;\r
- ZeroMem (&FirstPcrEvent.Digest, sizeof(FirstPcrEvent.Digest));\r
- FirstPcrEvent.EventSize = (UINT32)GetTcgEfiSpecIdEventStructSize (TcgEfiSpecIdEventStruct);\r
+ NoActionEvent.PCRIndex = 0;\r
+ NoActionEvent.EventType = EV_NO_ACTION;\r
+ ZeroMem (&NoActionEvent.Digest, sizeof(NoActionEvent.Digest));\r
+ NoActionEvent.EventSize = (UINT32)GetTcgEfiSpecIdEventStructSize (TcgEfiSpecIdEventStruct);\r
\r
//\r
- // Record\r
+ // Log TcgEfiSpecIdEventStruct as the first Event\r
+ // TCG PC Client PFP spec. Section 9.2 Measurement Event Entries and Log\r
//\r
Status = TcgDxeLogEvent (\r
mTcg2EventInfo[Index].LogFormat,\r
- &FirstPcrEvent,\r
- sizeof(FirstPcrEvent),\r
+ &NoActionEvent,\r
+ sizeof(NoActionEvent),\r
(UINT8 *)TcgEfiSpecIdEventStruct,\r
- FirstPcrEvent.EventSize\r
+ NoActionEvent.EventSize\r
);\r
+\r
+ //\r
+ // EfiStartupLocalityEvent\r
+ //\r
+ GuidHob.Guid = GetFirstGuidHob (&gTpm2StartupLocalityHobGuid);\r
+ if (GuidHob.Guid != NULL) {\r
+ //\r
+ // Get Locality Indicator from StartupLocality HOB\r
+ //\r
+ StartupLocalityEvent.StartupLocality = *(UINT8 *)(GET_GUID_HOB_DATA (GuidHob.Guid));\r
+ CopyMem (StartupLocalityEvent.Signature, TCG_EfiStartupLocalityEvent_SIGNATURE, sizeof(StartupLocalityEvent.Signature));\r
+\r
+ NoActionEvent.PCRIndex = 0;\r
+ NoActionEvent.EventType = EV_NO_ACTION;\r
+ ZeroMem (&NoActionEvent.Digest, sizeof(NoActionEvent.Digest));\r
+ NoActionEvent.EventSize = sizeof(StartupLocalityEvent);\r
+\r
+ DEBUG ((DEBUG_INFO, "SetupEventLog: Set Locality from HOB into StartupLocalityEvent 0x%02x\n", StartupLocalityEvent.StartupLocality));\r
+\r
+ //\r
+ // Log EfiStartupLocalityEvent as the second Event\r
+ // TCG PC Client PFP spec. Section 9.3.4.3 Startup Locality Event\r
+ //\r
+ Status = TcgDxeLogEvent (\r
+ mTcg2EventInfo[Index].LogFormat,\r
+ &NoActionEvent,\r
+ sizeof(NoActionEvent),\r
+ (UINT8 *)&StartupLocalityEvent,\r
+ NoActionEvent.EventSize\r
+ );\r
+ }\r
}\r
}\r
}\r
# This external input must be validated carefully to avoid security issue like\r
# buffer overflow, integer overflow.\r
#\r
-# Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
# which accompanies this distribution. The full text of the license may be found at\r
gEfiTpmDeviceInstanceTpm12Guid ## SOMETIMES_CONSUMES ## GUID # TPM device identifier\r
\r
gTcgEvent2EntryHobGuid ## SOMETIMES_CONSUMES ## HOB\r
+ gTpm2StartupLocalityHobGuid ## SOMETIMES_CONSUMES ## HOB\r
\r
[Protocols]\r
gEfiTcg2ProtocolGuid ## PRODUCES\r