coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
log.c File Reference
#include <console/console.h>
#include <security/tpm/tspi.h>
#include <region_file.h>
#include <string.h>
#include <symbols.h>
#include <cbmem.h>
#include <bootstate.h>
#include <vb2_sha.h>
Include dependency graph for log.c:

Go to the source code of this file.

Functions

static struct tcpa_tabletcpa_cbmem_init (void)
 
struct tcpa_tabletcpa_log_init (void)
 Get the pointer to the single instance of global tcpa log data, and initialize it when necessary. More...
 
void tcpa_log_dump (void *unused)
 Dump TCPA log entries on console. More...
 
void tcpa_log_add_table_entry (const char *name, const uint32_t pcr, enum vb2_hash_algorithm digest_algo, const uint8_t *digest, const size_t digest_len)
 Add table entry for cbmem TCPA log. More...
 
void tcpa_preram_log_clear (void)
 Clears the pre-RAM tcpa log data and initializes any content with default values. More...
 
static void recover_tcpa_log (int is_recovery)
 
 ROMSTAGE_CBMEM_INIT_HOOK (recover_tcpa_log)
 
 BOOT_STATE_INIT_ENTRY (BS_PAYLOAD_BOOT, BS_ON_ENTRY, tcpa_log_dump, NULL)
 

Function Documentation

◆ BOOT_STATE_INIT_ENTRY()

BOOT_STATE_INIT_ENTRY ( BS_PAYLOAD_BOOT  ,
BS_ON_ENTRY  ,
tcpa_log_dump  ,
NULL   
)

◆ recover_tcpa_log()

◆ ROMSTAGE_CBMEM_INIT_HOOK()

ROMSTAGE_CBMEM_INIT_HOOK ( recover_tcpa_log  )

◆ tcpa_cbmem_init()

static struct tcpa_table* tcpa_cbmem_init ( void  )
static

Definition at line 12 of file log.c.

References cbmem_add(), cbmem_find(), CBMEM_ID_TCPA_LOG, cbmem_possibly_online(), tcpa_table::max_entries, MAX_TCPA_LOG_ENTRIES, and tcpa_table::num_entries.

Referenced by recover_tcpa_log(), and tcpa_log_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcpa_log_add_table_entry()

void tcpa_log_add_table_entry ( const char *  name,
const uint32_t  pcr,
enum vb2_hash_algorithm  digest_algo,
const uint8_t digest,
const size_t  digest_len 
)

Add table entry for cbmem TCPA log.

Parameters
nameName of the hashed data
pcrPCR used to extend hashed data
diget_algosets the digest algorithm
digestsets the hash extended into the tpm
digest_lenthe length of the digest

Definition at line 79 of file log.c.

References BIOS_WARNING, tcpa_entry::digest, tcpa_entry::digest_length, tcpa_entry::digest_type, tcpa_table::entries, tcpa_table::max_entries, memcpy(), name, tcpa_entry::name, tcpa_table::num_entries, tcpa_entry::pcr, printk, strncpy(), TCPA_DIGEST_MAX_LENGTH, tcpa_log_init(), TCPA_PCR_HASH_LEN, and TCPA_PCR_HASH_NAME.

Referenced by tpm_extend_pcr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcpa_log_dump()

void tcpa_log_dump ( void unused)

Dump TCPA log entries on console.

Definition at line 54 of file log.c.

References BIOS_INFO, tcpa_entry::digest, tcpa_entry::digest_length, tcpa_entry::digest_type, tcpa_table::entries, tcpa_entry::name, tcpa_table::num_entries, tcpa_entry::pcr, printk, and tcpa_log_init().

Here is the call graph for this function:

◆ tcpa_log_init()

struct tcpa_table* tcpa_log_init ( void  )

Get the pointer to the single instance of global tcpa log data, and initialize it when necessary.

Definition at line 33 of file log.c.

References cbmem_possibly_online(), CONFIG, ENV_ROMSTAGE, and tcpa_cbmem_init().

Referenced by tcpa_log_add_table_entry(), tcpa_log_dump(), and tspi_measure_cache_to_pcr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ tcpa_preram_log_clear()

void tcpa_preram_log_clear ( void  )

Clears the pre-RAM tcpa log data and initializes any content with default values.

Definition at line 116 of file log.c.

References BIOS_INFO, tcpa_table::max_entries, MAX_TCPA_LOG_ENTRIES, tcpa_table::num_entries, and printk.

Referenced by tspi_init_crtm().

Here is the caller graph for this function: