public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 0/5] Print AGESA version at bootup
@ 2026-03-07 14:10 Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD)

The SMBIOS additional entries on AMD Zen4+ systems running an AGESA
based BIOS contain information about the AGESA version which can be
useful for matching the software stack when debugging an issue.

Add support for parsing this from SMBIOS tables and output it into
the logs at bootup.

v6:
 * Rebase on v7.0-rc2
 * Fixups for Boris' feedback in last patch

Mario Limonciello (AMD) (4):
  firmware: dmi: Correct an indexing error in dmi.h
  firmware: dmi: Adjust dmi_decode() to use enums
  firmware: dmi: Add missing DMI entry types
  firmware: dmi: Add pr_fmt() for dmi_scan.c

Yazen Ghannam (1):
  x86/CPU/AMD: Print AGESA string from DMI additional information entry

 arch/x86/kernel/cpu/amd.c   | 49 +++++++++++++++++++++++++++++++++++++
 drivers/firmware/dmi_scan.c | 34 +++++++++++++------------
 include/linux/dmi.h         | 23 +++++++++++++++++
 3 files changed, 91 insertions(+), 15 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h
  2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
@ 2026-03-07 14:10 ` Mario Limonciello (AMD)
  2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD)

The entries later in `enum dmi_entry_type` don't match the SMBIOS
specification.  The entry for type 33: `64-Bit Memory Error Information`
is not present and thus the index for all later entries is incorrect.

Add the missing type 33 entry.

Fixes: 93c890dbe5287 ("firmware: Add DMI entry types to the headers")
Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.4.0a.pdf
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
v3:
 * Rename to DMI_ENTRY_64_MEM_ERROR (Jean)
---
 include/linux/dmi.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 927f8a8b7a1dd..32b2529a73301 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -60,6 +60,7 @@ enum dmi_entry_type {
 	DMI_ENTRY_OOB_REMOTE_ACCESS,
 	DMI_ENTRY_BIS_ENTRY,
 	DMI_ENTRY_SYSTEM_BOOT,
+	DMI_ENTRY_64_MEM_ERROR,
 	DMI_ENTRY_MGMT_DEV,
 	DMI_ENTRY_MGMT_DEV_COMPONENT,
 	DMI_ENTRY_MGMT_DEV_THRES,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v6 2/5] firmware: dmi: Adjust dmi_decode() to use enums
  2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
@ 2026-03-07 14:10 ` Mario Limonciello (AMD)
  2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types Mario Limonciello (AMD)
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD),
	Jean Delvare

dmi_decode() has hardcoded values with comments for each DMI entry
type. The same information is already in dmi.h though, so drop the
comments and use the definitions instead.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
v3:
 * pick up tag (Jean)
---
 drivers/firmware/dmi_scan.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 70d39adf50dca..80aded4c778bc 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -484,14 +484,14 @@ static void __init dmi_memdev_walk(void)
 static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 {
 	switch (dm->type) {
-	case 0:		/* BIOS Information */
+	case DMI_ENTRY_BIOS:
 		dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
 		dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
 		dmi_save_ident(dm, DMI_BIOS_DATE, 8);
 		dmi_save_release(dm, DMI_BIOS_RELEASE, 21);
 		dmi_save_release(dm, DMI_EC_FIRMWARE_RELEASE, 23);
 		break;
-	case 1:		/* System Information */
+	case DMI_ENTRY_SYSTEM:
 		dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
 		dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
 		dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
@@ -500,33 +500,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 		dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
 		dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
 		break;
-	case 2:		/* Base Board Information */
+	case DMI_ENTRY_BASEBOARD:
 		dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
 		dmi_save_ident(dm, DMI_BOARD_NAME, 5);
 		dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
 		dmi_save_ident(dm, DMI_BOARD_SERIAL, 7);
 		dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8);
 		break;
-	case 3:		/* Chassis Information */
+	case DMI_ENTRY_CHASSIS:
 		dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4);
 		dmi_save_type(dm, DMI_CHASSIS_TYPE, 5);
 		dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6);
 		dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7);
 		dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8);
 		break;
-	case 9:		/* System Slots */
+	case DMI_ENTRY_SYSTEM_SLOT:
 		dmi_save_system_slot(dm);
 		break;
-	case 10:	/* Onboard Devices Information */
+	case DMI_ENTRY_ONBOARD_DEVICE:
 		dmi_save_devices(dm);
 		break;
-	case 11:	/* OEM Strings */
+	case DMI_ENTRY_OEMSTRINGS:
 		dmi_save_oem_strings_devices(dm);
 		break;
-	case 38:	/* IPMI Device Information */
+	case DMI_ENTRY_IPMI_DEV:
 		dmi_save_ipmi_device(dm);
 		break;
-	case 41:	/* Onboard Devices Extended Information */
+	case DMI_ENTRY_ONBOARD_DEV_EXT:
 		dmi_save_extended_devices(dm);
 	}
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types
  2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
