TianoCore EDK2 master
Loading...
Searching...
No Matches
TcgDxe.c
Go to the documentation of this file.
1
17#include <PiDxe.h>
22
23#include <Guid/GlobalVariable.h>
24#include <Guid/HobList.h>
25#include <Guid/TcgEventHob.h>
26#include <Guid/EventGroup.h>
28#include <Guid/TpmInstance.h>
29
30#include <Protocol/DevicePath.h>
31#include <Protocol/TcgService.h>
32#include <Protocol/AcpiTable.h>
33#include <Protocol/MpService.h>
34
35#include <Library/DebugLib.h>
39#include <Library/HobLib.h>
41#include <Library/BaseLib.h>
43#include <Library/PrintLib.h>
45#include <Library/PcdLib.h>
46#include <Library/UefiLib.h>
50
51#define TCG_DXE_DATA_FROM_THIS(this) \
52 BASE_CR (this, TCG_DXE_DATA, TcgProtocol)
53
54typedef struct _TCG_DXE_DATA {
55 EFI_TCG_PROTOCOL TcgProtocol;
57 EFI_TCG_CLIENT_ACPI_TABLE *TcgClientAcpiTable;
58 EFI_TCG_SERVER_ACPI_TABLE *TcgServerAcpiTable;
59 UINTN EventLogSize;
60 UINT8 *LastEvent;
62
63EFI_TCG_CLIENT_ACPI_TABLE mTcgClientAcpiTemplate = {
64 {
66 sizeof (mTcgClientAcpiTemplate),
67 0x02 // Revision
68 //
69 // Compiler initializes the remaining bytes to 0
70 // These fields should be filled in in production
71 //
72 },
73 0, // 0 for PC Client Platform Class
74 0, // Log Area Max Length
75 (EFI_PHYSICAL_ADDRESS)(SIZE_4GB - 1) // Log Area Start Address
76};
77
78//
79// The following EFI_TCG_SERVER_ACPI_TABLE default setting is just one example,
80// the TPM device connects to LPC, and also defined the ACPI _UID as 0xFF,
81// this _UID can be changed and should match with the _UID setting of the TPM
82// ACPI device object
83//
84EFI_TCG_SERVER_ACPI_TABLE mTcgServerAcpiTemplate = {
85 {
87 sizeof (mTcgServerAcpiTemplate),
88 0x02 // Revision
89 //
90 // Compiler initializes the remaining bytes to 0
91 // These fields should be filled in in production
92 //
93 },
94 1, // 1 for Server Platform Class
95 0, // Reserved
96 0, // Log Area Max Length
97 (EFI_PHYSICAL_ADDRESS)(SIZE_4GB - 1), // Log Area Start Address
98 0x0120, // TCG Specification revision 1.2
99 0, // Device Flags
100 0, // Interrupt Flags
101 0, // GPE
102 { 0 }, // Reserved 3 bytes
103 0, // Global System Interrupt
104 {
105 EFI_ACPI_3_0_SYSTEM_MEMORY,
106 0,
107 0,
108 EFI_ACPI_3_0_BYTE,
109 0 // Base Address
110 },
111 0, // Reserved
112 { 0 }, // Configuration Address
113 0xFF, // ACPI _UID value of the device, can be changed for different platforms
114 0, // ACPI _UID value of the device, can be changed for different platforms
115 0, // ACPI _UID value of the device, can be changed for different platforms
116 0 // ACPI _UID value of the device, can be changed for different platforms
117};
118
119UINTN mBootAttempts = 0;
120CHAR16 mBootVarName[] = L"BootOrder";
121
135 OUT EFI_CPU_PHYSICAL_LOCATION **LocationBuf,
136 OUT UINTN *Num
137 )
138{
139 EFI_STATUS Status;
140 EFI_MP_SERVICES_PROTOCOL *MpProtocol;
141 UINTN ProcessorNum;
142 UINTN EnabledProcessorNum;
143 EFI_PROCESSOR_INFORMATION ProcessorInfo;
144 EFI_CPU_PHYSICAL_LOCATION *ProcessorLocBuf;
145 UINTN Index;
146
147 Status = gBS->LocateProtocol (&gEfiMpServiceProtocolGuid, NULL, (VOID **)&MpProtocol);
148 if (EFI_ERROR (Status)) {
149 //
150 // MP protocol is not installed
151 //
152 return EFI_UNSUPPORTED;
153 }
154
155 Status = MpProtocol->GetNumberOfProcessors (
156 MpProtocol,
157 &ProcessorNum,
158 &EnabledProcessorNum
159 );
160 if (EFI_ERROR (Status)) {
161 return Status;
162 }
163
164 Status = gBS->AllocatePool (
166 sizeof (EFI_CPU_PHYSICAL_LOCATION) * ProcessorNum,
167 (VOID **)&ProcessorLocBuf
168 );
169 if (EFI_ERROR (Status)) {
170 return Status;
171 }
172
173 //
174 // Get each processor Location info
175 //
176 for (Index = 0; Index < ProcessorNum; Index++) {
177 Status = MpProtocol->GetProcessorInfo (
178 MpProtocol,
179 Index,
180 &ProcessorInfo
181 );
182 if (EFI_ERROR (Status)) {
183 FreePool (ProcessorLocBuf);
184 return Status;
185 }
186
187 //
188 // Get all Processor Location info & measure
189 //
190 CopyMem (
191 &ProcessorLocBuf[Index],
192 &ProcessorInfo.Location,
194 );
195 }
196
197 *LocationBuf = ProcessorLocBuf;
198 *Num = ProcessorNum;
199
200 return Status;
201}
202
226EFIAPI
228 IN EFI_TCG_PROTOCOL *This,
229 OUT TCG_EFI_BOOT_SERVICE_CAPABILITY *ProtocolCapability,
230 OUT UINT32 *TCGFeatureFlags,
231 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
232 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
233 )
234{
235 TCG_DXE_DATA *TcgData;
236
237 TcgData = TCG_DXE_DATA_FROM_THIS (This);
238
239 if (ProtocolCapability != NULL) {
240 *ProtocolCapability = TcgData->BsCap;
241 }
242
243 if (TCGFeatureFlags != NULL) {
244 *TCGFeatureFlags = 0;
245 }
246
247 if (EventLogLocation != NULL) {
248 if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_CLIENT) {
249 *EventLogLocation = TcgData->TcgClientAcpiTable->Lasa;
250 } else {
251 *EventLogLocation = TcgData->TcgServerAcpiTable->Lasa;
252 }
253 }
254
255 if (EventLogLastEntry != NULL) {
256 if (TcgData->BsCap.TPMDeactivatedFlag || (!TcgData->BsCap.TPMPresentFlag)) {
257 *EventLogLastEntry = (EFI_PHYSICAL_ADDRESS)(UINTN)0;
258 } else {
259 *EventLogLastEntry = (EFI_PHYSICAL_ADDRESS)(UINTN)TcgData->LastEvent;
260 }
261 }
262
263 return EFI_SUCCESS;
264}
265
277EFIAPI
279 IN CONST UINT8 *Data,
280 IN UINTN DataLen,
281 OUT TPM_DIGEST *Digest
282 )
283{
284 VOID *Sha1Ctx;
285 UINTN CtxSize;
286
287 CtxSize = Sha1GetContextSize ();
288 Sha1Ctx = AllocatePool (CtxSize);
289 ASSERT (Sha1Ctx != NULL);
290
291 Sha1Init (Sha1Ctx);
292 Sha1Update (Sha1Ctx, Data, DataLen);
293 Sha1Final (Sha1Ctx, (UINT8 *)Digest);
294
295 FreePool (Sha1Ctx);
296
297 return EFI_SUCCESS;
298}
299
319EFIAPI
321 IN EFI_TCG_PROTOCOL *This,
322 IN UINT8 *HashData,
323 IN UINT64 HashDataLen,
324 IN TCG_ALGORITHM_ID AlgorithmId,
325 IN OUT UINT64 *HashedDataLen,
326 IN OUT UINT8 **HashedDataResult
327 )
328{
329 if ((HashedDataLen == NULL) || (HashedDataResult == NULL)) {
330 return EFI_INVALID_PARAMETER;
331 }
332
333 switch (AlgorithmId) {
334 case TPM_ALG_SHA:
335 if (*HashedDataLen == 0) {
336 *HashedDataLen = sizeof (TPM_DIGEST);
337 *HashedDataResult = AllocatePool ((UINTN)*HashedDataLen);
338 if (*HashedDataResult == NULL) {
339 return EFI_OUT_OF_RESOURCES;
340 }
341 }
342
343 if (*HashedDataLen < sizeof (TPM_DIGEST)) {
344 *HashedDataLen = sizeof (TPM_DIGEST);
345 return EFI_BUFFER_TOO_SMALL;
346 }
347
348 *HashedDataLen = sizeof (TPM_DIGEST);
349
350 if (*HashedDataResult == NULL) {
351 *HashedDataResult = AllocatePool ((UINTN)*HashedDataLen);
352 }
353
354 return TpmCommHashAll (
355 HashData,
356 (UINTN)HashDataLen,
357 (TPM_DIGEST *)*HashedDataResult
358 );
359 default:
360 return EFI_UNSUPPORTED;
361 }
362}
363
379 IN OUT UINT8 **EventLogPtr,
380 IN OUT UINTN *LogSize,
381 IN UINTN MaxSize,
382 IN TCG_PCR_EVENT_HDR *NewEventHdr,
383 IN UINT8 *NewEventData
384 )
385{
386 UINTN NewLogSize;
387
388 //
389 // Prevent Event Overflow
390 //
391 if ((UINTN)NewEventHdr->EventSize > MAX_UINTN - sizeof (*NewEventHdr)) {
392 return EFI_OUT_OF_RESOURCES;
393 }
394
395 NewLogSize = sizeof (*NewEventHdr) + NewEventHdr->EventSize;
396 if (NewLogSize > MaxSize - *LogSize) {
397 return EFI_OUT_OF_RESOURCES;
398 }
399
400 *EventLogPtr += *LogSize;
401 *LogSize += NewLogSize;
402 CopyMem (*EventLogPtr, NewEventHdr, sizeof (*NewEventHdr));
403 CopyMem (
404 *EventLogPtr + sizeof (*NewEventHdr),
405 NewEventData,
406 NewEventHdr->EventSize
407 );
408 return EFI_SUCCESS;
409}
410
423EFIAPI
425 IN TCG_DXE_DATA *TcgData,
426 IN TCG_PCR_EVENT_HDR *NewEventHdr,
427 IN UINT8 *NewEventData
428 )
429{
430 if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_CLIENT) {
431 TcgData->LastEvent = (UINT8 *)(UINTN)TcgData->TcgClientAcpiTable->Lasa;
432 return TpmCommLogEvent (
433 &TcgData->LastEvent,
434 &TcgData->EventLogSize,
435 (UINTN)TcgData->TcgClientAcpiTable->Laml,
436 NewEventHdr,
437 NewEventData
438 );
439 } else {
440 TcgData->LastEvent = (UINT8 *)(UINTN)TcgData->TcgServerAcpiTable->Lasa;
441 return TpmCommLogEvent (
442 &TcgData->LastEvent,
443 &TcgData->EventLogSize,
444 (UINTN)TcgData->TcgServerAcpiTable->Laml,
445 NewEventHdr,
446 NewEventData
447 );
448 }
449}
450
469EFIAPI
471 IN EFI_TCG_PROTOCOL *This,
472 IN TCG_PCR_EVENT *TCGLogData,
473 IN OUT UINT32 *EventNumber,
474 IN UINT32 Flags
475 )
476{
477 TCG_DXE_DATA *TcgData;
478
479 if (TCGLogData == NULL) {
480 return EFI_INVALID_PARAMETER;
481 }
482
483 TcgData = TCG_DXE_DATA_FROM_THIS (This);
484
485 if (TcgData->BsCap.TPMDeactivatedFlag || (!TcgData->BsCap.TPMPresentFlag)) {
486 return EFI_DEVICE_ERROR;
487 }
488
489 return TcgDxeLogEventI (
490 TcgData,
491 (TCG_PCR_EVENT_HDR *)TCGLogData,
492 TCGLogData->Event
493 );
494}
495
512EFIAPI
514 IN EFI_TCG_PROTOCOL *This,
515 IN UINT32 TpmInputParameterBlockSize,
516 IN UINT8 *TpmInputParameterBlock,
517 IN UINT32 TpmOutputParameterBlockSize,
518 IN UINT8 *TpmOutputParameterBlock
519 )
520{
521 if ((TpmInputParameterBlock == NULL) ||
522 (TpmOutputParameterBlock == NULL) ||
523 (TpmInputParameterBlockSize == 0) ||
524 (TpmOutputParameterBlockSize == 0))
525 {
526 return EFI_INVALID_PARAMETER;
527 }
528
529 return Tpm12SubmitCommand (
530 TpmInputParameterBlockSize,
531 TpmInputParameterBlock,
532 &TpmOutputParameterBlockSize,
533 TpmOutputParameterBlock
534 );
535}
536
554EFIAPI
556 IN TCG_DXE_DATA *TcgData,
557 IN UINT8 *HashData,
558 IN UINT64 HashDataLen,
559 IN OUT TCG_PCR_EVENT_HDR *NewEventHdr,
560 IN UINT8 *NewEventData
561 )
562{
563 EFI_STATUS Status;
564
565 if (!TcgData->BsCap.TPMPresentFlag) {
566 return EFI_DEVICE_ERROR;
567 }
568
569 if ((HashDataLen > 0) || (HashData != NULL)) {
570 Status = TpmCommHashAll (
571 HashData,
572 (UINTN)HashDataLen,
573 &NewEventHdr->Digest
574 );
575 if (EFI_ERROR (Status)) {
576 DEBUG ((DEBUG_ERROR, "TpmCommHashAll Failed. %x\n", Status));
577 goto Done;
578 }
579 }
580
581 Status = Tpm12Extend (
582 &NewEventHdr->Digest,
583 NewEventHdr->PCRIndex,
584 NULL
585 );
586 if (!EFI_ERROR (Status)) {
587 Status = TcgDxeLogEventI (TcgData, NewEventHdr, NewEventData);
588 }
589
590Done:
591 if ((Status == EFI_DEVICE_ERROR) || (Status == EFI_TIMEOUT)) {
592 DEBUG ((DEBUG_ERROR, "TcgDxeHashLogExtendEventI - %r. Disable TPM.\n", Status));
593 TcgData->BsCap.TPMPresentFlag = FALSE;
595 EFI_ERROR_CODE | EFI_ERROR_MINOR,
596 (PcdGet32 (PcdStatusCodeSubClassTpmDevice) | EFI_P_EC_INTERFACE_ERROR)
597 );
598 Status = EFI_DEVICE_ERROR;
599 }
600
601 return Status;
602}
603
629EFIAPI
631 IN EFI_TCG_PROTOCOL *This,
632 IN EFI_PHYSICAL_ADDRESS HashData,
633 IN UINT64 HashDataLen,
634 IN TPM_ALGORITHM_ID AlgorithmId,
635 IN OUT TCG_PCR_EVENT *TCGLogData,
636 IN OUT UINT32 *EventNumber,
637 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
638 )
639{
640 TCG_DXE_DATA *TcgData;
641 EFI_STATUS Status;
642
643 if ((TCGLogData == NULL) || (EventLogLastEntry == NULL)) {
644 return EFI_INVALID_PARAMETER;
645 }
646
647 TcgData = TCG_DXE_DATA_FROM_THIS (This);
648
649 if (TcgData->BsCap.TPMDeactivatedFlag || (!TcgData->BsCap.TPMPresentFlag)) {
650 return EFI_DEVICE_ERROR;
651 }
652
653 if (AlgorithmId != TPM_ALG_SHA) {
654 return EFI_UNSUPPORTED;
655 }
656
657 if ((HashData == 0) && (HashDataLen > 0)) {
658 return EFI_INVALID_PARAMETER;
659 }
660
662 TcgData,
663 (UINT8 *)(UINTN)HashData,
664 HashDataLen,
665 (TCG_PCR_EVENT_HDR *)TCGLogData,
666 TCGLogData->Event
667 );
668
669 if (!EFI_ERROR (Status)) {
670 *EventLogLastEntry = (EFI_PHYSICAL_ADDRESS)(UINTN)TcgData->LastEvent;
671 }
672
673 return Status;
674}
675
676TCG_DXE_DATA mTcgDxeData = {
677 {
683 },
684 {
685 sizeof (mTcgDxeData.BsCap),
686 { 1, 2, 0, 0 },
687 { 1, 2, 0, 0 },
688 1,
689 TRUE,
690 FALSE
691 },
692 &mTcgClientAcpiTemplate,
693 &mTcgServerAcpiTemplate,
694 0,
695 NULL
696};
697
706EFIAPI
708 VOID
709 )
710{
711 EFI_STATUS Status;
712 TCG_PCR_EVENT *TcgEvent;
713 EFI_PEI_HOB_POINTERS GuidHob;
715
716 if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_CLIENT) {
717 Lasa = mTcgClientAcpiTemplate.Lasa;
718
719 Status = gBS->AllocatePages (
722 EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
723 &Lasa
724 );
725 if (EFI_ERROR (Status)) {
726 return Status;
727 }
728
729 mTcgClientAcpiTemplate.Lasa = Lasa;
730 //
731 // To initialize them as 0xFF is recommended
732 // because the OS can know the last entry for that.
733 //
734 SetMem ((VOID *)(UINTN)mTcgClientAcpiTemplate.Lasa, PcdGet32 (PcdTcgLogAreaMinLen), 0xFF);
735 mTcgClientAcpiTemplate.Laml = PcdGet32 (PcdTcgLogAreaMinLen);
736 } else {
737 Lasa = mTcgServerAcpiTemplate.Lasa;
738
739 Status = gBS->AllocatePages (
742 EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)),
743 &Lasa
744 );
745 if (EFI_ERROR (Status)) {
746 return Status;
747 }
748
749 mTcgServerAcpiTemplate.Lasa = Lasa;
750 //
751 // To initialize them as 0xFF is recommended
752 // because the OS can know the last entry for that.
753 //
754 SetMem ((VOID *)(UINTN)mTcgServerAcpiTemplate.Lasa, PcdGet32 (PcdTcgLogAreaMinLen), 0xFF);
755 mTcgServerAcpiTemplate.Laml = PcdGet32 (PcdTcgLogAreaMinLen);
756 }
757
758 GuidHob.Raw = GetHobList ();
759 while (!EFI_ERROR (Status) &&
760 (GuidHob.Raw = GetNextGuidHob (&gTcgEventEntryHobGuid, GuidHob.Raw)) != NULL)
761 {
762 TcgEvent = GET_GUID_HOB_DATA (GuidHob.Guid);
763 GuidHob.Raw = GET_NEXT_HOB (GuidHob);
764 Status = TcgDxeLogEventI (
765 &mTcgDxeData,
766 (TCG_PCR_EVENT_HDR *)TcgEvent,
767 TcgEvent->Event
768 );
769 }
770
771 return Status;
772}
773
784EFIAPI
786 IN CHAR8 *String
787 )
788{
789 TCG_PCR_EVENT_HDR TcgEvent;
790
791 TcgEvent.PCRIndex = 5;
792 TcgEvent.EventType = EV_EFI_ACTION;
793 TcgEvent.EventSize = (UINT32)AsciiStrLen (String);
795 &mTcgDxeData,
796 (UINT8 *)String,
797 TcgEvent.EventSize,
798 &TcgEvent,
799 (UINT8 *)String
800 );
801}
802
811EFIAPI
813 VOID
814 )
815{
816 EFI_STATUS Status;
817 TCG_PCR_EVENT_HDR TcgEvent;
818 EFI_HANDOFF_TABLE_POINTERS HandoffTables;
819 UINTN ProcessorNum;
820 EFI_CPU_PHYSICAL_LOCATION *ProcessorLocBuf;
821
822 ProcessorLocBuf = NULL;
823 Status = EFI_SUCCESS;
824
825 if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_SERVER) {
826 //
827 // Tcg Server spec.
828 // Measure each processor EFI_CPU_PHYSICAL_LOCATION with EV_TABLE_OF_DEVICES to PCR[1]
829 //
830 Status = GetProcessorsCpuLocation (&ProcessorLocBuf, &ProcessorNum);
831
832 if (!EFI_ERROR (Status)) {
833 TcgEvent.PCRIndex = 1;
834 TcgEvent.EventType = EV_TABLE_OF_DEVICES;
835 TcgEvent.EventSize = sizeof (HandoffTables);
836
837 HandoffTables.NumberOfTables = 1;
838 HandoffTables.TableEntry[0].VendorGuid = gEfiMpServiceProtocolGuid;
839 HandoffTables.TableEntry[0].VendorTable = ProcessorLocBuf;
840
842 &mTcgDxeData,
843 (UINT8 *)(UINTN)ProcessorLocBuf,
844 sizeof (EFI_CPU_PHYSICAL_LOCATION) * ProcessorNum,
845 &TcgEvent,
846 (UINT8 *)&HandoffTables
847 );
848
849 FreePool (ProcessorLocBuf);
850 }
851 }
852
853 return Status;
854}
855
866EFIAPI
868 IN TPM_PCRINDEX PCRIndex
869 )
870{
871 TCG_PCR_EVENT_HDR TcgEvent;
872 UINT32 EventData;
873
874 EventData = 0;
875 TcgEvent.PCRIndex = PCRIndex;
876 TcgEvent.EventType = EV_SEPARATOR;
877 TcgEvent.EventSize = (UINT32)sizeof (EventData);
879 &mTcgDxeData,
880 (UINT8 *)&EventData,
881 sizeof (EventData),
882 &TcgEvent,
883 (UINT8 *)&EventData
884 );
885}
886
900VOID *
901EFIAPI
903 IN CHAR16 *VarName,
904 IN EFI_GUID *VendorGuid,
905 OUT UINTN *VarSize
906 )
907{
908 EFI_STATUS Status;
909 VOID *VarData;
910
911 *VarSize = 0;
912 Status = gRT->GetVariable (
913 VarName,
914 VendorGuid,
915 NULL,
916 VarSize,
917 NULL
918 );
919 if (Status != EFI_BUFFER_TOO_SMALL) {
920 return NULL;
921 }
922
923 VarData = AllocatePool (*VarSize);
924 if (VarData != NULL) {
925 Status = gRT->GetVariable (
926 VarName,
927 VendorGuid,
928 NULL,
929 VarSize,
930 VarData
931 );
932 if (EFI_ERROR (Status)) {
933 FreePool (VarData);
934 VarData = NULL;
935 *VarSize = 0;
936 }
937 }
938
939 return VarData;
940}
941
958EFIAPI
960 IN TPM_PCRINDEX PCRIndex,
961 IN TCG_EVENTTYPE EventType,
962 IN CHAR16 *VarName,
963 IN EFI_GUID *VendorGuid,
964 IN VOID *VarData,
965 IN UINTN VarSize
966 )
967{
968 EFI_STATUS Status;
969 TCG_PCR_EVENT_HDR TcgEvent;
970 UINTN VarNameLength;
971 EFI_VARIABLE_DATA *VarLog;
972
973 VarNameLength = StrLen (VarName);
974 TcgEvent.PCRIndex = PCRIndex;
975 TcgEvent.EventType = EventType;
976 TcgEvent.EventSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize
977 - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData));
978
979 VarLog = (EFI_VARIABLE_DATA *)AllocatePool (TcgEvent.EventSize);
980 if (VarLog == NULL) {
981 return EFI_OUT_OF_RESOURCES;
982 }
983
984 VarLog->VariableName = *VendorGuid;
985 VarLog->UnicodeNameLength = VarNameLength;
986 VarLog->VariableDataLength = VarSize;
987 CopyMem (
988 VarLog->UnicodeName,
989 VarName,
990 VarNameLength * sizeof (*VarName)
991 );
992 CopyMem (
993 (CHAR16 *)VarLog->UnicodeName + VarNameLength,
994 VarData,
995 VarSize
996 );
997
999 &mTcgDxeData,
1000 (UINT8 *)VarLog,
1001 TcgEvent.EventSize,
1002 &TcgEvent,
1003 (UINT8 *)VarLog
1004 );
1005 FreePool (VarLog);
1006 return Status;
1007}
1008
1023EFIAPI
1025 IN CHAR16 *VarName,
1026 IN EFI_GUID *VendorGuid,
1027 OUT UINTN *VarSize,
1028 OUT VOID **VarData
1029 )
1030{
1031 EFI_STATUS Status;
1032
1033 *VarData = ReadVariable (VarName, VendorGuid, VarSize);
1034 if (*VarData == NULL) {
1035 return EFI_NOT_FOUND;
1036 }
1037
1038 Status = MeasureVariable (
1039 5,
1040 EV_EFI_VARIABLE_BOOT,
1041 VarName,
1042 VendorGuid,
1043 *VarData,
1044 *VarSize
1045 );
1046 return Status;
1047}
1048
1060EFIAPI
1062 VOID
1063 )
1064{
1065 EFI_STATUS Status;
1066 UINT16 *BootOrder;
1067 UINTN BootCount;
1068 UINTN Index;
1069 VOID *BootVarData;
1070 UINTN Size;
1071
1073 mBootVarName,
1074 &gEfiGlobalVariableGuid,
1075 &BootCount,
1076 (VOID **)&BootOrder
1077 );
1078 if ((Status == EFI_NOT_FOUND) || (BootOrder == NULL)) {
1079 return EFI_SUCCESS;
1080 }
1081
1082 if (EFI_ERROR (Status)) {
1083 //
1084 // BootOrder can't be NULL if status is not EFI_NOT_FOUND
1085 //
1086 FreePool (BootOrder);
1087 return Status;
1088 }
1089
1090 BootCount /= sizeof (*BootOrder);
1091 for (Index = 0; Index < BootCount; Index++) {
1092 UnicodeSPrint (mBootVarName, sizeof (mBootVarName), L"Boot%04x", BootOrder[Index]);
1094 mBootVarName,
1095 &gEfiGlobalVariableGuid,
1096 &Size,
1097 &BootVarData
1098 );
1099 if (!EFI_ERROR (Status)) {
1100 FreePool (BootVarData);
1101 }
1102 }
1103
1104 FreePool (BootOrder);
1105 return EFI_SUCCESS;
1106}
1107
1117VOID
1118EFIAPI
1120 IN EFI_EVENT Event,
1121 IN VOID *Context
1122 )
1123{
1124 EFI_STATUS Status;
1125 TPM_PCRINDEX PcrIndex;
1126
1127 if (mBootAttempts == 0) {
1128 //
1129 // Measure handoff tables.
1130 //
1131 Status = MeasureHandoffTables ();
1132 if (EFI_ERROR (Status)) {
1133 DEBUG ((DEBUG_ERROR, "HOBs not Measured. Error!\n"));
1134 }
1135
1136 //
1137 // Measure BootOrder & Boot#### variables.
1138 //
1139 Status = MeasureAllBootVariables ();
1140 if (EFI_ERROR (Status)) {
1141 DEBUG ((DEBUG_ERROR, "Boot Variables not Measured. Error!\n"));
1142 }
1143
1144 //
1145 // 1. This is the first boot attempt.
1146 //
1147 Status = TcgMeasureAction (
1148 EFI_CALLING_EFI_APPLICATION
1149 );
1150 if (EFI_ERROR (Status)) {
1151 DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION));
1152 }
1153
1154 //
1155 // 2. Draw a line between pre-boot env and entering post-boot env.
1156 //
1157 for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) {
1158 Status = MeasureSeparatorEvent (PcrIndex);
1159 if (EFI_ERROR (Status)) {
1160 DEBUG ((DEBUG_ERROR, "Separator Event not Measured. Error!\n"));
1161 }
1162 }
1163
1164 //
1165 // 3. Measure GPT. It would be done in SAP driver.
1166 //
1167
1168 //
1169 // 4. Measure PE/COFF OS loader. It would be done in SAP driver.
1170 //
1171
1172 //
1173 // 5. Read & Measure variable. BootOrder already measured.
1174 //
1175 } else {
1176 //
1177 // 6. Not first attempt, meaning a return from last attempt
1178 //
1179 Status = TcgMeasureAction (
1180 EFI_RETURNING_FROM_EFI_APPLICATION
1181 );
1182 if (EFI_ERROR (Status)) {
1183 DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION));
1184 }
1185 }
1186
1187 DEBUG ((DEBUG_INFO, "TPM TcgDxe Measure Data when ReadyToBoot\n"));
1188 //
1189 // Increase boot attempt counter.
1190 //
1191 mBootAttempts++;
1192}
1193
1204VOID
1205EFIAPI
1207 IN EFI_EVENT Event,
1208 IN VOID *Context
1209 )
1210{
1211 UINTN TableKey;
1212 EFI_STATUS Status;
1213 EFI_ACPI_TABLE_PROTOCOL *AcpiTable;
1214 UINT8 Checksum;
1215 UINT64 OemTableId;
1216
1217 Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTable);
1218 if (EFI_ERROR (Status)) {
1219 return;
1220 }
1221
1222 if (PcdGet8 (PcdTpmPlatformClass) == TCG_PLATFORM_TYPE_CLIENT) {
1223 CopyMem (mTcgClientAcpiTemplate.Header.OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (mTcgClientAcpiTemplate.Header.OemId));
1224 OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
1225 CopyMem (&mTcgClientAcpiTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64));
1226 mTcgClientAcpiTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
1227 mTcgClientAcpiTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
1228 mTcgClientAcpiTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
1229 //
1230 // The ACPI table must be checksummed before calling the InstallAcpiTable()
1231 // service of the ACPI table protocol to install it.
1232 //
1233 Checksum = CalculateCheckSum8 ((UINT8 *)&mTcgClientAcpiTemplate, sizeof (mTcgClientAcpiTemplate));
1234 mTcgClientAcpiTemplate.Header.Checksum = Checksum;
1235
1236 Status = AcpiTable->InstallAcpiTable (
1237 AcpiTable,
1238 &mTcgClientAcpiTemplate,
1239 sizeof (mTcgClientAcpiTemplate),
1240 &TableKey
1241 );
1242 } else {
1243 CopyMem (mTcgServerAcpiTemplate.Header.OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (mTcgServerAcpiTemplate.Header.OemId));
1244 OemTableId = PcdGet64 (PcdAcpiDefaultOemTableId);
1245 CopyMem (&mTcgServerAcpiTemplate.Header.OemTableId, &OemTableId, sizeof (UINT64));
1246 mTcgServerAcpiTemplate.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
1247 mTcgServerAcpiTemplate.Header.CreatorId = PcdGet32 (PcdAcpiDefaultCreatorId);
1248 mTcgServerAcpiTemplate.Header.CreatorRevision = PcdGet32 (PcdAcpiDefaultCreatorRevision);
1249 //
1250 // The ACPI table must be checksummed before calling the InstallAcpiTable()
1251 // service of the ACPI table protocol to install it.
1252 //
1253 Checksum = CalculateCheckSum8 ((UINT8 *)&mTcgServerAcpiTemplate, sizeof (mTcgServerAcpiTemplate));
1254 mTcgServerAcpiTemplate.Header.Checksum = Checksum;
1255
1256 mTcgServerAcpiTemplate.BaseAddress.Address = PcdGet64 (PcdTpmBaseAddress);
1257 Status = AcpiTable->InstallAcpiTable (
1258 AcpiTable,
1259 &mTcgServerAcpiTemplate,
1260 sizeof (mTcgServerAcpiTemplate),
1261 &TableKey
1262 );
1263 }
1264
1265 if (EFI_ERROR (Status)) {
1266 DEBUG ((DEBUG_ERROR, "Tcg Acpi Table installation failure"));
1267 }
1268}
1269
1279VOID
1280EFIAPI
1282 IN EFI_EVENT Event,
1283 IN VOID *Context
1284 )
1285{
1286 EFI_STATUS Status;
1287
1288 //
1289 // Measure invocation of ExitBootServices,
1290 //
1291 Status = TcgMeasureAction (
1292 EFI_EXIT_BOOT_SERVICES_INVOCATION
1293 );
1294 if (EFI_ERROR (Status)) {
1295 DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION));
1296 }
1297
1298 //
1299 // Measure success of ExitBootServices
1300 //
1301 Status = TcgMeasureAction (
1302 EFI_EXIT_BOOT_SERVICES_SUCCEEDED
1303 );
1304 if (EFI_ERROR (Status)) {
1305 DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED));
1306 }
1307}
1308
1318VOID
1319EFIAPI
1321 IN EFI_EVENT Event,
1322 IN VOID *Context
1323 )
1324{
1325 EFI_STATUS Status;
1326
1327 //
1328 // Measure Failure of ExitBootServices,
1329 //
1330 Status = TcgMeasureAction (
1331 EFI_EXIT_BOOT_SERVICES_FAILED
1332 );
1333 if (EFI_ERROR (Status)) {
1334 DEBUG ((DEBUG_ERROR, "%a not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED));
1335 }
1336}
1337
1349 OUT BOOLEAN *TPMDeactivatedFlag
1350 )
1351{
1352 EFI_STATUS Status;
1353 TPM_STCLEAR_FLAGS VolatileFlags;
1354
1355 Status = Tpm12GetCapabilityFlagVolatile (&VolatileFlags);
1356 if (!EFI_ERROR (Status)) {
1357 *TPMDeactivatedFlag = VolatileFlags.deactivated;
1358 }
1359
1360 return Status;
1361}
1362
1376EFIAPI
1378 IN EFI_HANDLE ImageHandle,
1379 IN EFI_SYSTEM_TABLE *SystemTable
1380 )
1381{
1382 EFI_STATUS Status;
1383 EFI_EVENT Event;
1384 VOID *Registration;
1385
1386 if (!CompareGuid (PcdGetPtr (PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)) {
1387 DEBUG ((DEBUG_ERROR, "No TPM12 instance required!\n"));
1388 return EFI_UNSUPPORTED;
1389 }
1390
1391 if (GetFirstGuidHob (&gTpmErrorHobGuid) != NULL) {
1392 DEBUG ((DEBUG_ERROR, "TPM error!\n"));
1393 return EFI_DEVICE_ERROR;
1394 }
1395
1396 Status = Tpm12RequestUseTpm ();
1397 if (EFI_ERROR (Status)) {
1398 DEBUG ((DEBUG_ERROR, "TPM not detected!\n"));
1399 return Status;
1400 }
1401
1402 Status = GetTpmStatus (&mTcgDxeData.BsCap.TPMDeactivatedFlag);
1403 if (EFI_ERROR (Status)) {
1404 DEBUG ((
1405 DEBUG_ERROR,
1406 "DriverEntry: TPM not working properly\n"
1407 ));
1408 return Status;
1409 }
1410
1411 Status = gBS->InstallProtocolInterface (
1412 &ImageHandle,
1413 &gEfiTcgProtocolGuid,
1415 &mTcgDxeData.TcgProtocol
1416 );
1417 if (!EFI_ERROR (Status) && (!mTcgDxeData.BsCap.TPMDeactivatedFlag) && mTcgDxeData.BsCap.TPMPresentFlag) {
1418 //
1419 // Setup the log area and copy event log from hob list to it
1420 //
1421 Status = SetupEventLog ();
1422 ASSERT_EFI_ERROR (Status);
1423
1424 //
1425 // Measure handoff tables, Boot#### variables etc.
1426 //
1428 TPL_CALLBACK,
1430 NULL,
1431 &Event
1432 );
1433
1434 Status = gBS->CreateEventEx (
1435 EVT_NOTIFY_SIGNAL,
1436 TPL_NOTIFY,
1438 NULL,
1439 &gEfiEventExitBootServicesGuid,
1440 &Event
1441 );
1442
1443 //
1444 // Measure Exit Boot Service failed
1445 //
1446 Status = gBS->CreateEventEx (
1447 EVT_NOTIFY_SIGNAL,
1448 TPL_NOTIFY,
1450 NULL,
1451 &gEventExitBootServicesFailedGuid,
1452 &Event
1453 );
1454 }
1455
1456 //
1457 // Install ACPI Table
1458 //
1459 EfiCreateProtocolNotifyEvent (&gEfiAcpiTableProtocolGuid, TPL_CALLBACK, InstallAcpiTable, NULL, &Registration);
1460
1461 return Status;
1462}
UINT64 UINTN
#define EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE
Definition: Acpi30.h:713
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
Definition: HobLib.c:215
VOID *EFIAPI GetNextGuidHob(IN CONST EFI_GUID *Guid, IN CONST VOID *HobStart)
Definition: HobLib.c:176
VOID *EFIAPI GetHobList(VOID)
Definition: HobLib.c:76
BOOLEAN EFIAPI Sha1Final(IN OUT VOID *Sha1Context, OUT UINT8 *HashValue)
Definition: CryptSha1.c:163
BOOLEAN EFIAPI Sha1Init(OUT VOID *Sha1Context)
Definition: CryptSha1.c:46
UINTN EFIAPI Sha1GetContextSize(VOID)
Definition: CryptSha1.c:22
BOOLEAN EFIAPI Sha1Update(IN OUT VOID *Sha1Context, IN CONST VOID *Data, IN UINTN DataSize)
Definition: CryptSha1.c:115
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
Definition: String.c:641
UINT8 EFIAPI CalculateCheckSum8(IN CONST UINT8 *Buffer, IN UINTN Length)
Definition: CheckSum.c:71
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
Definition: String.c:30
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
Definition: SetMemWrapper.c:38
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
Definition: MemLibGuid.c:73
VOID EFIAPI FreePool(IN VOID *Buffer)
UINTN EFIAPI UnicodeSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString,...)
Definition: PrintLib.c:408
EFI_RUNTIME_SERVICES * gRT
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define DEBUG(Expression)
Definition: DebugLib.h:434
#define REPORT_STATUS_CODE(Type, Value)
#define PcdGet64(TokenName)
Definition: PcdLib.h:375
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
#define PcdGet32(TokenName)
Definition: PcdLib.h:362
#define PcdGetPtr(TokenName)
Definition: PcdLib.h:388
#define EFI_ERROR_MINOR
Definition: PiStatusCode.h:58
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_STATUS EFIAPI TcgDxeHashLogExtendEvent(IN EFI_TCG_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS HashData, IN UINT64 HashDataLen, IN TPM_ALGORITHM_ID AlgorithmId, IN OUT TCG_PCR_EVENT *TCGLogData, IN OUT UINT32 *EventNumber, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry)
Definition: TcgDxe.c:630
EFI_STATUS EFIAPI SetupEventLog(VOID)
Definition: TcgDxe.c:707
VOID EFIAPI OnExitBootServicesFailed(IN EFI_EVENT Event, IN VOID *Context)
Definition: TcgDxe.c:1320
EFI_STATUS EFIAPI TcgMeasureAction(IN CHAR8 *String)
Definition: TcgDxe.c:785
EFI_STATUS EFIAPI TcgDxeStatusCheck(IN EFI_TCG_PROTOCOL *This, OUT TCG_EFI_BOOT_SERVICE_CAPABILITY *ProtocolCapability, OUT UINT32 *TCGFeatureFlags, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry)
Definition: TcgDxe.c:227
EFI_STATUS EFIAPI TcgDxeLogEvent(IN EFI_TCG_PROTOCOL *This, IN TCG_PCR_EVENT *TCGLogData, IN OUT UINT32 *EventNumber, IN UINT32 Flags)
Definition: TcgDxe.c:470
EFI_STATUS GetProcessorsCpuLocation(OUT EFI_CPU_PHYSICAL_LOCATION **LocationBuf, OUT UINTN *Num)
Definition: TcgDxe.c:134
VOID EFIAPI OnReadyToBoot(IN EFI_EVENT Event, IN VOID *Context)
Definition: TcgDxe.c:1119
EFI_STATUS EFIAPI TcgDxePassThroughToTpm(IN EFI_TCG_PROTOCOL *This, IN UINT32 TpmInputParameterBlockSize, IN UINT8 *TpmInputParameterBlock, IN UINT32 TpmOutputParameterBlockSize, IN UINT8 *TpmOutputParameterBlock)
Definition: TcgDxe.c:513
VOID EFIAPI OnExitBootServices(IN EFI_EVENT Event, IN VOID *Context)
Definition: TcgDxe.c:1281
EFI_STATUS EFIAPI MeasureSeparatorEvent(IN TPM_PCRINDEX PCRIndex)
Definition: TcgDxe.c:867
EFI_STATUS EFIAPI TpmCommHashAll(IN CONST UINT8 *Data, IN UINTN DataLen, OUT TPM_DIGEST *Digest)
Definition: TcgDxe.c:278
EFI_STATUS EFIAPI MeasureVariable(IN TPM_PCRINDEX PCRIndex, IN TCG_EVENTTYPE EventType, IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, IN VOID *VarData, IN UINTN VarSize)
Definition: TcgDxe.c:959
VOID EFIAPI InstallAcpiTable(IN EFI_EVENT Event, IN VOID *Context)
Definition: TcgDxe.c:1206
EFI_STATUS EFIAPI TcgDxeHashLogExtendEventI(IN TCG_DXE_DATA *TcgData, IN UINT8 *HashData, IN UINT64 HashDataLen, IN OUT TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData)
Definition: TcgDxe.c:555
EFI_STATUS EFIAPI MeasureHandoffTables(VOID)
Definition: TcgDxe.c:812
EFI_STATUS GetTpmStatus(OUT BOOLEAN *TPMDeactivatedFlag)
Definition: TcgDxe.c:1348
EFI_STATUS EFIAPI ReadAndMeasureBootVariable(IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, OUT UINTN *VarSize, OUT VOID **VarData)
Definition: TcgDxe.c:1024
EFI_STATUS TpmCommLogEvent(IN OUT UINT8 **EventLogPtr, IN OUT UINTN *LogSize, IN UINTN MaxSize, IN TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData)
Definition: TcgDxe.c:378
EFI_STATUS EFIAPI TcgDxeLogEventI(IN TCG_DXE_DATA *TcgData, IN TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData)
Definition: TcgDxe.c:424
EFI_STATUS EFIAPI MeasureAllBootVariables(VOID)
Definition: TcgDxe.c:1061
EFI_STATUS EFIAPI DriverEntry(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: TcgDxe.c:1377
VOID *EFIAPI ReadVariable(IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, OUT UINTN *VarSize)
Definition: TcgDxe.c:902
EFI_STATUS EFIAPI TcgDxeHashAll(IN EFI_TCG_PROTOCOL *This, IN UINT8 *HashData, IN UINT64 HashDataLen, IN TCG_ALGORITHM_ID AlgorithmId, IN OUT UINT64 *HashedDataLen, IN OUT UINT8 **HashedDataResult)
Definition: TcgDxe.c:320
struct tdTPM_DIGEST TPM_DIGEST
UINT32 TPM_PCRINDEX
Definition: Tpm12.h:133
#define TPM_ALG_SHA
The SHA1 algorithm.
Definition: Tpm12.h:365
UINT32 TPM_ALGORITHM_ID
Definition: Tpm12.h:105
EFI_STATUS EFIAPI Tpm12Extend(IN TPM_DIGEST *DigestToExtend, IN TPM_PCRINDEX PcrIndex, OUT TPM_DIGEST *NewPcrValue)
Definition: Tpm12Pcr.c:46
EFI_STATUS EFIAPI Tpm12GetCapabilityFlagVolatile(OUT TPM_STCLEAR_FLAGS *VolatileFlags)
EFI_STATUS EFIAPI Tpm12RequestUseTpm(VOID)
Definition: Tpm12Tis.c:555
EFI_STATUS EFIAPI Tpm12SubmitCommand(IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN OUT UINT32 *OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition: Tpm12Tis.c:453
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
#define EFI_SIZE_TO_PAGES(Size)
Definition: UefiBaseType.h:200
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_STATUS EFIAPI EfiCreateEventReadyToBootEx(IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction OPTIONAL, IN VOID *NotifyContext OPTIONAL, OUT EFI_EVENT *ReadyToBootEvent)
Definition: UefiNotTiano.c:164
EFI_EVENT EFIAPI EfiCreateProtocolNotifyEvent(IN EFI_GUID *ProtocolGuid, IN EFI_TPL NotifyTpl, IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext OPTIONAL, OUT VOID **Registration)
Definition: UefiLib.c:134
@ EfiBootServicesData
@ EfiACPIMemoryNVS
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
@ AllocateMaxAddress
Definition: UefiSpec.h:38
EFI_CPU_PHYSICAL_LOCATION Location
Definition: MpService.h:178
Definition: Base.h:213
INT8 VariableData[1]
Driver or platform-specific data.