* [PATCH 0/5] Parse SMBIOS additional entries
@ 2025-12-14 18:53 Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, 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. Additionally export the information to debugfs
in case users are interested in any other strings.
Mario Limonciello (AMD) (5):
firmware: dmi: Correct an indexing error in dmi.h
firmware: dmi: Adjust dmi_decode() to use enums
firmware: dmi: Read additional information when decoding DMI table
firmware: dmi: Add debugfs for additional information entries
x86/amd_node: Output the AGESA version to the logs
arch/x86/kernel/amd_node.c | 8 +++
drivers/firmware/dmi_scan.c | 100 ++++++++++++++++++++++++++++++++----
include/linux/dmi.h | 8 +++
3 files changed, 105 insertions(+), 11 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
@ 2025-12-14 18:53 ` Mario Limonciello (AMD)
2025-12-15 21:11 ` Yazen Ghannam
2025-12-14 18:53 ` [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
` (3 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, 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
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
include/linux/dmi.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 927f8a8b7a1dd..a809b5095c259 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_MEMORY_INFO,
DMI_ENTRY_MGMT_DEV,
DMI_ENTRY_MGMT_DEV_COMPONENT,
DMI_ENTRY_MGMT_DEV_THRES,
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
@ 2025-12-14 18:53 ` Mario Limonciello (AMD)
2025-12-15 21:12 ` Yazen Ghannam
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
` (2 subsequent siblings)
4 siblings, 1 reply; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, Mario Limonciello (AMD)
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>
---
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] 14+ messages in thread
* [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
@ 2025-12-14 18:53 ` Mario Limonciello (AMD)
2025-12-15 4:31 ` kernel test robot
` (2 more replies)
2025-12-14 18:53 ` [PATCH 4/5] firmware: dmi: Add debugfs for additional information entries Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs Mario Limonciello (AMD)
4 siblings, 3 replies; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, Mario Limonciello (AMD)
Type 40 entries (Additional information) are summarized in section
7.41 as part of the SMBIOS specification. Save these entries when
decoding the DMI tables.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
drivers/firmware/dmi_scan.c | 46 +++++++++++++++++++++++++++++++++++++
include/linux/dmi.h | 7 ++++++
2 files changed, 53 insertions(+)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 80aded4c778bc..f7b7ed1d872e8 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -393,6 +393,48 @@ static void __init dmi_save_dev_pciaddr(int instance, int segment, int bus,
list_add(&dev->dev.list, &dmi_devices);
}
+static void __init dmi_save_additional(const struct dmi_additional_info *info)
+{
+ const char *strings;
+ const u8 *data;
+ int count = 0;
+ int i;
+
+ if (!info || info->header.length < 5 + info->count * 5)
+ return;
+
+ data = info->entries;
+ strings = (const char *)(data + info->count * 5);
+
+ for (i = 0; i < info->count; i++) {
+ u8 entry_length = data[i * 5];
+ u8 string_num = data[i * 5 + 4];
+ const char *string_ptr;
+ char *value;
+ int len;
+
+ if (entry_length < 5 || string_num == 0)
+ continue;
+
+ string_ptr = dmi_string_nosave(&info->header, string_num);
+ if (!string_ptr || !*string_ptr)
+ continue;
+
+ len = strlen(string_ptr);
+ if (len == 0)
+ continue;
+
+ value = dmi_alloc(len + 1);
+ if (!value)
+ continue;
+
+ strscpy(value, string_ptr, len + 1);
+
+ dmi_save_one_device(DMI_DEV_TYPE_ADDITIONAL, value);
+ count++;
+ }
+}
+
static void __init dmi_save_extended_devices(const struct dmi_header *dm)
{
const char *name;
@@ -526,8 +568,12 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy)
case DMI_ENTRY_IPMI_DEV:
dmi_save_ipmi_device(dm);
break;
+ case DMI_ENTRY_ADDITIONAL:
+ dmi_save_additional((const struct dmi_additional_info *)dm);
+ break;
case DMI_ENTRY_ONBOARD_DEV_EXT:
dmi_save_extended_devices(dm);
+ break;
}
}
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index a809b5095c259..3fc3d334b321d 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -24,6 +24,7 @@ enum dmi_device_type {
DMI_DEV_TYPE_OEM_STRING = -2,
DMI_DEV_TYPE_DEV_ONBOARD = -3,
DMI_DEV_TYPE_DEV_SLOT = -4,
+ DMI_DEV_TYPE_ADDITIONAL = -5,
};
enum dmi_entry_type {
@@ -87,6 +88,12 @@ struct dmi_device {
void *device_data; /* Type specific data */
};
+struct dmi_additional_info {
+ struct dmi_header header;
+ u8 count;
+ u8 entries[];
+} __packed;
+
#ifdef CONFIG_DMI
struct dmi_dev_onboard {
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/5] firmware: dmi: Add debugfs for additional information entries
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
` (2 preceding siblings ...)
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
@ 2025-12-14 18:53 ` Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs Mario Limonciello (AMD)
4 siblings, 0 replies; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, Mario Limonciello (AMD)
Additional information entries are not exposed through standardized
information from sysfs, but can still contain valuable information.
For example on AMD systems this encodes the AGESA version. Introduce
a debugfs file that will export this information.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
drivers/firmware/dmi_scan.c | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index f7b7ed1d872e8..52ed2a6b1c1d4 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -4,6 +4,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ctype.h>
+#include <linux/debugfs.h>
#include <linux/dmi.h>
#include <linux/efi.h>
#include <linux/memblock.h>
@@ -30,6 +31,7 @@ static u32 dmi_len;
static u16 dmi_num;
static u8 smbios_entry_point[32];
static int smbios_entry_point_size;
+static struct dentry *debugfs_dir;
/* DMI system identification string used during boot */
static char dmi_ids_string[128] __initdata;
@@ -180,6 +182,17 @@ static LIST_HEAD(dmi_devices);
int dmi_available;
EXPORT_SYMBOL_GPL(dmi_available);
+static int additional_show(struct seq_file *m, void *v)
+{
+ const struct dmi_device *dev = NULL;
+
+ while ((dev = dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, dev)))
+ seq_printf(m, "%s\n", dev->name);
+
+ return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(additional);
+
/*
* Save a DMI string
*/
@@ -810,6 +823,20 @@ static void __init dmi_scan_machine(void)
static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(smbios_entry_point);
static __ro_after_init BIN_ATTR_SIMPLE_ADMIN_RO(DMI);
+static void __init dmi_create_debugfs(void)
+{
+ if (!arch_debugfs_dir)
+ return;
+ debugfs_dir = debugfs_create_dir("dmi", arch_debugfs_dir);
+ if (!debugfs_dir)
+ return;
+ if (!dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, NULL))
+ return;
+ debugfs_create_file("additional", 0444,
+ debugfs_dir, NULL,
+ &additional_fops);
+}
+
static int __init dmi_init(void)
{
struct kobject *tables_kobj;
@@ -845,9 +872,14 @@ static int __init dmi_init(void)
bin_attr_DMI.size = dmi_len;
bin_attr_DMI.private = dmi_table;
ret = sysfs_create_bin_file(tables_kobj, &bin_attr_DMI);
- if (!ret)
- return 0;
+ if (ret)
+ goto err_sysfs;
+
+ dmi_create_debugfs();
+
+ return 0;
+ err_sysfs:
sysfs_remove_bin_file(tables_kobj,
&bin_attr_smbios_entry_point);
err_unmap:
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
` (3 preceding siblings ...)
2025-12-14 18:53 ` [PATCH 4/5] firmware: dmi: Add debugfs for additional information entries Mario Limonciello (AMD)
@ 2025-12-14 18:53 ` Mario Limonciello (AMD)
2025-12-15 21:23 ` Yazen Ghannam
4 siblings, 1 reply; 14+ messages in thread
From: Mario Limonciello (AMD) @ 2025-12-14 18:53 UTC (permalink / raw)
To: Yazen Ghannam, maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
Jean Delvare
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel, Mario Limonciello (AMD)
On AMD Zen platforms that are running AGESA, there is sometimes
DMI additional string for the AGESA version that can be helpful when
debugging an issue. If this string is found output to kernel logs.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
This is not strictly AMD node related; it was a proxy for a good location
for the message late enough on boot and only run on AMD Zen machines.
I'm open to other suggestions.
arch/x86/Kconfig | 1 +
arch/x86/kernel/amd_node.c | 8 ++++++++
2 files changed, 9 insertions(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 80527299f859a..eae139a91fb84 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -3116,6 +3116,7 @@ config AMD_NB
config AMD_NODE
def_bool y
depends on CPU_SUP_AMD && PCI
+ select DMI
endmenu
diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index 3d0a4768d603c..575d727c5827e 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -9,6 +9,7 @@
*/
#include <linux/debugfs.h>
+#include <linux/dmi.h>
#include <asm/amd/node.h>
/*
@@ -247,6 +248,7 @@ __setup("amd_smn_debugfs_enable", amd_smn_enable_dfs);
static int __init amd_smn_init(void)
{
u16 count, num_roots, roots_per_node, node, num_nodes;
+ const struct dmi_device *dev = NULL;
struct pci_dev *root;
if (!cpu_feature_enabled(X86_FEATURE_ZEN))
@@ -310,6 +312,12 @@ static int __init amd_smn_init(void)
smn_exclusive = true;
+ while ((dev = dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, dev)))
+ if (!strncmp(dev->name, "AGESA", 5)) {
+ pr_info("%s\n", dev->name);
+ break;
+ }
+
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
@ 2025-12-15 4:31 ` kernel test robot
2025-12-15 5:06 ` kernel test robot
2025-12-15 12:47 ` kernel test robot
2 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-12-15 4:31 UTC (permalink / raw)
To: Mario Limonciello (AMD), Yazen Ghannam,
(maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Jean Delvare
Cc: oe-kbuild-all, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H . Peter Anvin, linux-kernel,
Mario Limonciello (AMD)
Hi Mario,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/master]
[also build test WARNING on linus/master tip/auto-latest v6.19-rc1 next-20251215]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello-AMD/firmware-dmi-Correct-an-indexing-error-in-dmi-h/20251215-025606
base: tip/master
patch link: https://lore.kernel.org/r/20251214185309.152614-4-superm1%40kernel.org
patch subject: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
config: i386-allnoconfig (https://download.01.org/0day-ci/archive/20251215/202512151248.aV3iuNkX-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251215/202512151248.aV3iuNkX-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512151248.aV3iuNkX-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/firmware/dmi_scan.c: In function 'dmi_save_additional':
>> drivers/firmware/dmi_scan.c:398:21: warning: variable 'strings' set but not used [-Wunused-but-set-variable]
398 | const char *strings;
| ^~~~~~~
vim +/strings +398 drivers/firmware/dmi_scan.c
395
396 static void __init dmi_save_additional(const struct dmi_additional_info *info)
397 {
> 398 const char *strings;
399 const u8 *data;
400 int count = 0;
401 int i;
402
403 if (!info || info->header.length < 5 + info->count * 5)
404 return;
405
406 data = info->entries;
407 strings = (const char *)(data + info->count * 5);
408
409 for (i = 0; i < info->count; i++) {
410 u8 entry_length = data[i * 5];
411 u8 string_num = data[i * 5 + 4];
412 const char *string_ptr;
413 char *value;
414 int len;
415
416 if (entry_length < 5 || string_num == 0)
417 continue;
418
419 string_ptr = dmi_string_nosave(&info->header, string_num);
420 if (!string_ptr || !*string_ptr)
421 continue;
422
423 len = strlen(string_ptr);
424 if (len == 0)
425 continue;
426
427 value = dmi_alloc(len + 1);
428 if (!value)
429 continue;
430
431 strscpy(value, string_ptr, len + 1);
432
433 dmi_save_one_device(DMI_DEV_TYPE_ADDITIONAL, value);
434 count++;
435 }
436 }
437
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
2025-12-15 4:31 ` kernel test robot
@ 2025-12-15 5:06 ` kernel test robot
2025-12-15 12:47 ` kernel test robot
2 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-12-15 5:06 UTC (permalink / raw)
To: Mario Limonciello (AMD), Yazen Ghannam,
(maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Jean Delvare
Cc: llvm, oe-kbuild-all, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H . Peter Anvin, linux-kernel,
Mario Limonciello (AMD)
Hi Mario,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/master]
[also build test WARNING on linus/master tip/auto-latest v6.19-rc1 next-20251215]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello-AMD/firmware-dmi-Correct-an-indexing-error-in-dmi-h/20251215-025606
base: tip/master
patch link: https://lore.kernel.org/r/20251214185309.152614-4-superm1%40kernel.org
patch subject: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
config: x86_64-allnoconfig (https://download.01.org/0day-ci/archive/20251215/202512151555.bDb36bV2-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251215/202512151555.bDb36bV2-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512151555.bDb36bV2-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/firmware/dmi_scan.c:398:14: warning: variable 'strings' set but not used [-Wunused-but-set-variable]
398 | const char *strings;
| ^
>> drivers/firmware/dmi_scan.c:400:6: warning: variable 'count' set but not used [-Wunused-but-set-variable]
400 | int count = 0;
| ^
2 warnings generated.
vim +/count +400 drivers/firmware/dmi_scan.c
395
396 static void __init dmi_save_additional(const struct dmi_additional_info *info)
397 {
398 const char *strings;
399 const u8 *data;
> 400 int count = 0;
401 int i;
402
403 if (!info || info->header.length < 5 + info->count * 5)
404 return;
405
406 data = info->entries;
407 strings = (const char *)(data + info->count * 5);
408
409 for (i = 0; i < info->count; i++) {
410 u8 entry_length = data[i * 5];
411 u8 string_num = data[i * 5 + 4];
412 const char *string_ptr;
413 char *value;
414 int len;
415
416 if (entry_length < 5 || string_num == 0)
417 continue;
418
419 string_ptr = dmi_string_nosave(&info->header, string_num);
420 if (!string_ptr || !*string_ptr)
421 continue;
422
423 len = strlen(string_ptr);
424 if (len == 0)
425 continue;
426
427 value = dmi_alloc(len + 1);
428 if (!value)
429 continue;
430
431 strscpy(value, string_ptr, len + 1);
432
433 dmi_save_one_device(DMI_DEV_TYPE_ADDITIONAL, value);
434 count++;
435 }
436 }
437
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
2025-12-15 4:31 ` kernel test robot
2025-12-15 5:06 ` kernel test robot
@ 2025-12-15 12:47 ` kernel test robot
2 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-12-15 12:47 UTC (permalink / raw)
To: Mario Limonciello (AMD), Yazen Ghannam,
(maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Jean Delvare
Cc: llvm, oe-kbuild-all, Thomas Gleixner, Ingo Molnar,
Borislav Petkov, Dave Hansen, H . Peter Anvin, linux-kernel,
Mario Limonciello (AMD)
Hi Mario,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tip/master]
[also build test WARNING on linus/master tip/auto-latest v6.19-rc1 next-20251215]
[cannot apply to tip/x86/core]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Mario-Limonciello-AMD/firmware-dmi-Correct-an-indexing-error-in-dmi-h/20251215-025606
base: tip/master
patch link: https://lore.kernel.org/r/20251214185309.152614-4-superm1%40kernel.org
patch subject: [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251215/202512151357.ZGpOppn5-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251215/202512151357.ZGpOppn5-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512151357.ZGpOppn5-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/firmware/dmi_scan.c:398:14: warning: variable 'strings' set but not used [-Wunused-but-set-variable]
398 | const char *strings;
| ^
>> drivers/firmware/dmi_scan.c:400:6: warning: variable 'count' set but not used [-Wunused-but-set-variable]
400 | int count = 0;
| ^
2 warnings generated.
vim +/strings +398 drivers/firmware/dmi_scan.c
395
396 static void __init dmi_save_additional(const struct dmi_additional_info *info)
397 {
> 398 const char *strings;
399 const u8 *data;
> 400 int count = 0;
401 int i;
402
403 if (!info || info->header.length < 5 + info->count * 5)
404 return;
405
406 data = info->entries;
407 strings = (const char *)(data + info->count * 5);
408
409 for (i = 0; i < info->count; i++) {
410 u8 entry_length = data[i * 5];
411 u8 string_num = data[i * 5 + 4];
412 const char *string_ptr;
413 char *value;
414 int len;
415
416 if (entry_length < 5 || string_num == 0)
417 continue;
418
419 string_ptr = dmi_string_nosave(&info->header, string_num);
420 if (!string_ptr || !*string_ptr)
421 continue;
422
423 len = strlen(string_ptr);
424 if (len == 0)
425 continue;
426
427 value = dmi_alloc(len + 1);
428 if (!value)
429 continue;
430
431 strscpy(value, string_ptr, len + 1);
432
433 dmi_save_one_device(DMI_DEV_TYPE_ADDITIONAL, value);
434 count++;
435 }
436 }
437
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h
2025-12-14 18:53 ` [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
@ 2025-12-15 21:11 ` Yazen Ghannam
2025-12-15 21:24 ` Mario Limonciello
0 siblings, 1 reply; 14+ messages in thread
From: Yazen Ghannam @ 2025-12-15 21:11 UTC (permalink / raw)
To: Mario Limonciello (AMD)
Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jean Delvare,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel
On Sun, Dec 14, 2025 at 12:53:05PM -0600, Mario Limonciello (AMD) wrote:
> 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.
Types 43, 44, 45, and 46 are missing also. Should those be added as
well?
Probably not needed right now, but would be good to add them in a
future patch. I think there's precedent for keeping definitions up to
date with the spec even if they're not immediately used. ACPI does
this, I think.
>
> 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
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Thanks,
Yazen
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums
2025-12-14 18:53 ` [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
@ 2025-12-15 21:12 ` Yazen Ghannam
0 siblings, 0 replies; 14+ messages in thread
From: Yazen Ghannam @ 2025-12-15 21:12 UTC (permalink / raw)
To: Mario Limonciello (AMD)
Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jean Delvare,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel
On Sun, Dec 14, 2025 at 12:53:06PM -0600, Mario Limonciello (AMD) wrote:
> 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>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Thanks,
Yazen
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
2025-12-14 18:53 ` [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs Mario Limonciello (AMD)
@ 2025-12-15 21:23 ` Yazen Ghannam
2025-12-15 21:25 ` Mario Limonciello
0 siblings, 1 reply; 14+ messages in thread
From: Yazen Ghannam @ 2025-12-15 21:23 UTC (permalink / raw)
To: Mario Limonciello (AMD)
Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jean Delvare,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel
On Sun, Dec 14, 2025 at 12:53:09PM -0600, Mario Limonciello (AMD) wrote:
> On AMD Zen platforms that are running AGESA, there is sometimes
> DMI additional string for the AGESA version that can be helpful when
> debugging an issue. If this string is found output to kernel logs.
>
> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
> This is not strictly AMD node related; it was a proxy for a good location
> for the message late enough on boot and only run on AMD Zen machines.
> I'm open to other suggestions.
Maybe do like print_s5_reset_status_mmio() with a late_initcall()?
We could have an amd_zen_late_initcall() function in
arch/x86/kernel/cpu/amd.c that collects appropriate functions.
We have two now:
- print_s5_reset_status_mmio()
- print_agesa_dmi_info()
Thanks,
Yazen
> arch/x86/Kconfig | 1 +
> arch/x86/kernel/amd_node.c | 8 ++++++++
> 2 files changed, 9 insertions(+)
>
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index 80527299f859a..eae139a91fb84 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -3116,6 +3116,7 @@ config AMD_NB
> config AMD_NODE
> def_bool y
> depends on CPU_SUP_AMD && PCI
> + select DMI
>
> endmenu
>
> diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
> index 3d0a4768d603c..575d727c5827e 100644
> --- a/arch/x86/kernel/amd_node.c
> +++ b/arch/x86/kernel/amd_node.c
> @@ -9,6 +9,7 @@
> */
>
> #include <linux/debugfs.h>
> +#include <linux/dmi.h>
> #include <asm/amd/node.h>
>
> /*
> @@ -247,6 +248,7 @@ __setup("amd_smn_debugfs_enable", amd_smn_enable_dfs);
> static int __init amd_smn_init(void)
> {
> u16 count, num_roots, roots_per_node, node, num_nodes;
> + const struct dmi_device *dev = NULL;
> struct pci_dev *root;
>
> if (!cpu_feature_enabled(X86_FEATURE_ZEN))
> @@ -310,6 +312,12 @@ static int __init amd_smn_init(void)
>
> smn_exclusive = true;
>
> + while ((dev = dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, dev)))
> + if (!strncmp(dev->name, "AGESA", 5)) {
> + pr_info("%s\n", dev->name);
> + break;
> + }
> +
> return 0;
> }
>
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h
2025-12-15 21:11 ` Yazen Ghannam
@ 2025-12-15 21:24 ` Mario Limonciello
0 siblings, 0 replies; 14+ messages in thread
From: Mario Limonciello @ 2025-12-15 21:24 UTC (permalink / raw)
To: Yazen Ghannam
Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jean Delvare,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel
On 12/15/25 3:11 PM, Yazen Ghannam wrote:
> On Sun, Dec 14, 2025 at 12:53:05PM -0600, Mario Limonciello (AMD) wrote:
>> 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.
>
> Types 43, 44, 45, and 46 are missing also. Should those be added as
> well?
>
> Probably not needed right now, but would be good to add them in a
> future patch. I think there's precedent for keeping definitions up to
> date with the spec even if they're not immediately used. ACPI does
> this, I think.
OK, thanks. I'll tail another patch to the next spin of the series to
add those too.
>
>>
>> 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
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>
> Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
>
> Thanks,
> Yazen
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
2025-12-15 21:23 ` Yazen Ghannam
@ 2025-12-15 21:25 ` Mario Limonciello
0 siblings, 0 replies; 14+ messages in thread
From: Mario Limonciello @ 2025-12-15 21:25 UTC (permalink / raw)
To: Yazen Ghannam
Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT), Jean Delvare,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H . Peter Anvin, linux-kernel
On 12/15/25 3:23 PM, Yazen Ghannam wrote:
> On Sun, Dec 14, 2025 at 12:53:09PM -0600, Mario Limonciello (AMD) wrote:
>> On AMD Zen platforms that are running AGESA, there is sometimes
>> DMI additional string for the AGESA version that can be helpful when
>> debugging an issue. If this string is found output to kernel logs.
>>
>> Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
>> ---
>> This is not strictly AMD node related; it was a proxy for a good location
>> for the message late enough on boot and only run on AMD Zen machines.
>> I'm open to other suggestions.
>
> Maybe do like print_s5_reset_status_mmio() with a late_initcall()?
>
> We could have an amd_zen_late_initcall() function in
> arch/x86/kernel/cpu/amd.c that collects appropriate functions.
>
> We have two now:
> - print_s5_reset_status_mmio()
> - print_agesa_dmi_info()
Good idea, that is a more logical location. Lemme try it out.
>
> Thanks,
> Yazen
>
>> arch/x86/Kconfig | 1 +
>> arch/x86/kernel/amd_node.c | 8 ++++++++
>> 2 files changed, 9 insertions(+)
>>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index 80527299f859a..eae139a91fb84 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -3116,6 +3116,7 @@ config AMD_NB
>> config AMD_NODE
>> def_bool y
>> depends on CPU_SUP_AMD && PCI
>> + select DMI
>>
>> endmenu
>>
>> diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
>> index 3d0a4768d603c..575d727c5827e 100644
>> --- a/arch/x86/kernel/amd_node.c
>> +++ b/arch/x86/kernel/amd_node.c
>> @@ -9,6 +9,7 @@
>> */
>>
>> #include <linux/debugfs.h>
>> +#include <linux/dmi.h>
>> #include <asm/amd/node.h>
>>
>> /*
>> @@ -247,6 +248,7 @@ __setup("amd_smn_debugfs_enable", amd_smn_enable_dfs);
>> static int __init amd_smn_init(void)
>> {
>> u16 count, num_roots, roots_per_node, node, num_nodes;
>> + const struct dmi_device *dev = NULL;
>> struct pci_dev *root;
>>
>> if (!cpu_feature_enabled(X86_FEATURE_ZEN))
>> @@ -310,6 +312,12 @@ static int __init amd_smn_init(void)
>>
>> smn_exclusive = true;
>>
>> + while ((dev = dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, dev)))
>> + if (!strncmp(dev->name, "AGESA", 5)) {
>> + pr_info("%s\n", dev->name);
>> + break;
>> + }
>> +
>> return 0;
>> }
>>
>> --
>> 2.43.0
>>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2025-12-15 21:25 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-14 18:53 [PATCH 0/5] Parse SMBIOS additional entries Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 1/5] firmware: dmi: Correct an indexing error in dmi.h Mario Limonciello (AMD)
2025-12-15 21:11 ` Yazen Ghannam
2025-12-15 21:24 ` Mario Limonciello
2025-12-14 18:53 ` [PATCH 2/5] firmware: dmi: Adjust dmi_decode() to use enums Mario Limonciello (AMD)
2025-12-15 21:12 ` Yazen Ghannam
2025-12-14 18:53 ` [PATCH 3/5] firmware: dmi: Read additional information when decoding DMI table Mario Limonciello (AMD)
2025-12-15 4:31 ` kernel test robot
2025-12-15 5:06 ` kernel test robot
2025-12-15 12:47 ` kernel test robot
2025-12-14 18:53 ` [PATCH 4/5] firmware: dmi: Add debugfs for additional information entries Mario Limonciello (AMD)
2025-12-14 18:53 ` [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs Mario Limonciello (AMD)
2025-12-15 21:23 ` Yazen Ghannam
2025-12-15 21:25 ` Mario Limonciello
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox