TianoCore EDK2 master
|
#include <PiPei.h>
#include <IndustryStandard/UefiTcgPlatform.h>
#include <Ppi/FirmwareVolumeInfo.h>
#include <Ppi/FirmwareVolumeInfo2.h>
#include <Ppi/TpmInitialized.h>
#include <Ppi/FirmwareVolume.h>
#include <Ppi/EndOfPeiPhase.h>
#include <Ppi/FirmwareVolumeInfoMeasurementExcluded.h>
#include <Ppi/FirmwareVolumeInfoPrehashedFV.h>
#include <Ppi/Tcg.h>
#include <Guid/TcgEventHob.h>
#include <Guid/MeasuredFvHob.h>
#include <Guid/TpmInstance.h>
#include <Guid/MigratedFvInfo.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeiServicesLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/Tpm2CommandLib.h>
#include <Library/Tpm2DeviceLib.h>
#include <Library/HashLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/PeiServicesTablePointerLib.h>
#include <Protocol/Tcg2Protocol.h>
#include <Library/PerformanceLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/ResetSystemLib.h>
#include <Library/PrintLib.h>
Go to the source code of this file.
Data Structures | |
struct | TCG2_EVENT_INFO_STRUCT |
struct | FV_HANDOFF_TABLE_POINTERS2 |
Macros | |
#define | PERF_ID_TCG2_PEI 0x3080 |
#define | FIRMWARE_BLOB_GROWTH_STEP 4 |
#define | FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)" |
Initialize TPM2 device and measure FVs before handing off control to DXE.
Copyright (c) 2015 - 2021, Intel Corporation. All rights reserved.
Copyright (c) 2017, Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Tcg2Pei.c.
#define FV_HANDOFF_TABLE_DESC "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)" |
EFI_STATUS EFIAPI EndofPeiSignalNotifyCallBack | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor, | ||
IN VOID * | Ppi | ||
) |
Record all measured Firmware Volume Information into a Guid Hob
[in] | PeiServices | An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. |
[in] | NotifyDescriptor | Address of the notification descriptor data structure. |
[in] | Ppi | Address of the PPI that was installed. |
EFI_SUCCESS | The FV Info is measured and recorded to TPM. |
Record all measured Firmware Volume Information into a Guid Hob Guid Hob payload layout is
UINT32 *************************** FIRMWARE_BLOB number EFI_PLATFORM_FIRMWARE_BLOB******** BLOB Array
[in] | PeiServices | An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. |
[in] | NotifyDescriptor | Address of the notification descriptor data structure. |
[in] | Ppi | Address of the PPI that was installed. |
EFI_SUCCESS | The FV Info is measured and recorded to TPM. |
EFI_STATUS EFIAPI FirmwareVolumeInfoPpiNotifyCallback | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor, | ||
IN VOID * | Ppi | ||
) |
Measure and record the Firmware Volume Information once FvInfoPPI install.
[in] | PeiServices | An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation. |
[in] | NotifyDescriptor | Address of the notification descriptor data structure. |
[in] | Ppi | Address of the PPI that was installed. |
EFI_SUCCESS | The FV Info is measured and recorded to TPM. |
VOID * GetFvName | ( | IN EFI_PHYSICAL_ADDRESS | FvBase, |
IN UINT64 | FvLength | ||
) |
EFI_STATUS EFIAPI HashLogExtendEvent | ( | IN EDKII_TCG_PPI * | This, |
IN UINT64 | Flags, | ||
IN UINT8 * | HashData, | ||
IN UINTN | HashDataLen, | ||
IN TCG_PCR_EVENT_HDR * | NewEventHdr, | ||
IN UINT8 * | NewEventData | ||
) |
Do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and build a GUIDed HOB recording the event which will be passed to the DXE phase and added into the Event Log.
[in] | This | Indicates the calling context |
[in] | Flags | Bitmap providing additional information. |
[in] | HashData | If BIT0 of Flags is 0, it is physical address of the start of the data buffer to be hashed, extended, and logged. If BIT0 of Flags is 1, it is physical address of the start of the pre-hash data buffter to be extended, and logged. The pre-hash data format is TPML_DIGEST_VALUES. |
[in] | HashDataLen | The length, in bytes, of the buffer referenced by HashData. |
[in] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR data structure. |
[in] | NewEventData | Pointer to the new event data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
Do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and build a GUIDed HOB recording the event which will be passed to the DXE phase and added into the Event Log.
[in] | This | Indicates the calling context. |
[in] | Flags | Bitmap providing additional information. |
[in] | HashData | Physical address of the start of the data buffer to be hashed, extended, and logged. |
[in] | HashDataLen | The length, in bytes, of the buffer referenced by HashData. |
[in] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR data structure. |
[in] | NewEventData | Pointer to the new event data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
EFI_STATUS LogHashEvent | ( | IN TPML_DIGEST_VALUES * | DigestList, |
IN OUT TCG_PCR_EVENT_HDR * | NewEventHdr, | ||
IN UINT8 * | NewEventData | ||
) |
Add a new entry to the Event Log.
[in] | DigestList | A list of digest. |
[in,out] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR data structure. |
[in] | NewEventData | Pointer to the new event data. |
EFI_SUCCESS | The new event log entry was added. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_STATUS MeasureCRTMVersion | ( | VOID | ) |
EFI_STATUS MeasureFvImage | ( | IN EFI_PHYSICAL_ADDRESS | FvBase, |
IN UINT64 | FvLength | ||
) |
Measure FV image. Add it into the measured FV list after the FV is measured successfully.
[in] | FvBase | Base address of FV image. |
[in] | FvLength | Length of FV image. |
EFI_SUCCESS | Fv image is measured successfully or it has been already measured. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
EFI_STATUS MeasureMainBios | ( | VOID | ) |
EFI_STATUS MeasureSeparatorEventWithError | ( | IN TPM_PCRINDEX | PCRIndex | ) |
EFI_STATUS EFIAPI PeimEntryMA | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
EFI_STATUS PeimEntryMP | ( | IN EFI_PEI_SERVICES ** | PeiServices | ) |
Do measurement after memory is ready.
[in] | PeiServices | Describes the list of possible PEI Services. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
VOID SyncPcrAllocationsAndPcrMask | ( | VOID | ) |
EDKII_TCG_PPI mEdkiiTcgPpi |
EFI_PEI_FILE_HANDLE mFileHandle |
EFI_PLATFORM_FIRMWARE_BLOB* mMeasuredBaseFvInfo |
EFI_PLATFORM_FIRMWARE_BLOB* mMeasuredChildFvInfo |
EFI_PEI_NOTIFY_DESCRIPTOR mNotifyList[] |
TCG2_EVENT_INFO_STRUCT mTcg2EventInfo[] |
EFI_PEI_PPI_DESCRIPTOR mTcgPpiList |
EFI_PEI_PPI_DESCRIPTOR mTpmInitializationDonePpiList |
EFI_PEI_PPI_DESCRIPTOR mTpmInitializedPpiList |