TianoCore EDK2 master
Loading...
Searching...
No Matches
CcMeasurement.h File Reference

Go to the source code of this file.

Data Structures

struct  EFI_CC_VERSION
 
struct  EFI_CC_TYPE
 
struct  EFI_CC_EVENT_HEADER
 
struct  EFI_CC_EVENT
 
struct  EFI_CC_BOOT_SERVICE_CAPABILITY
 
struct  _EFI_CC_MEASUREMENT_PROTOCOL
 
struct  CC_EVENT
 
struct  CC_EVENT_HDR
 
struct  EFI_CC_FINAL_EVENTS_TABLE
 
struct  EFI_CC_EVENTLOG_ACPI_TABLE
 

Macros

#define EFI_CC_MEASUREMENT_PROTOCOL_GUID    { 0x96751a3d, 0x72f4, 0x41a6, { 0xa7, 0x94, 0xed, 0x5d, 0x0e, 0x67, 0xae, 0x6b }}
 
#define EFI_CC_TYPE_NONE   0
 
#define EFI_CC_TYPE_SEV   1
 
#define EFI_CC_TYPE_TDX   2
 
#define TDX_MR_INDEX_MRTD   0
 
#define TDX_MR_INDEX_RTMR0   1
 
#define TDX_MR_INDEX_RTMR1   2
 
#define TDX_MR_INDEX_RTMR2   3
 
#define TDX_MR_INDEX_RTMR3   4
 
#define EFI_CC_EVENT_LOG_FORMAT_TCG_2   0x00000002
 
#define EFI_CC_BOOT_HASH_ALG_SHA384   0x00000004
 
#define EFI_CC_FLAG_EXTEND_ONLY   0x0000000000000001
 
#define EFI_CC_FLAG_PE_COFF_IMAGE   0x0000000000000010
 
#define EFI_CC_EVENT_HEADER_VERSION   1
 
#define EFI_CC_FINAL_EVENTS_TABLE_VERSION   1
 
#define EFI_CC_FINAL_EVENTS_TABLE_GUID    {0xdd4a4648, 0x2de7, 0x4665, {0x96, 0x4d, 0x21, 0xd9, 0xef, 0x5f, 0xb4, 0x46}}
 
#define EFI_CC_EVENTLOG_ACPI_TABLE_SIGNATURE   SIGNATURE_32('C', 'C', 'E', 'L')
 
#define EFI_CC_EVENTLOG_ACPI_TABLE_REVISION   1
 

Typedefs

typedef struct _EFI_CC_MEASUREMENT_PROTOCOL EFI_CC_MEASUREMENT_PROTOCOL
 
typedef UINT32 EFI_CC_EVENT_LOG_BITMAP
 
typedef UINT32 EFI_CC_EVENT_LOG_FORMAT
 
typedef UINT32 EFI_CC_EVENT_ALGORITHM_BITMAP
 
typedef UINT32 EFI_CC_MR_INDEX
 
typedef EFI_STATUS(EFIAPI * EFI_CC_GET_CAPABILITY) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN OUT EFI_CC_BOOT_SERVICE_CAPABILITY *ProtocolCapability)
 
typedef EFI_STATUS(EFIAPI * EFI_CC_GET_EVENT_LOG) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN EFI_CC_EVENT_LOG_FORMAT EventLogFormat, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry, OUT BOOLEAN *EventLogTruncated)
 
typedef EFI_STATUS(EFIAPI * EFI_CC_HASH_LOG_EXTEND_EVENT) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN EFI_CC_EVENT *EfiCcEvent)
 
typedef EFI_STATUS(EFIAPI * EFI_CC_MAP_PCR_TO_MR_INDEX) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN TCG_PCRINDEX PcrIndex, OUT EFI_CC_MR_INDEX *MrIndex)
 

Variables

EFI_GUID gEfiCcMeasurementProtocolGuid
 
EFI_GUID gEfiCcFinalEventsTableGuid
 

Detailed Description

If CC Guest firmware supports measurement and an event is created, CC Guest firmware is designed to report the event log with the same data structure in TCG-Platform-Firmware-Profile specification with EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 format.

The CC Guest firmware supports measurement, the CC Guest Firmware is designed to produce EFI_CC_MEASUREMENT_PROTOCOL with new GUID EFI_CC_MEASUREMENT_PROTOCOL_GUID to report event log and provides hash capability.

Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file CcMeasurement.h.

Macro Definition Documentation

◆ EFI_CC_BOOT_HASH_ALG_SHA384

