Skip to content

Commit

Permalink
acpi: don't publish TPM logs if EDK payload is used
Browse files Browse the repository at this point in the history
EDK will publish its own version of the log after parsing and
importing coreboot's log discovered through CBMEM.

Publishing is done by appending a table, so coreboot must avoid
adding corresponding log tables to let OS find a more complete one
from EDK.

Change-Id: Iec92c2b5c426ee003e81996937862d81cb4ead24
Signed-off-by: Sergii Dmytruk <[email protected]>
  • Loading branch information
SergiiDmytruk committed Jun 12, 2024
1 parent a9d6a86 commit b0c8288
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/acpi/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ static void acpi_create_mcfg(acpi_header_t *header, void *unused)
header->length = current - (unsigned long)mcfg;
}

static bool should_publish_tpm_log(void)
{
/*
* EDK will publish its own version of the log after parsing and
* importing coreboot's log discovered through CBMEM.
*
* Publishing is done by appending a table, so coreboot must avoid
* adding corresponding log tables to let OS find a more complete one
* from EDK.
*/
return !CONFIG(PAYLOAD_EDK2) || CONFIG(EDK2_DISABLE_TPM);
}

static void *get_tcpa_log(u32 *size)
{
const struct cbmem_entry *ce;
Expand Down Expand Up @@ -207,7 +220,7 @@ static void *get_tcpa_log(u32 *size)

static void acpi_create_tcpa(acpi_header_t *header, void *unused)
{
if (tlcl_get_family() != TPM_1)
if (!should_publish_tpm_log() || tlcl_get_family() != TPM_1)
return;

acpi_tcpa_t *tcpa = (acpi_tcpa_t *)header;
Expand Down Expand Up @@ -253,7 +266,7 @@ static void *get_tpm2_log(u32 *size)

static void acpi_create_tpm2(acpi_header_t *header, void *unused)
{
if (tlcl_get_family() != TPM_2)
if (!should_publish_tpm_log() || tlcl_get_family() != TPM_2)
return;

acpi_tpm2_t *tpm2 = (acpi_tpm2_t *)header;
Expand Down

0 comments on commit b0c8288

Please sign in to comment.