TianoCore EDK2 master
Loading...
Searching...
No Matches
TdxMeasurementHob.c File Reference

Go to the source code of this file.

Data Structures

struct  TDX_HANDOFF_TABLE_POINTERS2
 

Macros

#define HANDOFF_TABLE_DESC   "TdxTable"
 
#define FV_HANDOFF_TABLE_DESC   "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)"
 
#define TDX_DIGEST_VALUE_LEN   (sizeof (UINT32) + sizeof (TPMI_ALG_HASH) + SHA384_DIGEST_SIZE)
 

Typedefs

typedef PLATFORM_FIRMWARE_BLOB2_STRUCT CFV_HANDOFF_TABLE_POINTERS2
 

Functions

STATIC EFI_STATUS BuildTdxMeasurementGuidHob (UINT32 RtmrIndex, UINT32 EventType, UINT8 *EventData, UINT32 EventSize, UINT8 *HashValue, UINT32 HashSize)
 
VOID * GetFvName (IN EFI_PHYSICAL_ADDRESS FvBase, IN UINT64 FvLength)
 
EFI_STATUS InternalBuildGuidHobForTdxMeasurement (VOID)
 

Detailed Description

Build GuidHob for tdx measurement.

Copyright (c) 2022 - 2023, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TdxMeasurementHob.c.

Macro Definition Documentation

◆ FV_HANDOFF_TABLE_DESC

#define FV_HANDOFF_TABLE_DESC   "Fv(XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)"

Definition at line 33 of file TdxMeasurementHob.c.

◆ HANDOFF_TABLE_DESC

#define HANDOFF_TABLE_DESC   "TdxTable"

Definition at line 23 of file TdxMeasurementHob.c.

Typedef Documentation

◆ CFV_HANDOFF_TABLE_POINTERS2

Function Documentation

◆ BuildTdxMeasurementGuidHob()

STATIC EFI_STATUS BuildTdxMeasurementGuidHob ( UINT32  RtmrIndex,
UINT32  EventType,
UINT8 *  EventData,
UINT32  EventSize,
UINT8 *  HashValue,
UINT32  HashSize 
)

Build GuidHob for Tdx measurement.

Tdx measurement includes the measurement of TdHob and CFV. They're measured and extended to RTMR registers in SEC phase. Because at that moment the Hob service are not available. So the values of the measurement are saved in workarea and will be built into GuidHob after the Hob service is ready.

Parameters
RtmrIndexRTMR index
EventTypeEvent type
EventDataEvent data
EventSizeSize of event data
HashValueHash value
HashSizeSize of hash
Return values
EFI_SUCCESSSuccessfully build the GuidHobs
OthersOther error as indicated

Definition at line 56 of file TdxMeasurementHob.c.

◆ GetFvName()

VOID * GetFvName ( IN EFI_PHYSICAL_ADDRESS  FvBase,
IN UINT64  FvLength 
)

Get the FvName from the FV header.

Causion: The FV is untrusted input.

Parameters
[in]FvBaseBase address of FV image.
[in]FvLengthLength of FV image.
Returns
FvName pointer
Return values
NULLFvName is NOT found

Definition at line 131 of file TdxMeasurementHob.c.

◆ InternalBuildGuidHobForTdxMeasurement()

EFI_STATUS InternalBuildGuidHobForTdxMeasurement ( VOID  )

Build the GuidHob for tdx measurements which were done in SEC phase. The measurement values are stored in WorkArea.

Return values
EFI_SUCCESSThe GuidHob is built successfully
OthersOther errors as indicated

Definition at line 173 of file TdxMeasurementHob.c.