#define EFI_CC_BOOT_HASH_ALG_SHA384   0x00000004

Definition at line 60 of file CcMeasurement.h.

◆ EFI_CC_EVENT_HEADER_VERSION

#define EFI_CC_EVENT_HEADER_VERSION   1

Definition at line 73 of file CcMeasurement.h.

◆ EFI_CC_EVENT_LOG_FORMAT_TCG_2

#define EFI_CC_EVENT_LOG_FORMAT_TCG_2   0x00000002

Definition at line 59 of file CcMeasurement.h.

◆ EFI_CC_EVENTLOG_ACPI_TABLE_REVISION

#define EFI_CC_EVENTLOG_ACPI_TABLE_REVISION   1

Definition at line 321 of file CcMeasurement.h.

◆ EFI_CC_EVENTLOG_ACPI_TABLE_SIGNATURE

#define EFI_CC_EVENTLOG_ACPI_TABLE_SIGNATURE   SIGNATURE_32('C', 'C', 'E', 'L')

Definition at line 320 of file CcMeasurement.h.

◆ EFI_CC_FINAL_EVENTS_TABLE_GUID

#define EFI_CC_FINAL_EVENTS_TABLE_GUID    {0xdd4a4648, 0x2de7, 0x4665, {0x96, 0x4d, 0x21, 0xd9, 0xef, 0x5f, 0xb4, 0x46}}

Definition at line 297 of file CcMeasurement.h.

◆ EFI_CC_FINAL_EVENTS_TABLE_VERSION

#define EFI_CC_FINAL_EVENTS_TABLE_VERSION   1

Definition at line 280 of file CcMeasurement.h.

◆ EFI_CC_FLAG_EXTEND_ONLY

#define EFI_CC_FLAG_EXTEND_ONLY   0x0000000000000001

Definition at line 65 of file CcMeasurement.h.

◆ EFI_CC_FLAG_PE_COFF_IMAGE

#define EFI_CC_FLAG_PE_COFF_IMAGE   0x0000000000000010

Definition at line 69 of file CcMeasurement.h.

◆ EFI_CC_MEASUREMENT_PROTOCOL_GUID

#define EFI_CC_MEASUREMENT_PROTOCOL_GUID    { 0x96751a3d, 0x72f4, 0x41a6, { 0xa7, 0x94, 0xed, 0x5d, 0x0e, 0x67, 0xae, 0x6b }}

Definition at line 22 of file CcMeasurement.h.

◆ EFI_CC_TYPE_NONE

#define EFI_CC_TYPE_NONE   0

Definition at line 36 of file CcMeasurement.h.

◆ EFI_CC_TYPE_SEV

#define EFI_CC_TYPE_SEV   1

Definition at line 37 of file CcMeasurement.h.

◆ EFI_CC_TYPE_TDX

#define EFI_CC_TYPE_TDX   2

Definition at line 38 of file CcMeasurement.h.

◆ TDX_MR_INDEX_MRTD

#define TDX_MR_INDEX_MRTD   0

Definition at line 53 of file CcMeasurement.h.

◆ TDX_MR_INDEX_RTMR0

#define TDX_MR_INDEX_RTMR0   1

Definition at line 54 of file CcMeasurement.h.

◆ TDX_MR_INDEX_RTMR1

#define TDX_MR_INDEX_RTMR1   2

Definition at line 55 of file CcMeasurement.h.

◆ TDX_MR_INDEX_RTMR2

#define TDX_MR_INDEX_RTMR2   3

Definition at line 56 of file CcMeasurement.h.

◆ TDX_MR_INDEX_RTMR3

#define TDX_MR_INDEX_RTMR3   4

Definition at line 57 of file CcMeasurement.h.

Typedef Documentation

◆ EFI_CC_EVENT_ALGORITHM_BITMAP

typedef UINT32 EFI_CC_EVENT_ALGORITHM_BITMAP

Definition at line 47 of file CcMeasurement.h.

◆ EFI_CC_EVENT_LOG_BITMAP

typedef UINT32 EFI_CC_EVENT_LOG_BITMAP

Definition at line 45 of file CcMeasurement.h.

◆ EFI_CC_EVENT_LOG_FORMAT

typedef UINT32 EFI_CC_EVENT_LOG_FORMAT

Definition at line 46 of file CcMeasurement.h.

◆ EFI_CC_GET_CAPABILITY

