efi_loader: migrate SMBIOS 3.0 entry point structure for measurement

Current U-Boot only supports the SMBIOS 3.0 entry point structure.
TCG2 measurement code should migrate to SMBIOS 3.0 entry
point structure.

efi_selftest tcg2 test also needs to be updated, and expected
PCR[1] result is changed since guid for SMBIOS EFI system table
uses different guid SMBIOS3_TABLE_GUID instead of SMBIOS_TABLE_GUID.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Masahisa Kojima
2024-01-26 09:53:42 +09:00
committed by Heinrich Schuchardt
parent d4f721bc14
commit 2497f6a84c
5 changed files with 66 additions and 64 deletions

View File

@@ -223,21 +223,24 @@ static void clear_smbios_table(struct smbios_header *header,
}
}
void smbios_prepare_measurement(const struct smbios_entry *entry,
void smbios_prepare_measurement(const struct smbios3_entry *entry,
struct smbios_header *smbios_copy)
{
u32 i, j;
void *table_end;
struct smbios_header *header;
table_end = (void *)((u8 *)smbios_copy + entry->max_struct_size);
for (i = 0; i < ARRAY_SIZE(smbios_filter_tables); i++) {
header = smbios_copy;
for (j = 0; j < entry->struct_count; j++) {
for (j = 0; (void *)header < table_end; j++) {
if (header->type == smbios_filter_tables[i].type)
break;
header = get_next_header(header);
}
if (j >= entry->struct_count)
if ((void *)header >= table_end)
continue;
clear_smbios_table(header,