[PATCH 5/5] x86/amd_node: Output the AGESA version to the logs

Mario Limonciello (AMD) posted 5 patches 1 day, 12 hours ago
[PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
Posted by Mario Limonciello (AMD) 1 day, 12 hours ago
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
Re: [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
Posted by Yazen Ghannam 10 hours ago
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
>
Re: [PATCH 5/5] x86/amd_node: Output the AGESA version to the logs
Posted by Mario Limonciello 10 hours ago
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
>>