summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2022-11-10 00:40:51 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-01-11 16:00:55 +0000
commit2710df765bad08d8200c70399ace5e78d3d1cecc (patch)
tree91d7d24f8e5117077c577f8c6b973e97c0944647 /src
parent16a444c5011e70298ebd9546a39f9d8b61d95030 (diff)
downloadcoreboot-2710df765bad08d8200c70399ace5e78d3d1cecc.tar.gz
coreboot-2710df765bad08d8200c70399ace5e78d3d1cecc.tar.bz2
coreboot-2710df765bad08d8200c70399ace5e78d3d1cecc.zip
treewide: stop calling custom TPM log "TCPA"
TCPA usually refers to log described by TPM 1.2 specification. Change-Id: I896bd94f18b34d6c4b280f58b011d704df3d4022 Ticket: https://ticket.coreboot.org/issues/423 Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/69444 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/car.ld4
-rw-r--r--src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h4
-rw-r--r--src/commonlib/include/commonlib/coreboot_tables.h2
-rw-r--r--src/commonlib/include/commonlib/tcpa_log_serialized.h29
-rw-r--r--src/commonlib/include/commonlib/tpm_log_serialized.h30
-rw-r--r--src/include/memlayout.h6
-rw-r--r--src/include/symbols.h2
-rw-r--r--src/lib/cbfs.c2
-rw-r--r--src/lib/coreboot_table.c2
-rw-r--r--src/security/tpm/tspi.h24
-rw-r--r--src/security/tpm/tspi/crtm.c32
-rw-r--r--src/security/tpm/tspi/crtm.h2
-rw-r--r--src/security/tpm/tspi/log.c104
-rw-r--r--src/security/tpm/tspi/tspi.c3
-rw-r--r--src/soc/cavium/cn81xx/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8173/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8183/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8186/include/soc/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8188/include/soc/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8192/include/soc/memlayout.ld2
-rw-r--r--src/soc/mediatek/mt8195/include/soc/memlayout.ld2
-rw-r--r--src/soc/nvidia/tegra124/memlayout.ld2
-rw-r--r--src/soc/nvidia/tegra210/memlayout.ld2
-rw-r--r--src/soc/qualcomm/sc7180/memlayout.ld2
-rw-r--r--src/soc/samsung/exynos5250/memlayout.ld2
25 files changed, 135 insertions, 133 deletions
diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index 87e3dbc84930..e621dd45d2ca 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -20,9 +20,9 @@
VBOOT2_WORK(., 12K)
#endif
#if CONFIG(TPM_MEASURED_BOOT)
- /* Vboot measured boot TCPA log measurements.
+ /* Vboot measured boot TPM log measurements.
* Needs to be transferred until CBMEM is available */
- TPM_TCPA_LOG(., 2K)
+ TPM_LOG(., 2K)
#endif
/* Stack for CAR stages. Since it persists across all stages that
* use CAR it can be reused. The chipset/SoC is expected to provide
diff --git a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
index d0feb39af91e..89f88b770988 100644
--- a/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
+++ b/src/commonlib/bsd/include/commonlib/bsd/cbmem_id.h
@@ -60,7 +60,7 @@
#define CBMEM_ID_STAGEx_CACHE 0x57a9e100
#define CBMEM_ID_STAGEx_RAW 0x57a9e200
#define CBMEM_ID_STORAGE_DATA 0x53746f72
-#define CBMEM_ID_TCPA_LOG 0x54435041
+#define CBMEM_ID_TPM_CB_LOG 0x54435041
#define CBMEM_ID_TCPA_TCG_LOG 0x54445041
#define CBMEM_ID_TIMESTAMP 0x54494d45
#define CBMEM_ID_TPM2_TCG_LOG 0x54504d32
@@ -139,7 +139,7 @@
{ CBMEM_ID_SMBIOS, "SMBIOS " }, \
{ CBMEM_ID_SMM_SAVE_SPACE, "SMM BACKUP " }, \
{ CBMEM_ID_STORAGE_DATA, "SD/MMC/eMMC" }, \
- { CBMEM_ID_TCPA_LOG, "TCPA LOG " }, \
+ { CBMEM_ID_TPM_CB_LOG, "TPM CB LOG " }, \
{ CBMEM_ID_TCPA_TCG_LOG, "TCPA TCGLOG" }, \
{ CBMEM_ID_TIMESTAMP, "TIME STAMP " }, \
{ CBMEM_ID_TPM2_TCG_LOG, "TPM2 TCGLOG" }, \
diff --git a/src/commonlib/include/commonlib/coreboot_tables.h b/src/commonlib/include/commonlib/coreboot_tables.h
index 76dce0a41be1..86bf5438b7ca 100644
--- a/src/commonlib/include/commonlib/coreboot_tables.h
+++ b/src/commonlib/include/commonlib/coreboot_tables.h
@@ -77,7 +77,7 @@ enum {
LB_TAG_MAC_ADDRS = 0x0033,
LB_TAG_VBOOT_WORKBUF = 0x0034,
LB_TAG_MMC_INFO = 0x0035,
- LB_TAG_TCPA_LOG = 0x0036,
+ LB_TAG_TPM_CB_LOG = 0x0036,
LB_TAG_FMAP = 0x0037,
LB_TAG_PLATFORM_BLOB_VERSION = 0x0038,
LB_TAG_SMMSTOREV2 = 0x0039,
diff --git a/src/commonlib/include/commonlib/tcpa_log_serialized.h b/src/commonlib/include/commonlib/tcpa_log_serialized.h
deleted file mode 100644
index 4190a7db6479..000000000000
--- a/src/commonlib/include/commonlib/tcpa_log_serialized.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-
-#ifndef __TCPA_LOG_SERIALIZED_H__
-#define __TCPA_LOG_SERIALIZED_H__
-
-#include <stdint.h>
-
-#define MAX_TCPA_LOG_ENTRIES 50
-#define TCPA_DIGEST_MAX_LENGTH 64
-#define TCPA_PCR_HASH_NAME 50
-#define TCPA_PCR_HASH_LEN 10
-/* Assumption of 2K TCPA log size reserved for CAR/SRAM */
-#define MAX_PRERAM_TCPA_LOG_ENTRIES 15
-
-struct tcpa_entry {
- uint32_t pcr;
- char digest_type[TCPA_PCR_HASH_LEN];
- uint8_t digest[TCPA_DIGEST_MAX_LENGTH];
- uint32_t digest_length;
- char name[TCPA_PCR_HASH_NAME];
-} __packed;
-
-struct tcpa_table {
- uint16_t max_entries;
- uint16_t num_entries;
- struct tcpa_entry entries[0]; /* Variable number of entries */
-} __packed;
-
-#endif
diff --git a/src/commonlib/include/commonlib/tpm_log_serialized.h b/src/commonlib/include/commonlib/tpm_log_serialized.h
new file mode 100644
index 000000000000..dc58dc09c3ec
--- /dev/null
+++ b/src/commonlib/include/commonlib/tpm_log_serialized.h
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef COMMONLIB_TPM_LOG_SERIALIZED_H
+#define COMMONLIB_TPM_LOG_SERIALIZED_H
+
+#include <commonlib/bsd/helpers.h>
+#include <stdint.h>
+
+#define MAX_TPM_LOG_ENTRIES 50
+#define TPM_CB_LOG_DIGEST_MAX_LENGTH 64
+#define TPM_CB_LOG_PCR_HASH_NAME 50
+#define TPM_CB_LOG_PCR_HASH_LEN 10
+/* Assumption of 2K TCPA log size reserved for CAR/SRAM */
+#define MAX_PRERAM_TPM_LOG_ENTRIES 15
+
+struct tpm_cb_log_entry {
+ uint32_t pcr;
+ char digest_type[TPM_CB_LOG_PCR_HASH_LEN];
+ uint8_t digest[TPM_CB_LOG_DIGEST_MAX_LENGTH];
+ uint32_t digest_length;
+ char name[TPM_CB_LOG_PCR_HASH_NAME];
+} __packed;
+
+struct tpm_cb_log_table {
+ uint16_t max_entries;
+ uint16_t num_entries;
+ struct tpm_cb_log_entry entries[0]; /* Variable number of entries */
+} __packed;
+
+#endif
diff --git a/src/include/memlayout.h b/src/include/memlayout.h
index 7b6cfb62d9f0..0d84ec1481ca 100644
--- a/src/include/memlayout.h
+++ b/src/include/memlayout.h
@@ -168,9 +168,9 @@
STR(vboot2 work buffer size must be equivalent to \
VB2_FIRMWARE_WORKBUF_RECOMMENDED_SIZE! (sz)));
-#define TPM_TCPA_LOG(addr, size) \
- REGION(tpm_tcpa_log, addr, size, 16) \
- _ = ASSERT(size >= 2K, "tpm tcpa log buffer must be at least 2K!");
+#define TPM_LOG(addr, size) \
+ REGION(tpm_log, addr, size, 16) \
+ _ = ASSERT(size >= 2K, "tpm log buffer must be at least 2K!");
#if ENV_SEPARATE_VERSTAGE
#define VERSTAGE(addr, sz) \
diff --git a/src/include/symbols.h b/src/include/symbols.h
index ee7c5031fa84..a03af08463fd 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -37,7 +37,7 @@ DECLARE_OPTIONAL_REGION(postram_cbfs_cache)
DECLARE_OPTIONAL_REGION(cbfs_cache)
DECLARE_REGION(cbfs_mcache)
DECLARE_REGION(fmap_cache)
-DECLARE_REGION(tpm_tcpa_log)
+DECLARE_REGION(tpm_log)
#if ENV_ROMSTAGE && CONFIG(ASAN_IN_ROMSTAGE)
DECLARE_REGION(bss)
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c
index 0b2d66b33ac4..4e25d27cfb03 100644
--- a/src/lib/cbfs.c
+++ b/src/lib/cbfs.c
@@ -190,7 +190,7 @@ static bool cbfs_file_hash_mismatch(const void *buffer, size_t size,
if (!hash ||
tspi_cbfs_measurement(mdata->h.filename, be32toh(mdata->h.type), hash))
- ERROR("failed to measure '%s' into TCPA log\n", mdata->h.filename);
+ ERROR("failed to measure '%s' into TPM log\n", mdata->h.filename);
/* We intentionally continue to boot on measurement errors. */
}
diff --git a/src/lib/coreboot_table.c b/src/lib/coreboot_table.c
index eaf487ff4eff..0707fd3eca5e 100644
--- a/src/lib/coreboot_table.c
+++ b/src/lib/coreboot_table.c
@@ -267,7 +267,7 @@ static void add_cbmem_pointers(struct lb_header *header)
{CBMEM_ID_ACPI_CNVS, LB_TAG_ACPI_CNVS},
{CBMEM_ID_VPD, LB_TAG_VPD},
{CBMEM_ID_WIFI_CALIBRATION, LB_TAG_WIFI_CALIBRATION},
- {CBMEM_ID_TCPA_LOG, LB_TAG_TCPA_LOG},
+ {CBMEM_ID_TPM_CB_LOG, LB_TAG_TPM_CB_LOG},
{CBMEM_ID_FMAP, LB_TAG_FMAP},
{CBMEM_ID_VBOOT_WORKBUF, LB_TAG_VBOOT_WORKBUF},
{CBMEM_ID_TYPE_C_INFO, LB_TAG_TYPE_C_INFO},
diff --git a/src/security/tpm/tspi.h b/src/security/tpm/tspi.h
index 7157b4d7303e..aee38aa90298 100644
--- a/src/security/tpm/tspi.h
+++ b/src/security/tpm/tspi.h
@@ -4,7 +4,7 @@
#define TSPI_H_
#include <security/tpm/tss.h>
-#include <commonlib/tcpa_log_serialized.h>
+#include <commonlib/tpm_log_serialized.h>
#include <commonlib/region.h>
#include <vb2_api.h>
@@ -13,33 +13,33 @@
/**
* Get the pointer to the single instance of global
- * tcpa log data, and initialize it when necessary
+ * TPM log data, and initialize it when necessary
*/
-struct tcpa_table *tcpa_log_init(void);
+struct tpm_cb_log_table *tpm_log_init(void);
/**
- * Clears the pre-RAM tcpa log data and initializes
+ * Clears the pre-RAM TPM log data and initializes
* any content with default values
*/
-void tcpa_preram_log_clear(void);
+void tpm_preram_log_clear(void);
/**
- * Add table entry for cbmem TCPA log.
+ * Add table entry for cbmem TPM log.
* @param name Name of the hashed data
* @param pcr PCR used to extend hashed data
* @param diget_algo sets the digest algorithm
* @param digest sets the hash extended into the tpm
* @param digest_len the length of the digest
*/
-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);
+void tpm_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);
/**
- * Dump TCPA log entries on console
+ * Dump TPM log entries on console
*/
-void tcpa_log_dump(void *unused);
+void tpm_log_dump(void *unused);
/**
* Ask vboot for a digest and extend a TPM PCR with it.
diff --git a/src/security/tpm/tspi/crtm.c b/src/security/tpm/tspi/crtm.c
index 8eefc11a362d..6e4fadad2bd2 100644
--- a/src/security/tpm/tspi/crtm.c
+++ b/src/security/tpm/tspi/crtm.c
@@ -6,11 +6,11 @@
#include "crtm.h"
#include <string.h>
-static int tcpa_log_initialized;
-static inline int tcpa_log_available(void)
+static int tpm_log_initialized;
+static inline int tpm_log_available(void)
{
if (ENV_BOOTBLOCK)
- return tcpa_log_initialized;
+ return tpm_log_initialized;
return 1;
}
@@ -33,10 +33,10 @@ static inline int tcpa_log_available(void)
*/
static uint32_t tspi_init_crtm(void)
{
- /* Initialize TCPA PRERAM log. */
- if (!tcpa_log_available()) {
- tcpa_preram_log_clear();
- tcpa_log_initialized = 1;
+ /* Initialize TPM PRERAM log. */
+ if (!tpm_log_available()) {
+ tpm_preram_log_clear();
+ tpm_log_initialized = 1;
} else {
printk(BIOS_WARNING, "TSPI: CRTM already initialized!\n");
return VB2_SUCCESS;
@@ -109,9 +109,9 @@ static bool is_runtime_data(const char *name)
uint32_t tspi_cbfs_measurement(const char *name, uint32_t type, const struct vb2_hash *hash)
{
uint32_t pcr_index;
- char tcpa_metadata[TCPA_PCR_HASH_NAME];
+ char tpm_log_metadata[TPM_CB_LOG_PCR_HASH_NAME];
- if (!tcpa_log_available()) {
+ if (!tpm_log_available()) {
if (tspi_init_crtm() != VB2_SUCCESS) {
printk(BIOS_WARNING,
"Initializing CRTM failed!\n");
@@ -142,29 +142,29 @@ uint32_t tspi_cbfs_measurement(const char *name, uint32_t type, const struct vb2
break;
}
- snprintf(tcpa_metadata, TCPA_PCR_HASH_NAME, "CBFS: %s", name);
+ snprintf(tpm_log_metadata, TPM_CB_LOG_PCR_HASH_NAME, "CBFS: %s", name);
return tpm_extend_pcr(pcr_index, hash->algo, hash->raw, vb2_digest_size(hash->algo),
- tcpa_metadata);
+ tpm_log_metadata);
}
int tspi_measure_cache_to_pcr(void)
{
int i;
- struct tcpa_table *tclt = tcpa_log_init();
+ struct tpm_cb_log_table *tclt = tpm_log_init();
/* This means the table is empty. */
- if (!tcpa_log_available())
+ if (!tpm_log_available())
return VB2_SUCCESS;
if (!tclt) {
- printk(BIOS_WARNING, "TCPA: Log non-existent!\n");
+ printk(BIOS_WARNING, "TPM LOG: log non-existent!\n");
return VB2_ERROR_UNKNOWN;
}
- printk(BIOS_DEBUG, "TPM: Write digests cached in TCPA log to PCR\n");
+ printk(BIOS_DEBUG, "TPM: Write digests cached in TPM log to PCR\n");
for (i = 0; i < tclt->num_entries; i++) {
- struct tcpa_entry *tce = &tclt->entries[i];
+ struct tpm_cb_log_entry *tce = &tclt->entries[i];
if (tce) {
printk(BIOS_DEBUG, "TPM: Write digest for"
" %s into PCR %d\n",
diff --git a/src/security/tpm/tspi/crtm.h b/src/security/tpm/tspi/crtm.h
index e8e44fd74509..97ef09a9b720 100644
--- a/src/security/tpm/tspi/crtm.h
+++ b/src/security/tpm/tspi/crtm.h
@@ -31,7 +31,7 @@
#endif
/**
- * Measure digests cached in TCPA log entries into PCRs
+ * Measure digests cached in TPM log entries into PCRs
*/
int tspi_measure_cache_to_pcr(void);
diff --git a/src/security/tpm/tspi/log.c b/src/security/tpm/tspi/log.c
index 296cb2d10825..fa95b80e81fb 100644
--- a/src/security/tpm/tspi/log.c
+++ b/src/security/tpm/tspi/log.c
@@ -9,20 +9,20 @@
#include <bootstate.h>
#include <vb2_sha.h>
-static struct tcpa_table *tcpa_cbmem_init(void)
+static struct tpm_cb_log_table *tpm_log_cbmem_init(void)
{
- static struct tcpa_table *tclt;
+ static struct tpm_cb_log_table *tclt;
if (tclt)
return tclt;
if (cbmem_possibly_online()) {
- tclt = cbmem_find(CBMEM_ID_TCPA_LOG);
+ tclt = cbmem_find(CBMEM_ID_TPM_CB_LOG);
if (!tclt) {
- size_t tcpa_log_len = sizeof(struct tcpa_table) +
- MAX_TCPA_LOG_ENTRIES * sizeof(struct tcpa_entry);
- tclt = cbmem_add(CBMEM_ID_TCPA_LOG, tcpa_log_len);
+ size_t tpm_log_len = sizeof(struct tpm_cb_log_table) +
+ MAX_TPM_LOG_ENTRIES * sizeof(struct tpm_cb_log_entry);
+ tclt = cbmem_add(CBMEM_ID_TPM_CB_LOG, tpm_log_len);
if (tclt) {
- tclt->max_entries = MAX_TCPA_LOG_ENTRIES;
+ tclt->max_entries = MAX_TPM_LOG_ENTRIES;
tclt->num_entries = 0;
}
}
@@ -30,39 +30,39 @@ static struct tcpa_table *tcpa_cbmem_init(void)
return tclt;
}
-struct tcpa_table *tcpa_log_init(void)
+struct tpm_cb_log_table *tpm_log_init(void)
{
- static struct tcpa_table *tclt;
+ static struct tpm_cb_log_table *tclt;
/* We are dealing here with pre CBMEM environment.
* If cbmem isn't available use CAR or SRAM */
if (!cbmem_possibly_online() &&
!CONFIG(VBOOT_RETURN_FROM_VERSTAGE))
- return (struct tcpa_table *)_tpm_tcpa_log;
+ return (struct tpm_cb_log_table *)_tpm_log;
else if (ENV_CREATES_CBMEM
&& !CONFIG(VBOOT_RETURN_FROM_VERSTAGE)) {
- tclt = tcpa_cbmem_init();
+ tclt = tpm_log_cbmem_init();
if (!tclt)
- return (struct tcpa_table *)_tpm_tcpa_log;
+ return (struct tpm_cb_log_table *)_tpm_log;
} else {
- tclt = tcpa_cbmem_init();
+ tclt = tpm_log_cbmem_init();
}
return tclt;
}
-void tcpa_log_dump(void *unused)
+void tpm_log_dump(void *unused)
{
int i, j;
- struct tcpa_table *tclt;
+ struct tpm_cb_log_table *tclt;
- tclt = tcpa_log_init();
+ tclt = tpm_log_init();
if (!tclt)
return;
- printk(BIOS_INFO, "coreboot TCPA measurements:\n\n");
+ printk(BIOS_INFO, "coreboot TPM log measurements:\n\n");
for (i = 0; i < tclt->num_entries; i++) {
- struct tcpa_entry *tce = &tclt->entries[i];
+ struct tpm_cb_log_entry *tce = &tclt->entries[i];
if (tce) {
printk(BIOS_INFO, " PCR-%u ", tce->pcr);
@@ -76,85 +76,87 @@ void tcpa_log_dump(void *unused)
printk(BIOS_INFO, "\n");
}
-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)
+void tpm_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)
{
- struct tcpa_table *tclt = tcpa_log_init();
+ struct tpm_cb_log_table *tclt = tpm_log_init();
if (!tclt) {
- printk(BIOS_WARNING, "TCPA: Log non-existent!\n");
+ printk(BIOS_WARNING, "TPM LOG: Log non-existent!\n");
return;
}
if (tclt->num_entries >= tclt->max_entries) {
- printk(BIOS_WARNING, "TCPA: TCPA log table is full\n");
+ printk(BIOS_WARNING, "TPM LOG: log table is full\n");
return;
}
if (!name) {
- printk(BIOS_WARNING, "TCPA: TCPA entry name not set\n");
+ printk(BIOS_WARNING, "TPM LOG: entry name not set\n");
return;
}
- struct tcpa_entry *tce = &tclt->entries[tclt->num_entries++];
- strncpy(tce->name, name, TCPA_PCR_HASH_NAME - 1);
+ struct tpm_cb_log_entry *tce = &tclt->entries[tclt->num_entries++];
+ strncpy(tce->name, name, TPM_CB_LOG_PCR_HASH_NAME - 1);
tce->pcr = pcr;
- if (digest_len > TCPA_DIGEST_MAX_LENGTH) {
- printk(BIOS_WARNING, "TCPA: PCR digest too long for TCPA log entry\n");
+ if (digest_len > TPM_CB_LOG_DIGEST_MAX_LENGTH) {
+ printk(BIOS_WARNING, "TPM LOG: PCR digest too long for log entry\n");
return;
}
strncpy(tce->digest_type,
- vb2_get_hash_algorithm_name(digest_algo),
- TCPA_PCR_HASH_LEN - 1);
+ vb2_get_hash_algorithm_name(digest_algo),
+ TPM_CB_LOG_PCR_HASH_LEN - 1);
tce->digest_length = digest_len;
memcpy(tce->digest, digest, tce->digest_length);
}
-void tcpa_preram_log_clear(void)
+void tpm_preram_log_clear(void)
{
- printk(BIOS_INFO, "TCPA: Clearing coreboot TCPA log\n");
- struct tcpa_table *tclt = (struct tcpa_table *)_tpm_tcpa_log;
- tclt->max_entries = MAX_TCPA_LOG_ENTRIES;
+ printk(BIOS_INFO, "TPM LOG: clearing preram log\n");
+ struct tpm_cb_log_table *tclt = (struct tpm_cb_log_table *)_tpm_log;
+ tclt->max_entries = MAX_TPM_LOG_ENTRIES;
tclt->num_entries = 0;
}
#if !CONFIG(VBOOT_RETURN_FROM_VERSTAGE)
-static void recover_tcpa_log(int is_recovery)
+static void recover_tpm_log(int is_recovery)
{
- struct tcpa_table *preram_log = (struct tcpa_table *)_tpm_tcpa_log;
- struct tcpa_table *ram_log = NULL;
+ struct tpm_cb_log_table *preram_log = (struct tpm_cb_log_table *)_tpm_log;
+ struct tpm_cb_log_table *ram_log = NULL;
int i;
- if (preram_log->num_entries > MAX_PRERAM_TCPA_LOG_ENTRIES) {
- printk(BIOS_WARNING, "TCPA: Pre-RAM TCPA log is too full, possible corruption\n");
+ if (preram_log->num_entries > MAX_PRERAM_TPM_LOG_ENTRIES) {
+ printk(BIOS_WARNING, "TPM LOG: pre-RAM log is too full, possible corruption\n");
return;
}
- ram_log = tcpa_cbmem_init();
+ ram_log = tpm_log_cbmem_init();
if (!ram_log) {
- printk(BIOS_WARNING, "TCPA: CBMEM not available something went wrong\n");
+ printk(BIOS_WARNING, "TPM LOG: CBMEM not available something went wrong\n");
return;
}
for (i = 0; i < preram_log->num_entries; i++) {
- struct tcpa_entry *tce = &ram_log->entries[ram_log->num_entries++];
- strncpy(tce->name, preram_log->entries[i].name, TCPA_PCR_HASH_NAME - 1);
+ struct tpm_cb_log_entry *tce = &ram_log->entries[ram_log->num_entries++];
+ strncpy(tce->name, preram_log->entries[i].name, TPM_CB_LOG_PCR_HASH_NAME - 1);
tce->pcr = preram_log->entries[i].pcr;
- if (preram_log->entries[i].digest_length > TCPA_DIGEST_MAX_LENGTH) {
- printk(BIOS_WARNING, "TCPA: PCR digest too long for TCPA log entry\n");
+ if (preram_log->entries[i].digest_length > TPM_CB_LOG_DIGEST_MAX_LENGTH) {
+ printk(BIOS_WARNING, "TPM LOG: PCR digest too long for log entry\n");
return;
}
- strncpy(tce->digest_type, preram_log->entries[i].digest_type, TCPA_PCR_HASH_LEN - 1);
- tce->digest_length = MIN(preram_log->entries[i].digest_length, TCPA_DIGEST_MAX_LENGTH);
+ strncpy(tce->digest_type, preram_log->entries[i].digest_type,
+ TPM_CB_LOG_PCR_HASH_LEN - 1);
+ tce->digest_length = MIN(preram_log->entries[i].digest_length,
+ TPM_CB_LOG_DIGEST_MAX_LENGTH);
memcpy(tce->digest, preram_log->entries[i].digest, tce->digest_length);
}
}
-CBMEM_CREATION_HOOK(recover_tcpa_log);
+CBMEM_CREATION_HOOK(recover_tpm_log);
#endif
-BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, tcpa_log_dump, NULL);
+BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, tpm_log_dump, NULL);
diff --git a/src/security/tpm/tspi/tspi.c b/src/security/tpm/tspi/tspi.c
index 54ba343ce38b..3be98a2d864b 100644
--- a/src/security/tpm/tspi/tspi.c
+++ b/src/security/tpm/tspi/tspi.c
@@ -242,8 +242,7 @@ uint32_t tpm_extend_pcr(int pcr, enum vb2_hash_algorithm digest_algo,
}
if (CONFIG(TPM_MEASURED_BOOT))
- tcpa_log_add_table_entry(name, pcr, digest_algo,
- digest, digest_len);
+ tpm_log_add_table_entry(name, pcr, digest_algo, digest, digest_len);
printk(BIOS_DEBUG, "TPM: Digest of `%s` to PCR %d %s\n",
name, pcr, tspi_tpm_is_setup() ? "measured" : "logged");
diff --git a/src/soc/cavium/cn81xx/memlayout.ld b/src/soc/cavium/cn81xx/memlayout.ld
index 0257b23ae3c3..41f091415ec6 100644
--- a/src/soc/cavium/cn81xx/memlayout.ld
+++ b/src/soc/cavium/cn81xx/memlayout.ld
@@ -23,7 +23,7 @@ SECTIONS
BOOTBLOCK(BOOTROM_OFFSET + 0x20000, 56K)
CBFS_MCACHE(BOOTROM_OFFSET + 0x2e000, 8K)
VBOOT2_WORK(BOOTROM_OFFSET + 0x30000, 12K)
- TPM_TCPA_LOG(BOOTROM_OFFSET + 0x33000, 2K)
+ TPM_LOG(BOOTROM_OFFSET + 0x33000, 2K)
VERSTAGE(BOOTROM_OFFSET + 0x33800, 50K)
ROMSTAGE(BOOTROM_OFFSET + 0x40000, 256K)
diff --git a/src/soc/mediatek/mt8173/memlayout.ld b/src/soc/mediatek/mt8173/memlayout.ld
index 092cfdf2bf40..8dce4284de97 100644
--- a/src/soc/mediatek/mt8173/memlayout.ld
+++ b/src/soc/mediatek/mt8173/memlayout.ld
@@ -26,7 +26,7 @@ SECTIONS
SRAM_START(0x00100000)
VBOOT2_WORK(0x00100000, 12K)
- TPM_TCPA_LOG(0x00103000, 2K)
+ TPM_LOG(0x00103000, 2K)
FMAP_CACHE(0x00103800, 2K)
PRERAM_CBMEM_CONSOLE(0x00104000, 12K)
WATCHDOG_TOMBSTONE(0x00107000, 4)
diff --git a/src/soc/mediatek/mt8183/memlayout.ld b/src/soc/mediatek/mt8183/memlayout.ld
index 0acd174c84f7..390842693f51 100644
--- a/src/soc/mediatek/mt8183/memlayout.ld
+++ b/src/soc/mediatek/mt8183/memlayout.ld
@@ -23,7 +23,7 @@ SECTIONS
{
SRAM_START(0x00100000)
VBOOT2_WORK(0x00100000, 12K)
- TPM_TCPA_LOG(0x00103000, 2K)
+ TPM_LOG(0x00103000, 2K)
FMAP_CACHE(0x00103800, 2K)
WATCHDOG_TOMBSTONE(0x00104000, 4)
PRERAM_CBMEM_CONSOLE(0x00104004, 63K - 4)
diff --git a/src/soc/mediatek/mt8186/include/soc/memlayout.ld b/src/soc/mediatek/mt8186/include/soc/memlayout.ld
index 1764632f2913..f8bb0fa898eb 100644
--- a/src/soc/mediatek/mt8186/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8186/include/soc/memlayout.ld
@@ -31,7 +31,7 @@ SECTIONS
/* EMPTY(0x0010a804, 1K - 4) */
/* Regions that can also be moved to SRAM_L2C. */
TIMESTAMP(0x0010ac00, 1K)
- TPM_TCPA_LOG(0x0010b000, 2K)
+ TPM_LOG(0x0010b000, 2K)
FMAP_CACHE(0x0010b800, 2K)
CBFS_MCACHE(0x0010c000, 16K)
SRAM_END(0x00110000)
diff --git a/src/soc/mediatek/mt8188/include/soc/memlayout.ld b/src/soc/mediatek/mt8188/include/soc/memlayout.ld
index dc4090d74baa..8d1f2bde6509 100644
--- a/src/soc/mediatek/mt8188/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8188/include/soc/memlayout.ld
@@ -34,7 +34,7 @@ SECTIONS
CBFS_MCACHE(0x00120000, 16k)
VBOOT2_WORK(0x00124000, 12K)
FMAP_CACHE(0x00127000, 2k)
- TPM_TCPA_LOG(0x00127800, 2k)
+ TPM_LOG(0x00127800, 2k)
TIMESTAMP(0x00128000, 1k)
/* End of regions that can also be moved to SRAM_L2C. */
/* EMPTY(0x00128400, 31K) */
diff --git a/src/soc/mediatek/mt8192/include/soc/memlayout.ld b/src/soc/mediatek/mt8192/include/soc/memlayout.ld
index 150bfdde7884..6c238c7d8fc3 100644
--- a/src/soc/mediatek/mt8192/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8192/include/soc/memlayout.ld
@@ -23,7 +23,7 @@ SECTIONS
{
SRAM_START(0x00100000)
VBOOT2_WORK(0x00100000, 12K)
- TPM_TCPA_LOG(0x00103000, 2K)
+ TPM_LOG(0x00103000, 2K)
FMAP_CACHE(0x00103800, 2K)
WATCHDOG_TOMBSTONE(0x00104000, 4)
CBFS_MCACHE(0x00107c00, 8K)
diff --git a/src/soc/mediatek/mt8195/include/soc/memlayout.ld b/src/soc/mediatek/mt8195/include/soc/memlayout.ld
index d7f1bd804a64..322844ded534 100644
--- a/src/soc/mediatek/mt8195/include/soc/memlayout.ld
+++ b/src/soc/mediatek/mt8195/include/soc/memlayout.ld
@@ -26,7 +26,7 @@ SECTIONS
{
SRAM_START(0x00100000)
VBOOT2_WORK(0x00100000, 12K)
- TPM_TCPA_LOG(0x00103000, 2K)
+ TPM_LOG(0x00103000, 2K)
FMAP_CACHE(0x00103800, 2K)
WATCHDOG_TOMBSTONE(0x00104000, 4)
EARLY_INIT(0x00104010, 128)
diff --git a/src/soc/nvidia/tegra124/memlayout.ld b/src/soc/nvidia/tegra124/memlayout.ld
index 68c70c105455..ed386f1fdc7f 100644
--- a/src/soc/nvidia/tegra124/memlayout.ld
+++ b/src/soc/nvidia/tegra124/memlayout.ld
@@ -19,7 +19,7 @@ SECTIONS
CBFS_MCACHE(0x40006000, 8K)
PRERAM_CBFS_CACHE(0x40008000, 6K)
VBOOT2_WORK(0x40009800, 12K)
- TPM_TCPA_LOG(0x4000D800, 2K)
+ TPM_LOG(0x4000D800, 2K)
STACK(0x4000E000, 8K)
BOOTBLOCK(0x40010000, 32K)
VERSTAGE(0x40018000, 70K)
diff --git a/src/soc/nvidia/tegra210/memlayout.ld b/src/soc/nvidia/tegra210/memlayout.ld
index d9d7070bc6c9..55da1293d95b 100644
--- a/src/soc/nvidia/tegra210/memlayout.ld
+++ b/src/soc/nvidia/tegra210/memlayout.ld
@@ -19,7 +19,7 @@ SECTIONS
PRERAM_CBFS_CACHE(0x40001000, 20K)
CBFS_MCACHE(0x40006000, 8K)
VBOOT2_WORK(0x40008000, 12K)
- TPM_TCPA_LOG(0x4000B000, 2K)
+ TPM_LOG(0x4000B000, 2K)
#if ENV_ARM64
STACK(0x4000B800, 3K)
#else /* AVP gets a separate stack to avoid any chance of handoff races. */
diff --git a/src/soc/qualcomm/sc7180/memlayout.ld b/src/soc/qualcomm/sc7180/memlayout.ld
index 938f3e1e4222..e956c647ff56 100644
--- a/src/soc/qualcomm/sc7180/memlayout.ld
+++ b/src/soc/qualcomm/sc7180/memlayout.ld
@@ -32,7 +32,7 @@ SECTIONS
REGION(pbl_timestamps, 0x14800000, 83K, 4K)
WATCHDOG_TOMBSTONE(0x14814FFC, 4)
BOOTBLOCK(0x14815000, 48K)
- TPM_TCPA_LOG(0x14821000, 2K)
+ TPM_LOG(0x14821000, 2K)
PRERAM_CBFS_CACHE(0x14821800, 60K)
PRERAM_CBMEM_CONSOLE(0x14830800, 32K)
TIMESTAMP(0x14838800, 1K)
diff --git a/src/soc/samsung/exynos5250/memlayout.ld b/src/soc/samsung/exynos5250/memlayout.ld
index eec9f60a91fa..142a8924b063 100644
--- a/src/soc/samsung/exynos5250/memlayout.ld
+++ b/src/soc/samsung/exynos5250/memlayout.ld
@@ -21,7 +21,7 @@ SECTIONS
PRERAM_CBFS_CACHE(0x205C000, 68K)
CBFS_MCACHE(0x206D000, 8K)
FMAP_CACHE(0x206F000, 2K)
- TPM_TCPA_LOG(0x206F800, 2K)
+ TPM_LOG(0x206F800, 2K)
VBOOT2_WORK(0x2070000, 12K)
STACK(0x2074000, 16K)
SRAM_END(0x2078000)