Skip to content

Commit

Permalink
x86/tpm.c: implement event log for TPM2.0
Browse files Browse the repository at this point in the history
Signed-off-by: Sergii Dmytruk <[email protected]>
  • Loading branch information
SergiiDmytruk committed Sep 25, 2023
1 parent ad99695 commit 6efb4aa
Show file tree
Hide file tree
Showing 2 changed files with 267 additions and 52 deletions.
33 changes: 33 additions & 0 deletions xen/arch/x86/include/asm/intel_txt.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,39 @@ struct txt_sinit_mle_data {
/* Ext Data Elements */
} __packed;

/* Types of extended data. */
#define TXT_HEAP_EXTDATA_TYPE_END 0
#define TXT_HEAP_EXTDATA_TYPE_BIOS_SPEC_VER 1
#define TXT_HEAP_EXTDATA_TYPE_ACM 2
#define TXT_HEAP_EXTDATA_TYPE_STM 3
#define TXT_HEAP_EXTDATA_TYPE_CUSTOM 4
#define TXT_HEAP_EXTDATA_TYPE_MADT 6
#define TXT_HEAP_EXTDATA_TYPE_EVENT_LOG_POINTER2_1 8
#define TXT_HEAP_EXTDATA_TYPE_MCFG 9
#define TXT_HEAP_EXTDATA_TYPE_TPR_REQ 13
#define TXT_HEAP_EXTDATA_TYPE_DTPR 14
#define TXT_HEAP_EXTDATA_TYPE_CEDT 15

/*
* Self-describing data structure that is used for extensions to TXT heap
* tables.
*/
struct txt_ext_data_element {
uint32_t type; /* One of TXT_HEAP_EXTDATA_TYPE_*. */
uint32_t size;
uint8_t data[0]; /* size bytes. */
} __packed;

/*
* Extended data describing TPM 2.0 log.
*/
struct heap_event_log_pointer_element2_1 {
uint64_t physical_address;
uint32_t allocated_event_container_size;
uint32_t first_record_offset;
uint32_t next_record_offset;
} __packed;

/*
* Functions to extract data from the Intel TXT Heap Memory. The layout
* of the heap is as follows:
Expand Down
Loading

0 comments on commit 6efb4aa

Please sign in to comment.