TianoCore EDK2 master
|
#include <IndustryStandard/UefiTcgPlatform.h>
#include <Guid/EventGroup.h>
#include <Guid/MicrocodePatchHob.h>
#include <Library/DebugLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiLib.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/HobLib.h>
#include <Library/MicrocodeLib.h>
#include <Library/TpmMeasurementLib.h>
Go to the source code of this file.
Data Structures | |
struct | CPU_MICROCODE_MEASUREMENT_EVENT_LOG |
Macros | |
#define | CPU_MICROCODE_MEASUREMENT_DESCRIPTION "Microcode Measurement" |
#define | CPU_MICROCODE_MEASUREMENT_EVENT_LOG_DESCRIPTION_LEN sizeof (CPU_MICROCODE_MEASUREMENT_DESCRIPTION) |
Functions | |
INTN EFIAPI | MicrocodePatchOffsetCompareFunction (IN CONST VOID *Offset1, IN CONST VOID *Offset2) |
VOID | RemoveDuplicateAndInvalidOffset (IN UINT64 *Offsets, IN OUT UINTN *Count) |
VOID EFIAPI | MeasureMicrocodePatches (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | MicrocodeMeasurementDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
This driver measures microcode patches to TPM.
This driver consumes gEdkiiMicrocodePatchHobGuid, packs all unique microcode patch found in gEdkiiMicrocodePatchHobGuid to a binary blob, and measures the binary blob to TPM.
Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file MicrocodeMeasurementDxe.c.
#define CPU_MICROCODE_MEASUREMENT_DESCRIPTION "Microcode Measurement" |
Definition at line 25 of file MicrocodeMeasurementDxe.c.
#define CPU_MICROCODE_MEASUREMENT_EVENT_LOG_DESCRIPTION_LEN sizeof (CPU_MICROCODE_MEASUREMENT_DESCRIPTION) |
Definition at line 26 of file MicrocodeMeasurementDxe.c.
Callback function.
Called after signaling of the Ready to Boot Event. Measure microcode patches binary blob with event type EV_CPU_MICROCODE to PCR[1] in TPM.
[in] | Event | Event whose notification function is being invoked. |
[in] | Context | Pointer to the notification function's context. |
Definition at line 135 of file MicrocodeMeasurementDxe.c.
EFI_STATUS EFIAPI MicrocodeMeasurementDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Driver to produce microcode measurement.
Driver to produce microcode measurement. Which install a callback function on ready to boot event.
ImageHandle | Module's image handle |
SystemTable | Pointer of EFI_SYSTEM_TABLE |
Definition at line 263 of file MicrocodeMeasurementDxe.c.
INTN EFIAPI MicrocodePatchOffsetCompareFunction | ( | IN CONST VOID * | Offset1, |
IN CONST VOID * | Offset2 | ||
) |
Helping function.
The function is called by QuickSort to compare the order of offsets of two microcode patches in RAM relative to their base address. Elements will be in ascending order.
[in] | Offset1 | The pointer to the offset of first microcode patch. |
[in] | Offset2 | The pointer to the offset of second microcode patch. |
1 | The offset of first microcode patch is bigger than that of the second. |
-1 | The offset of first microcode patch is smaller than that of the second. |
0 | The offset of first microcode patch equals to that of the second. |
Definition at line 52 of file MicrocodeMeasurementDxe.c.
This function remove duplicate and invalid offsets in Offsets.
This function remove duplicate and invalid offsets in Offsets. Invalid offset means MAX_UINT64 in Offsets.
[in] | Offsets | Microcode offset list. |
[in,out] | Count | On call as the count of raw microcode offset list; On return as count of the clean microcode offset list. |
Definition at line 75 of file MicrocodeMeasurementDxe.c.