heads/patches/coreboot-4.17/0003-x86-Zero-unused-part-of-SMBIOS-region.patch
Daniel Pineda 146b78e08c
patches/coreboot-4.17: Add Librem 4.17 patches
Add patches for coreboot 4.17:
- show ME status even when device is disable (kept from 4.15)
- zero unused part of SMBIOS region

Signed-off-by: Daniel Pineda <daniel.pineda@puri.sm>
2022-09-12 13:21:59 -06:00

35 lines
1.3 KiB
Diff

From 517c2ad54bfc44b984457ca30c34410487eb2be9 Mon Sep 17 00:00:00 2001
From: Jonathon Hall <jonathon.hall@puri.sm>
Date: Wed, 27 Jul 2022 09:45:40 -0400
Subject: [PATCH 3/3] x86: Zero unused part of SMBIOS region
Since SMBIOS was increased from 4K to 32K, the unused region could include
parts of the ACPI region from a prior boot, which may confuse the OS if it
finds remanent table signatures.
Change-Id: I0ebac7c70a6887c6d3380702d242618e86e84185
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
---
src/arch/x86/tables.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/arch/x86/tables.c b/src/arch/x86/tables.c
index 8d2f7b6f20..282dfc58a8 100644
--- a/src/arch/x86/tables.c
+++ b/src/arch/x86/tables.c
@@ -151,6 +151,11 @@ static unsigned long write_smbios_table(unsigned long rom_table_end)
new_high_table_pointer =
smbios_write_tables(high_table_pointer);
+ /* Clear the unused part of the region, in case other table
+ * signatures could be present from a prior boot
+ */
+ memset((void *)new_high_table_pointer, 0, high_table_pointer +
+ MAX_SMBIOS_SIZE - new_high_table_pointer);
rom_table_end = ALIGN_UP(rom_table_end, 16);
memcpy((void *)rom_table_end, (void *)high_table_pointer,
sizeof(struct smbios_entry));
--
2.25.1