From 52c62acc349a0ec1ba26ae497913ad34ee3de733 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Tue, 2 Jan 2024 00:11:44 +0100 Subject: x86: all firmware tables must be paragraph aligned On qemu-x86_64_defconfig the following was observed: => efidebug tables 00000000000f0074 eb9d2d31-2d88-11d3-9a16-0090273fc14d SMBIOS table The SMBIOS configuration table does not point to a paragraph-aligned (16 byte aligned) address. The reason is that in write_tables() rom_addr is not aligned and copied to gd->arch.smbios_start. The Simple Firmware Interface requires that the SFI table is paragraph- aligned but our code does not guarantee this. As all tables written in write_tables() must be paragraph-aligned, we should implement the address rounding in write_tables() and not in table specific routines like copy_pirq_routing_table(). Add paragraph-alignment in write_tables(). Signed-off-by: Heinrich Schuchardt Reviewed-by: Simon Glass --- arch/x86/lib/tables.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch') diff --git a/arch/x86/lib/tables.c b/arch/x86/lib/tables.c index 12eae17c396..1095dc92c5a 100644 --- a/arch/x86/lib/tables.c +++ b/arch/x86/lib/tables.c @@ -98,6 +98,8 @@ int write_tables(void) int size = table->size ? : CONFIG_ROM_TABLE_SIZE; u32 rom_table_end; + rom_addr = ALIGN(rom_addr, 16); + if (!strcmp("smbios", table->name)) gd->arch.smbios_start = rom_addr; -- cgit v1.2.3