Skip to content

Commit aac7bc9

Browse files
committed
acpi: don't publish TPM logs if EDK payload is used
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 <sergii.dmytruk@3mdeb.com>
1 parent 199f536 commit aac7bc9

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

src/acpi/acpi.c

+15-2
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,19 @@ static void acpi_create_mcfg(acpi_header_t *header, void *unused)
180180
header->length = current - (unsigned long)mcfg;
181181
}
182182

183+
static bool should_publish_tpm_log(void)
184+
{
185+
/*
186+
* EDK will publish its own version of the log after parsing and
187+
* importing coreboot's log discovered through CBMEM.
188+
*
189+
* Publishing is done by appending a table, so coreboot must avoid
190+
* adding corresponding log tables to let OS find a more complete one
191+
* from EDK.
192+
*/
193+
return !CONFIG(PAYLOAD_EDK2) || CONFIG(EDK2_DISABLE_TPM);
194+
}
195+
183196
static void *get_tcpa_log(u32 *size)
184197
{
185198
const struct cbmem_entry *ce;
@@ -207,7 +220,7 @@ static void *get_tcpa_log(u32 *size)
207220

208221
static void acpi_create_tcpa(acpi_header_t *header, void *unused)
209222
{
210-
if (tlcl_get_family() != TPM_1)
223+
if (!should_publish_tpm_log() || tlcl_get_family() != TPM_1)
211224
return;
212225

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

254267
static void acpi_create_tpm2(acpi_header_t *header, void *unused)
255268
{
256-
if (tlcl_get_family() != TPM_2)
269+
if (!should_publish_tpm_log() || tlcl_get_family() != TPM_2)
257270
return;
258271

259272
acpi_tpm2_t *tpm2 = (acpi_tpm2_t *)header;

0 commit comments

Comments
 (0)