typedef EFI_STATUS(EFIAPI * EFI_CC_GET_CAPABILITY) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN OUT EFI_CC_BOOT_SERVICE_CAPABILITY *ProtocolCapability)

The EFI_CC_MEASUREMENT_PROTOCOL GetCapability function call provides protocol capability information and state information.

Parameters
[in]ThisIndicates the calling context
[in,out]ProtocolCapabilityThe caller allocates memory for a EFI_CC_BOOT_SERVICE_CAPABILITY structure and sets the size field to the size of the structure allocated. The callee fills in the fields with the EFI CC BOOT Service capability information and the current CC information.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful. The ProtocolCapability variable will not be populated.
EFI_INVALID_PARAMETEROne or more of the parameters are incorrect. The ProtocolCapability variable will not be populated.
EFI_BUFFER_TOO_SMALLThe ProtocolCapability variable is too small to hold the full response. It will be partially populated (required Size field will be set).

Definition at line 156 of file CcMeasurement.h.

◆ EFI_CC_GET_EVENT_LOG

typedef EFI_STATUS(EFIAPI * EFI_CC_GET_EVENT_LOG) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN EFI_CC_EVENT_LOG_FORMAT EventLogFormat, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry, OUT BOOLEAN *EventLogTruncated)

The EFI_CC_MEASUREMENT_PROTOCOL Get Event Log function call allows a caller to retrieve the address of a given event log and its last entry.

Parameters
[in]ThisIndicates the calling context
[in]EventLogFormatThe type of the event log for which the information is requested.
[out]EventLogLocationA pointer to the memory address of the event log.
[out]EventLogLastEntryIf the Event Log contains more than one entry, this is a pointer to the address of the start of the last entry in the event log in memory.
[out]EventLogTruncatedIf the Event Log is missing at least one entry because an event would have exceeded the area allocated for events, this value is set to TRUE. Otherwise, the value will be FALSE and the Event Log will be complete.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_INVALID_PARAMETEROne or more of the parameters are incorrect (e.g. asking for an event log whose format is not supported).

Definition at line 180 of file CcMeasurement.h.

◆ EFI_CC_HASH_LOG_EXTEND_EVENT

typedef EFI_STATUS(EFIAPI * EFI_CC_HASH_LOG_EXTEND_EVENT) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN EFI_CC_EVENT *EfiCcEvent)

The EFI_CC_MEASUREMENT_PROTOCOL HashLogExtendEvent function call provides callers with an opportunity to extend and optionally log events without requiring knowledge of actual CC commands. The extend operation will occur even if this function cannot create an event log entry (e.g. due to the event log being full).

Parameters
[in]ThisIndicates the calling context
[in]FlagsBitmap providing additional information.
[in]DataToHashPhysical address of the start of the data buffer to be hashed.
[in]DataToHashLenThe length in bytes of the buffer referenced by DataToHash.
[in]EfiCcEventPointer to data buffer containing information about the event.
Return values
EFI_SUCCESSOperation completed successfully.
EFI_DEVICE_ERRORThe command was unsuccessful.
EFI_VOLUME_FULLThe extend operation occurred, but the event could not be written to one or more event logs.
EFI_INVALID_PARAMETEROne or more of the parameters are incorrect.
EFI_UNSUPPORTEDThe PE/COFF image type is not supported.

Definition at line 209 of file CcMeasurement.h.

◆ EFI_CC_MAP_PCR_TO_MR_INDEX

typedef EFI_STATUS(EFIAPI * EFI_CC_MAP_PCR_TO_MR_INDEX) (IN EFI_CC_MEASUREMENT_PROTOCOL *This, IN TCG_PCRINDEX PcrIndex, OUT EFI_CC_MR_INDEX *MrIndex)

The EFI_CC_MEASUREMENT_PROTOCOL MapPcrToMrIndex function call provides callers the info on TPM PCR <-> CC MR mapping information.

Parameters
[in]ThisIndicates the calling context
[in]PcrIndexTPM PCR index.
[out]MrIndexCC MR index.
Return values
EFI_SUCCESSThe MrIndex is returned.
EFI_INVALID_PARAMETERThe MrIndex is NULL.
EFI_UNSUPPORTEDThe PcrIndex is invalid.

Definition at line 231 of file CcMeasurement.h.

◆ EFI_CC_MEASUREMENT_PROTOCOL

Definition at line 26 of file CcMeasurement.h.

◆ EFI_CC_MR_INDEX

typedef UINT32 EFI_CC_MR_INDEX

Definition at line 48 of file CcMeasurement.h.