@ 2026-03-07 14:10 ` Mario Limonciello (AMD)
  2026-04-01 11:03   ` Borislav Petkov
  2026-03-07 14:10 ` [PATCH v6 4/5] firmware: dmi: Add pr_fmt() for dmi_scan.c Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry Mario Limonciello (AMD)
  4 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD),
	Jean Delvare

Type 43 through type 46 entry types are missing from the
definitions in the dmi_entry_type enum.

Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.1.pdf
Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
v4:
 * Add tag (Yazen)
 * Correct text (Yazen)
v3:
 * Add tag (Jean)
---
 include/linux/dmi.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 32b2529a73301..2eedf44e68012 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -70,6 +70,10 @@ enum dmi_entry_type {
 	DMI_ENTRY_ADDITIONAL,
 	DMI_ENTRY_ONBOARD_DEV_EXT,
 	DMI_ENTRY_MGMT_CONTROLLER_HOST,
+	DMI_ENTRY_TPM_DEVICE,
+	DMI_ENTRY_PROCESSOR_ADDITIONAL,
+	DMI_ENTRY_FIRMWARE_INVENTORY,
+	DMI_ENTRY_STRING_PROPERTY,
 	DMI_ENTRY_INACTIVE = 126,
 	DMI_ENTRY_END_OF_TABLE = 127,
 };
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v6 4/5] firmware: dmi: Add pr_fmt() for dmi_scan.c
  2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
                   ` (2 preceding siblings ...)
  2026-03-07 14:10 ` [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types Mario Limonciello (AMD)
@ 2026-03-07 14:10 ` Mario Limonciello (AMD)
  2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
  2026-03-07 14:10 ` [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry Mario Limonciello (AMD)
  4 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD)

Several prints inconsistently use DMI: or dmi: or nothing.  To make
it clear which prints come from dmi_scan.c, add a pr_fmt macro.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
v4:
 * Adjust "DMI not present or invalid" message too (Yazen)
---
 drivers/firmware/dmi_scan.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 80aded4c778bc..ed6235ac576b6 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -1,4 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
+
+#define pr_fmt(fmt) "DMI: " fmt
+
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -634,7 +637,7 @@ static int __init dmi_present(const u8 *buf)
 					dmi_ver >> 16, (dmi_ver >> 8) & 0xFF);
 			}
 			dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string));
-			pr_info("DMI: %s\n", dmi_ids_string);
+			pr_info("%s\n", dmi_ids_string);
 			return 0;
 		}
 	}
@@ -663,7 +666,7 @@ static int __init dmi_smbios3_present(const u8 *buf)
 				dmi_ver >> 16, (dmi_ver >> 8) & 0xFF,
 				dmi_ver & 0xFF);
 			dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string));
-			pr_info("DMI: %s\n", dmi_ids_string);
+			pr_info("%s\n", dmi_ids_string);
 			return 0;
 		}
 	}
@@ -758,7 +761,7 @@ static void __init dmi_scan_machine(void)
 		dmi_early_unmap(p, 0x10000);
 	}
  error:
-	pr_info("DMI not present or invalid.\n");
+	pr_info("not present or invalid.\n");
 }
 
 static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(smbios_entry_point);
@@ -810,7 +813,7 @@ static int __init dmi_init(void)
 	kobject_del(tables_kobj);
 	kobject_put(tables_kobj);
  err:
-	pr_err("dmi: Firmware registration failed.\n");
+	pr_err("Firmware registration failed.\n");
 
 	return ret;
 }
@@ -831,7 +834,7 @@ void __init dmi_setup(void)
 		return;
 
 	dmi_memdev_walk();
-	pr_info("DMI: Memory slots populated: %d/%d\n",
+	pr_info("Memory slots populated: %d/%d\n",
 		dmi_memdev_populated_nr, dmi_memdev_nr);
 	dump_stack_set_arch_desc("%s", dmi_ids_string);
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
                   ` (3 preceding siblings ...)
  2026-03-07 14:10 ` [PATCH v6 4/5] firmware: dmi: Add pr_fmt() for dmi_scan.c Mario Limonciello (AMD)
@ 2026-03-07 14:10 ` Mario Limonciello (AMD)
  2026-04-01  9:17   ` Jean Delvare
  2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Yazen Ghannam
  4 siblings, 2 replies; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-03-07 14:10 UTC (permalink / raw)
  To: Yazen Ghannam, Jean Delvare
  Cc: linux-kernel, Borislav Petkov, Mario Limonciello (AMD)

From: Yazen Ghannam <yazen.ghannam@amd.com>

Type 40 entries (Additional Information) are summarized in section 7.41
as part of the SMBIOS specification.  Generally, these entries aren't
interesting to save.

However on some AMD Zen systems, the AGESA version is stored here. This
is useful to save to the kernel message logs for debugging. It can be
used to cross-reference issues.

Implement an iterator for the Additional Information entries. Use this
to find and print the AGESA string. Do so in AMD code, since the use
case is AMD-specific.

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Co-developed-by: "Mario Limonciello (AMD)" <superm1@kernel.org>
Signed-off-by: "Mario Limonciello (AMD)" <superm1@kernel.org>
---
v6:
 * rename print AGESA function (Boris)
 * check count explicitly
 * remove extra comments
 * Only print second half of string, look for full !V9 sentinel
v5:
 * Return "" in !CONFIG_DMI case (LKP robot, Yazen)
v4:
 * New patch (based upon older versions though)
---
 arch/x86/kernel/cpu/amd.c   | 49 +++++++++++++++++++++++++++++++++++++
 drivers/firmware/dmi_scan.c |  3 ++-
 include/linux/dmi.h         | 18 ++++++++++++++
 3 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 09de584e4c8fa..f4d1b4ee155b3 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <linux/export.h>
 #include <linux/bitops.h>
+#include <linux/dmi.h>
 #include <linux/elf.h>
 #include <linux/mm.h>
 #include <linux/kvm_types.h>
@@ -1380,3 +1381,51 @@ static __init int print_s5_reset_status_mmio(void)
 	return 0;
 }
 late_initcall(print_s5_reset_status_mmio);
+
+static void __init dmi_scan_additional(const struct dmi_header *d, void *p)
+{
+	struct dmi_a_info *info = (struct dmi_a_info *)d;
+	void *next, *end;
+
+	if (!IS_ENABLED(CONFIG_DMI))
+		return;
+
+	if (info->header.type != DMI_ENTRY_ADDITIONAL ||
+	    info->header.length < DMI_A_INFO_MIN_SIZE ||
+	    info->count < 1)
+		return;
+
+	next = (void *)(info + 1);
+	end  = (void *)info + info->header.length;
+
+	do {
+		struct dmi_a_info_entry *entry;
+		const char *string_ptr;
+
+		entry = (struct dmi_a_info_entry *)next;
+
+		/*
+		 * Not much can be done to validate data. At least the entry
+		 * length shouldn't be 0.
+		 */
+		if (!entry->length)
+			return;
+
+		string_ptr = dmi_string_nosave(&info->header, entry->str_num);
+
+		/* Sample string: AGESA!V9 StrixKrackanPI-FP8 1.1.0.0c */
+		if (!strncmp(string_ptr, "AGESA!V9", 8) && strlen(string_ptr) > 9) {
+			pr_info("AGESA: %s\n", string_ptr + 9);
+			break;
+		}
+
+		next += entry->length;
+	} while (end - next >= DMI_A_INFO_ENT_MIN_SIZE);
+}
+
+static __init int print_dmi_agesa(void)
+{
+	dmi_walk(dmi_scan_additional, NULL);
+	return 0;
+}
+late_initcall(print_dmi_agesa);
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index ed6235ac576b6..a3f7dabd49554 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -47,7 +47,7 @@ static struct dmi_memdev_info {
 static int dmi_memdev_nr;
 static int dmi_memdev_populated_nr __initdata;
 
-static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
+const char *dmi_string_nosave(const struct dmi_header *dm, u8 s)
 {
 	const u8 *bp = ((u8 *) dm) + dm->length;
 	const u8 *nsp;
@@ -66,6 +66,7 @@ static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
 
 	return dmi_empty_string;
 }
+EXPORT_SYMBOL_GPL(dmi_string_nosave);
 
 static const char * __init dmi_string(const struct dmi_header *dm, u8 s)
 {
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 2eedf44e68012..c8700e6a694d1 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -91,6 +91,21 @@ struct dmi_device {
 	void *device_data;	/* Type specific data */
 };
 
+#define DMI_A_INFO_ENT_MIN_SIZE 0x6
+struct dmi_a_info_entry {
+	u8 length;
+	u16 handle;
+	u8 offset;
+	u8 str_num;
+	u8 value[];
+} __packed;
+
+#define DMI_A_INFO_MIN_SIZE	0xB
+struct dmi_a_info {
+	struct dmi_header header;
+	u8 count;
+} __packed;
+
 #ifdef CONFIG_DMI
 
 struct dmi_dev_onboard {
@@ -120,6 +135,7 @@ extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
 extern u64 dmi_memdev_size(u16 handle);
 extern u8 dmi_memdev_type(u16 handle);
 extern u16 dmi_memdev_handle(int slot);
+const char *dmi_string_nosave(const struct dmi_header *dm, u8 s);
 
 #else
 
@@ -153,6 +169,8 @@ static inline u8 dmi_memdev_type(u16 handle) { return 0x0; }
 static inline u16 dmi_memdev_handle(int slot) { return 0xffff; }
 static inline const struct dmi_system_id *
 	dmi_first_match(const struct dmi_system_id *list) { return NULL; }
+static inline const char *
+	dmi_string_nosave(const struct dmi_header *dm, u8 s) { return ""; }
 
 #endif
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-03-07 14:10 ` [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry Mario Limonciello (AMD)
@ 2026-04-01  9:17   ` Jean Delvare
  2026-04-01 10:29     ` Borislav Petkov
  2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Yazen Ghannam
  1 sibling, 1 reply; 18+ messages in thread
From: Jean Delvare @ 2026-04-01  9:17 UTC (permalink / raw)
  To: Mario Limonciello (AMD); +Cc: Yazen Ghannam, linux-kernel, Borislav Petkov

On Sat,  7 Mar 2026 08:10:24 -0600, Mario Limonciello (AMD) wrote:
> From: Yazen Ghannam <yazen.ghannam@amd.com>
> 
> Type 40 entries (Additional Information) are summarized in section 7.41
> as part of the SMBIOS specification.  Generally, these entries aren't
> interesting to save.
> 
> However on some AMD Zen systems, the AGESA version is stored here. This
> is useful to save to the kernel message logs for debugging. It can be
> used to cross-reference issues.
> 
> Implement an iterator for the Additional Information entries. Use this
> to find and print the AGESA string. Do so in AMD code, since the use
> case is AMD-specific.
> 
> Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Co-developed-by: "Mario Limonciello (AMD)" <superm1@kernel.org>
> Signed-off-by: "Mario Limonciello (AMD)" <superm1@kernel.org>

Looks good to me.

Reviewed-by: Jean Delvare <jdelvare@suse.de>

I only have one question:

> (...)
> --- a/arch/x86/kernel/cpu/amd.c
> +++ b/arch/x86/kernel/cpu/amd.c
> (...)
> +static void __init dmi_scan_additional(const struct dmi_header *d, void *p)
> +{
> +	struct dmi_a_info *info = (struct dmi_a_info *)d;
> +	void *next, *end;
> +
> +	if (!IS_ENABLED(CONFIG_DMI))
> +		return;
> +
> +	if (info->header.type != DMI_ENTRY_ADDITIONAL ||
> +	    info->header.length < DMI_A_INFO_MIN_SIZE ||
> +	    info->count < 1)
> +		return;
> +
> +	next = (void *)(info + 1);
> +	end  = (void *)info + info->header.length;
> +
> +	do {
> +		struct dmi_a_info_entry *entry;
> +		const char *string_ptr;
> +
> +		entry = (struct dmi_a_info_entry *)next;
> +
> +		/*
> +		 * Not much can be done to validate data. At least the entry
> +		 * length shouldn't be 0.
> +		 */
> +		if (!entry->length)
> +			return;
> +
> +		string_ptr = dmi_string_nosave(&info->header, entry->str_num);
> +
> +		/* Sample string: AGESA!V9 StrixKrackanPI-FP8 1.1.0.0c */
> +		if (!strncmp(string_ptr, "AGESA!V9", 8) && strlen(string_ptr) > 9) {

Isn't "V9" going to become "V10" at some point in the future, and then
the AGESA string will no longer be displayed until the code is
adjusted? Or will AMD move the information to a more appropriate place
by then?

Also, I know this was discussed before, but the current print strategy
omits "V9". Is this not something we are going to regret once more
versions are available and we may have to differentiate between them?

> +			pr_info("AGESA: %s\n", string_ptr + 9);
> +			break;
> +		}
> +
> +		next += entry->length;
> +	} while (end - next >= DMI_A_INFO_ENT_MIN_SIZE);
> +}

-- 
Jean Delvare
SUSE L3 Support

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-04-01  9:17   ` Jean Delvare
@ 2026-04-01 10:29     ` Borislav Petkov
  2026-04-01 11:45       ` Borislav Petkov
  0 siblings, 1 reply; 18+ messages in thread
From: Borislav Petkov @ 2026-04-01 10:29 UTC (permalink / raw)
  To: Jean Delvare; +Cc: Mario Limonciello (AMD), Yazen Ghannam, linux-kernel

On Wed, Apr 01, 2026 at 11:17:01AM +0200, Jean Delvare wrote:
> Isn't "V9" going to become "V10" at some point in the future, and then
> the AGESA string will no longer be displayed until the code is
> adjusted? Or will AMD move the information to a more appropriate place
> by then?
> 
> Also, I know this was discussed before, but the current print strategy
> omits "V9". Is this not something we are going to regret once more
> versions are available and we may have to differentiate between them?

Right, I think we should not be silly and simply dump the string that starts
with "AGESA" and that's it.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types
  2026-03-07 14:10 ` [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types Mario Limonciello (AMD)
@ 2026-04-01 11:03   ` Borislav Petkov
  2026-04-01 13:16     ` Mario Limonciello (AMD)
  0 siblings, 1 reply; 18+ messages in thread
From: Borislav Petkov @ 2026-04-01 11:03 UTC (permalink / raw)
  To: Mario Limonciello (AMD)
  Cc: Yazen Ghannam, Jean Delvare, linux-kernel, Jean Delvare

On Sat, Mar 07, 2026 at 08:10:22AM -0600, Mario Limonciello (AMD) wrote:
> Type 43 through type 46 entry types are missing from the
> definitions in the dmi_entry_type enum.
> 
> Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.1.pdf
> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> v4:
>  * Add tag (Yazen)
>  * Correct text (Yazen)
> v3:
>  * Add tag (Jean)
> ---
>  include/linux/dmi.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/include/linux/dmi.h b/include/linux/dmi.h
> index 32b2529a73301..2eedf44e68012 100644
> --- a/include/linux/dmi.h
> +++ b/include/linux/dmi.h
> @@ -70,6 +70,10 @@ enum dmi_entry_type {
>  	DMI_ENTRY_ADDITIONAL,
>  	DMI_ENTRY_ONBOARD_DEV_EXT,
>  	DMI_ENTRY_MGMT_CONTROLLER_HOST,
> +	DMI_ENTRY_TPM_DEVICE,
> +	DMI_ENTRY_PROCESSOR_ADDITIONAL,
> +	DMI_ENTRY_FIRMWARE_INVENTORY,
> +	DMI_ENTRY_STRING_PROPERTY,
>  	DMI_ENTRY_INACTIVE = 126,
>  	DMI_ENTRY_END_OF_TABLE = 127,
>  };
> -- 

Is there any particular reason this is a separate patch and not part of patch
1?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-04-01 10:29     ` Borislav Petkov
@ 2026-04-01 11:45       ` Borislav Petkov
  2026-04-01 13:14         ` Mario Limonciello (AMD)
  0 siblings, 1 reply; 18+ messages in thread
From: Borislav Petkov @ 2026-04-01 11:45 UTC (permalink / raw)
  To: Jean Delvare, Mario Limonciello (AMD); +Cc: Yazen Ghannam, linux-kernel

On Wed, Apr 01, 2026 at 12:29:08PM +0200, Borislav Petkov wrote:
> On Wed, Apr 01, 2026 at 11:17:01AM +0200, Jean Delvare wrote:
> > Isn't "V9" going to become "V10" at some point in the future, and then
> > the AGESA string will no longer be displayed until the code is
> > adjusted? Or will AMD move the information to a more appropriate place
> > by then?
> > 
> > Also, I know this was discussed before, but the current print strategy
> > omits "V9". Is this not something we are going to regret once more
> > versions are available and we may have to differentiate between them?
> 
> Right, I think we should not be silly and simply dump the string that starts
> with "AGESA" and that's it.

IOW, this:

                if (!strncmp(string_ptr, "AGESA", 5)) {
                        pr_info("AGESA: %s\n", string_ptr);
                        break;
                }

Mario, what's that additional "dance" you're doing there? Do we have other
strings which start with "AGESA"?

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-04-01 11:45       ` Borislav Petkov
@ 2026-04-01 13:14         ` Mario Limonciello (AMD)
  2026-04-01 18:52           ` Borislav Petkov
  0 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-04-01 13:14 UTC (permalink / raw)
  To: Borislav Petkov, Jean Delvare; +Cc: Yazen Ghannam, linux-kernel

On 4/1/26 06:45, Borislav Petkov wrote:
> On Wed, Apr 01, 2026 at 12:29:08PM +0200, Borislav Petkov wrote:
>> On Wed, Apr 01, 2026 at 11:17:01AM +0200, Jean Delvare wrote:
>>> Isn't "V9" going to become "V10" at some point in the future, and then
>>> the AGESA string will no longer be displayed until the code is
>>> adjusted? Or will AMD move the information to a more appropriate place
>>> by then?
>>>
>>> Also, I know this was discussed before, but the current print strategy
>>> omits "V9". Is this not something we are going to regret once more
>>> versions are available and we may have to differentiate between them?
>>
>> Right, I think we should not be silly and simply dump the string that starts
>> with "AGESA" and that's it.
> 
> IOW, this:
> 
>                  if (!strncmp(string_ptr, "AGESA", 5)) {
>                          pr_info("AGESA: %s\n", string_ptr);
>                          break;
>                  }
> 
> Mario, what's that additional "dance" you're doing there? Do we have other
> strings which start with "AGESA"?
> 

Right we did talk about this a little on the last iteration too [1].
The string_ptr + 9 will fail if we ever had a V10.

Link: 
https://lore.kernel.org/all/20260126154037.GBaXeK9bxgPMdE2lFr@fat_crate.local/ 
[1]

If you guys would prefer to stick to the simple strncmp() + pr_info() 
the whole thing that's fine by me.

Do you want me to send out a new patch series, or will you just adjust 
while committing?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types
  2026-04-01 11:03   ` Borislav Petkov
@ 2026-04-01 13:16     ` Mario Limonciello (AMD)
  2026-04-01 18:49       ` Borislav Petkov
  0 siblings, 1 reply; 18+ messages in thread
From: Mario Limonciello (AMD) @ 2026-04-01 13:16 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: Yazen Ghannam, Jean Delvare, linux-kernel, Jean Delvare

On 4/1/26 06:03, Borislav Petkov wrote:
> On Sat, Mar 07, 2026 at 08:10:22AM -0600, Mario Limonciello (AMD) wrote:
>> Type 43 through type 46 entry types are missing from the
>> definitions in the dmi_entry_type enum.
>>
>> Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.7.1.pdf
>> Suggested-by: Yazen Ghannam <yazen.ghannam@amd.com>
>> Reviewed-by: Jean Delvare <jdelvare@suse.de>
>> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>> v4:
>>   * Add tag (Yazen)
>>   * Correct text (Yazen)
>> v3:
>>   * Add tag (Jean)
>> ---
>>   include/linux/dmi.h | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/include/linux/dmi.h b/include/linux/dmi.h
>> index 32b2529a73301..2eedf44e68012 100644
>> --- a/include/linux/dmi.h
>> +++ b/include/linux/dmi.h
>> @@ -70,6 +70,10 @@ enum dmi_entry_type {
>>   	DMI_ENTRY_ADDITIONAL,
>>   	DMI_ENTRY_ONBOARD_DEV_EXT,
>>   	DMI_ENTRY_MGMT_CONTROLLER_HOST,
>> +	DMI_ENTRY_TPM_DEVICE,
>> +	DMI_ENTRY_PROCESSOR_ADDITIONAL,
>> +	DMI_ENTRY_FIRMWARE_INVENTORY,
>> +	DMI_ENTRY_STRING_PROPERTY,
>>   	DMI_ENTRY_INACTIVE = 126,
>>   	DMI_ENTRY_END_OF_TABLE = 127,
>>   };
>> -- 
> 
> Is there any particular reason this is a separate patch and not part of patch
> 1?
> 

They are two separate logical problems (indexing error and missing 
entries).  I was trying to stick to one commit; one issue.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types
  2026-04-01 13:16     ` Mario Limonciello (AMD)
@ 2026-04-01 18:49       ` Borislav Petkov
  0 siblings, 0 replies; 18+ messages in thread
From: Borislav Petkov @ 2026-04-01 18:49 UTC (permalink / raw)
  To: Mario Limonciello (AMD)
  Cc: Yazen Ghannam, Jean Delvare, linux-kernel, Jean Delvare

On Wed, Apr 01, 2026 at 08:16:17AM -0500, Mario Limonciello (AMD) wrote:
> They are two separate logical problems (indexing error and missing entries).
> I was trying to stick to one commit; one issue.

Right, but they're touching the same place, both are very related and there
sometimes really is the thing about too many patches if you consider the
effort distros have to do each time they up-rev the kernel.

Long story short, I'll merge it into patch 1 - it is easier for everybody
involved.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-04-01 13:14         ` Mario Limonciello (AMD)
@ 2026-04-01 18:52           ` Borislav Petkov
  0 siblings, 0 replies; 18+ messages in thread
From: Borislav Petkov @ 2026-04-01 18:52 UTC (permalink / raw)
  To: Mario Limonciello (AMD); +Cc: Jean Delvare, Yazen Ghannam, linux-kernel

On Wed, Apr 01, 2026 at 08:14:22AM -0500, Mario Limonciello (AMD) wrote:
> If you guys would prefer to stick to the simple strncmp() + pr_info() the
> whole thing that's fine by me.
> 
> Do you want me to send out a new patch series, or will you just adjust while
> committing?

Nah, I'll fix up everything.

The idea is that it is very simple this way and also future-proof. We can
always change it if it *turns out* that it is needed but anticipating things
is not really necessary I'd say.

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [tip: x86/platform] x86/CPU/AMD: Print AGESA string from DMI additional information entry
  2026-03-07 14:10 ` [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry Mario Limonciello (AMD)
  2026-04-01  9:17   ` Jean Delvare
@ 2026-04-01 19:34   ` tip-bot2 for Yazen Ghannam
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot2 for Yazen Ghannam @ 2026-04-01 19:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Yazen Ghannam, Mario Limonciello (AMD), Borislav Petkov (AMD),
	Jean Delvare, x86, linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     bc91133e260c8113c1119073c03b93c12aa41738
Gitweb:        https://git.kernel.org/tip/bc91133e260c8113c1119073c03b93c12aa41738
Author:        Yazen Ghannam <yazen.ghannam@amd.com>
AuthorDate:    Sat, 07 Mar 2026 08:10:24 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 01 Apr 2026 20:54:16 +02:00

x86/CPU/AMD: Print AGESA string from DMI additional information entry

Type 40 entries (Additional Information) are summarized in section 7.41 as
part of the SMBIOS specification.  Generally, these entries aren't interesting
to save.

However on some AMD Zen systems, the AGESA version is stored here. This is
useful to save to the kernel message logs for debugging. It can be used to
cross-reference issues.

Implement an iterator for the Additional Information entries. Use this to find
and print the AGESA string. Do so in AMD code, since the use case is
AMD-specific.

  [ bp: Match only "AGESA". ]

Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com>
Co-developed-by: "Mario Limonciello (AMD)" <superm1@kernel.org>
Signed-off-by: "Mario Limonciello (AMD)" <superm1@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Link: https://patch.msgid.link/20260307141024.819807-6-superm1@kernel.org
---
 arch/x86/kernel/cpu/amd.c   | 49 ++++++++++++++++++++++++++++++++++++-
 drivers/firmware/dmi_scan.c |  3 +-
 include/linux/dmi.h         | 18 +++++++++++++-
 3 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 09de584..33b740c 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
 #include <linux/export.h>
 #include <linux/bitops.h>
+#include <linux/dmi.h>
 #include <linux/elf.h>
 #include <linux/mm.h>
 #include <linux/kvm_types.h>
@@ -1380,3 +1381,51 @@ static __init int print_s5_reset_status_mmio(void)
 	return 0;
 }
 late_initcall(print_s5_reset_status_mmio);
+
+static void __init dmi_scan_additional(const struct dmi_header *d, void *p)
+{
+	struct dmi_a_info *info = (struct dmi_a_info *)d;
+	void *next, *end;
+
+	if (!IS_ENABLED(CONFIG_DMI))
+		return;
+
+	if (info->header.type != DMI_ENTRY_ADDITIONAL ||
+	    info->header.length < DMI_A_INFO_MIN_SIZE ||
+	    info->count < 1)
+		return;
+
+	next = (void *)(info + 1);
+	end  = (void *)info + info->header.length;
+
+	do {
+		struct dmi_a_info_entry *entry;
+		const char *string_ptr;
+
+		entry = (struct dmi_a_info_entry *)next;
+
+		/*
+		 * Not much can be done to validate data. At least the entry
+		 * length shouldn't be 0.
+		 */
+		if (!entry->length)
+			return;
+
+		string_ptr = dmi_string_nosave(&info->header, entry->str_num);
+
+		/* Sample string: AGESA!V9 StrixKrackanPI-FP8 1.1.0.0c */
+		if (!strncmp(string_ptr, "AGESA", 5)) {
+			pr_info("AGESA: %s\n", string_ptr);
+			break;
+		}
+
+		next += entry->length;
+	} while (end - next >= DMI_A_INFO_ENT_MIN_SIZE);
+}
+
+static __init int print_dmi_agesa(void)
+{
+	dmi_walk(dmi_scan_additional, NULL);
+	return 0;
+}
+late_initcall(print_dmi_agesa);
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index ed6235a..a3f7dab 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -47,7 +47,7 @@ static struct dmi_memdev_info {
 static int dmi_memdev_nr;
 static int dmi_memdev_populated_nr __initdata;
 
-static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
+const char *dmi_string_nosave(const struct dmi_header *dm, u8 s)
 {
 	const u8 *bp = ((u8 *) dm) + dm->length;
 	const u8 *nsp;
@@ -66,6 +66,7 @@ static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
 
 	return dmi_empty_string;
 }
+EXPORT_SYMBOL_GPL(dmi_string_nosave);
 
 static const char * __init dmi_string(const struct dmi_header *dm, u8 s)
 {
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 2eedf44..c8700e6 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -91,6 +91,21 @@ struct dmi_device {
 	void *device_data;	/* Type specific data */
 };
 
+#define DMI_A_INFO_ENT_MIN_SIZE 0x6
+struct dmi_a_info_entry {
+	u8 length;
+	u16 handle;
+	u8 offset;
+	u8 str_num;
+	u8 value[];
+} __packed;
+
+#define DMI_A_INFO_MIN_SIZE	0xB
+struct dmi_a_info {
+	struct dmi_header header;
+	u8 count;
+} __packed;
+
 #ifdef CONFIG_DMI
 
 struct dmi_dev_onboard {
@@ -120,6 +135,7 @@ extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
 extern u64 dmi_memdev_size(u16 handle);
 extern u8 dmi_memdev_type(u16 handle);
 extern u16 dmi_memdev_handle(int slot);
+const char *dmi_string_nosave(const struct dmi_header *dm, u8 s);
 
 #else
 
@@ -153,6 +169,8 @@ static inline u8 dmi_memdev_type(u16 handle) { return 0x0; }
 static inline u16 dmi_memdev_handle(int slot) { return 0xffff; }
 static inline const struct dmi_system_id *
 	dmi_first_match(const struct dmi_system_id *list) { return NULL; }
+static inline const char *
+	dmi_string_nosave(const struct dmi_header *dm, u8 s) { return ""; }
 
 #endif
 

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [tip: x86/platform] firmware: dmi: Add pr_fmt() for dmi_scan.c
  2026-03-07 14:10 ` [PATCH v6 4/5] firmware: dmi: Add pr_fmt() for dmi_scan.c Mario Limonciello (AMD)
@ 2026-04-01 19:34   ` tip-bot2 for Mario Limonciello (AMD)
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot2 for Mario Limonciello (AMD) @ 2026-04-01 19:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mario Limonciello (AMD), Borislav Petkov (AMD), Jean Delvare, x86,
	linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     da55ebe166d71c8c6925c5cfd77fc74bed40aaef
Gitweb:        https://git.kernel.org/tip/da55ebe166d71c8c6925c5cfd77fc74bed40aaef
Author:        Mario Limonciello (AMD) <superm1@kernel.org>
AuthorDate:    Sat, 07 Mar 2026 08:10:23 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 01 Apr 2026 20:54:16 +02:00

firmware: dmi: Add pr_fmt() for dmi_scan.c

Several prints inconsistently use DMI: or dmi: or nothing.  To make it clear
which prints come from dmi_scan.c, add a pr_fmt() macro.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Link: https://patch.msgid.link/20260307141024.819807-5-superm1@kernel.org
---
 drivers/firmware/dmi_scan.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 80aded4..ed6235a 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -1,4 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-only
+
+#define pr_fmt(fmt) "DMI: " fmt
+
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/init.h>
@@ -634,7 +637,7 @@ static int __init dmi_present(const u8 *buf)
 					dmi_ver >> 16, (dmi_ver >> 8) & 0xFF);
 			}
 			dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string));
-			pr_info("DMI: %s\n", dmi_ids_string);
+			pr_info("%s\n", dmi_ids_string);
 			return 0;
 		}
 	}
@@ -663,7 +666,7 @@ static int __init dmi_smbios3_present(const u8 *buf)
 				dmi_ver >> 16, (dmi_ver >> 8) & 0xFF,
 				dmi_ver & 0xFF);
 			dmi_format_ids(dmi_ids_string, sizeof(dmi_ids_string));
-			pr_info("DMI: %s\n", dmi_ids_string);
+			pr_info("%s\n", dmi_ids_string);
 			return 0;
 		}
 	}
@@ -758,7 +761,7 @@ static void __init dmi_scan_machine(void)
 		dmi_early_unmap(p, 0x10000);
 	}
  error:
-	pr_info("DMI not present or invalid.\n");
+	pr_info("not present or invalid.\n");
 }
 
 static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(smbios_entry_point);
@@ -810,7 +813,7 @@ static int __init dmi_init(void)
 	kobject_del(tables_kobj);
 	kobject_put(tables_kobj);
  err:
-	pr_err("dmi: Firmware registration failed.\n");
+	pr_err("Firmware registration failed.\n");
 
 	return ret;
 }
@@ -831,7 +834,7 @@ void __init dmi_setup(void)
 		return;
 
 	dmi_memdev_walk();
-	pr_info("DMI: Memory slots populated: %d/%d\n",
+	pr_info("Memory slots populated: %d/%d\n",
 		dmi_memdev_populated_nr, dmi_memdev_nr);
 	dump_stack_set_arch_desc("%s", dmi_ids_string);
 }

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [tip: x86/platform] firmware: dmi: Adjust dmi_decode() to use enums
  2026-03-07 14:10 ` [PATCH v6 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
@ 2026-04-01 19:34   ` tip-bot2 for Mario Limonciello (AMD)
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot2 for Mario Limonciello (AMD) @ 2026-04-01 19:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mario Limonciello (AMD), Borislav Petkov (AMD), Jean Delvare,
	Yazen Ghannam, x86, linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     28189e95712b70008754c993ecd3531d1c7018d1
Gitweb:        https://git.kernel.org/tip/28189e95712b70008754c993ecd3531d1c7018d1
Author:        Mario Limonciello (AMD) <superm1@kernel.org>
AuthorDate:    Sat, 07 Mar 2026 08:10:21 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 01 Apr 2026 20:54:16 +02:00

firmware: dmi: Adjust dmi_decode() to use enums

dmi_decode() has hardcoded values with comments for each DMI entry type. The
same information is already in dmi.h though, so drop the comments and use the
definitions instead.

Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Link: https://patch.msgid.link/20260307141024.819807-3-superm1@kernel.org
---
 drivers/firmware/dmi_scan.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 70d39ad..80aded4 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -484,14 +484,14 @@ static void __init dmi_memdev_walk(void)
 static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 {
 	switch (dm->type) {
-	case 0:		/* BIOS Information */
+	case DMI_ENTRY_BIOS:
 		dmi_save_ident(dm, DMI_BIOS_VENDOR, 4);
 		dmi_save_ident(dm, DMI_BIOS_VERSION, 5);
 		dmi_save_ident(dm, DMI_BIOS_DATE, 8);
 		dmi_save_release(dm, DMI_BIOS_RELEASE, 21);
 		dmi_save_release(dm, DMI_EC_FIRMWARE_RELEASE, 23);
 		break;
-	case 1:		/* System Information */
+	case DMI_ENTRY_SYSTEM:
 		dmi_save_ident(dm, DMI_SYS_VENDOR, 4);
 		dmi_save_ident(dm, DMI_PRODUCT_NAME, 5);
 		dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
@@ -500,33 +500,33 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
 		dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
 		dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
 		break;
-	case 2:		/* Base Board Information */
+	case DMI_ENTRY_BASEBOARD:
 		dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
 		dmi_save_ident(dm, DMI_BOARD_NAME, 5);
 		dmi_save_ident(dm, DMI_BOARD_VERSION, 6);
 		dmi_save_ident(dm, DMI_BOARD_SERIAL, 7);
 		dmi_save_ident(dm, DMI_BOARD_ASSET_TAG, 8);
 		break;
-	case 3:		/* Chassis Information */
+	case DMI_ENTRY_CHASSIS:
 		dmi_save_ident(dm, DMI_CHASSIS_VENDOR, 4);
 		dmi_save_type(dm, DMI_CHASSIS_TYPE, 5);
 		dmi_save_ident(dm, DMI_CHASSIS_VERSION, 6);
 		dmi_save_ident(dm, DMI_CHASSIS_SERIAL, 7);
 		dmi_save_ident(dm, DMI_CHASSIS_ASSET_TAG, 8);
 		break;
-	case 9:		/* System Slots */
+	case DMI_ENTRY_SYSTEM_SLOT:
 		dmi_save_system_slot(dm);
 		break;
-	case 10:	/* Onboard Devices Information */
+	case DMI_ENTRY_ONBOARD_DEVICE:
 		dmi_save_devices(dm);
 		break;
-	case 11:	/* OEM Strings */
+	case DMI_ENTRY_OEMSTRINGS:
 		dmi_save_oem_strings_devices(dm);
 		break;
-	case 38:	/* IPMI Device Information */
+	case DMI_ENTRY_IPMI_DEV:
 		dmi_save_ipmi_device(dm);
 		break;
-	case 41:	/* Onboard Devices Extended Information */
+	case DMI_ENTRY_ONBOARD_DEV_EXT:
 		dmi_save_extended_devices(dm);
 	}
 }

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [tip: x86/platform] firmware: dmi: Correct an indexing error in dmi.h
  2026-03-07 14:10 ` [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
@ 2026-04-01 19:34   ` tip-bot2 for Mario Limonciello (AMD)
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot2 for Mario Limonciello (AMD) @ 2026-04-01 19:34 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Mario Limonciello (AMD), Borislav Petkov (AMD), Jean Delvare,
	Yazen Ghannam, x86, linux-kernel

The following commit has been merged into the x86/platform branch of tip:

Commit-ID:     c064abc68e009d2cc18416e7132d9c25e03125b6
Gitweb:        https://git.kernel.org/tip/c064abc68e009d2cc18416e7132d9c25e03125b6
Author:        Mario Limonciello (AMD) <superm1@kernel.org>
AuthorDate:    Sat, 07 Mar 2026 08:10:20 -06:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Wed, 01 Apr 2026 20:53:44 +02:00

firmware: dmi: Correct an indexing error in dmi.h

The entries later in enum dmi_entry_type don't match the SMBIOS
specification¹.

The entry for type 33: `64-Bit Memory Error Information` is not present and
thus the index for all later entries is incorrect.

Add it.

Also, add missing entry types 43-46, while at it.

  ¹ Search for "System Management BIOS (SMBIOS) Reference Specification"

  [ bp: Drop the flaky SMBIOS spec URL. ]

Fixes: 93c890dbe5287 ("firmware: Add DMI entry types to the headers")
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Link: https://patch.msgid.link/20260307141024.819807-2-superm1@kernel.org
---
 include/linux/dmi.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 927f8a8..2eedf44 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -60,6 +60,7 @@ enum dmi_entry_type {
 	DMI_ENTRY_OOB_REMOTE_ACCESS,
 	DMI_ENTRY_BIS_ENTRY,
 	DMI_ENTRY_SYSTEM_BOOT,
+	DMI_ENTRY_64_MEM_ERROR,
 	DMI_ENTRY_MGMT_DEV,
 	DMI_ENTRY_MGMT_DEV_COMPONENT,
 	DMI_ENTRY_MGMT_DEV_THRES,
@@ -69,6 +70,10 @@ enum dmi_entry_type {
 	DMI_ENTRY_ADDITIONAL,
 	DMI_ENTRY_ONBOARD_DEV_EXT,
 	DMI_ENTRY_MGMT_CONTROLLER_HOST,
+	DMI_ENTRY_TPM_DEVICE,
+	DMI_ENTRY_PROCESSOR_ADDITIONAL,
+	DMI_ENTRY_FIRMWARE_INVENTORY,
+	DMI_ENTRY_STRING_PROPERTY,
 	DMI_ENTRY_INACTIVE = 126,
 	DMI_ENTRY_END_OF_TABLE = 127,
 };

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2026-04-01 19:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07 14:10 [PATCH v6 0/5] Print AGESA version at bootup Mario Limonciello (AMD)
2026-03-07 14:10 ` [PATCH v6 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
2026-03-07 14:10 ` [PATCH v6 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
2026-03-07 14:10 ` [PATCH v6 3/5] firmware: dmi: Add missing DMI entry types Mario Limonciello (AMD)
2026-04-01 11:03   ` Borislav Petkov
2026-04-01 13:16     ` Mario Limonciello (AMD)
2026-04-01 18:49       ` Borislav Petkov
2026-03-07 14:10 ` [PATCH v6 4/5] firmware: dmi: Add pr_fmt() for dmi_scan.c Mario Limonciello (AMD)
2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Mario Limonciello (AMD)
2026-03-07 14:10 ` [PATCH v6 5/5] x86/CPU/AMD: Print AGESA string from DMI additional information entry Mario Limonciello (AMD)
2026-04-01  9:17   ` Jean Delvare
2026-04-01 10:29     ` Borislav Petkov
2026-04-01 11:45       ` Borislav Petkov
2026-04-01 13:14         ` Mario Limonciello (AMD)
2026-04-01 18:52           ` Borislav Petkov
2026-04-01 19:34   ` [tip: x86/platform] " tip-bot2 for Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox