From nobody Tue Dec 16 14:48:24 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C40ED30C347 for ; Sun, 14 Dec 2025 18:53:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765738406; cv=none; b=ilEsh2v6xROwivPLKFfoyBJ1XMTr/86ebgSVvC+JCiQEo33T2O3URfs2KlMZecZHrOsTlhNTM6OKQnS+0g1jkzATXNSaRf7QGbecHlhCEDU6RAw3FAolaCVs+N1qhHuxGDaNybqENHRyHufdUR+0SQRs4qcdrsZoXFssxLrFzCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765738406; c=relaxed/simple; bh=79CI+Nh6y5+JwLbsXV+vOWPk4v7n3CUmtLDPhqizNlo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W05ud0gVrS+RdZqZKpWKxyefNuPd5vZ3v2g6KL/71iCigKxev2SF+QBJF2p1KO5XXE1zd2Aue0Q6zxNBmxGza5Fsyk/njX65MmKIuecPtqpGmtUf1GBkxPGeDSnMtuN0ooqkT1ZAuIx+xGelLgBFBGFBC97a8LT7Dj9Odi0RjS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C4snJ/7m; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C4snJ/7m" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5DBF6C19421; Sun, 14 Dec 2025 18:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765738406; bh=79CI+Nh6y5+JwLbsXV+vOWPk4v7n3CUmtLDPhqizNlo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C4snJ/7mApcOS0aOW014tvzV5GJiQT/YlyqfIP6b0XzvtYMiNArRFLAp8KvSqQ5vh A8+dcPv7tYlAuR3f89DicICAA1aeANTDkeuJwdF64xUKhx0+xdSjXbSpw3DRqqkkba zvEGtvug5hxXVpQ8OAUUZj0kiNwowJu5nBP8Ahi9iFe1KiKEkcV7OuvR/2VK22QABH UAx2xWfjB3OMdDhghl3Xx3hmAKu4BlSSJ5zIpiKjAdelIkhCD5ggFTwqcnhE9YTwis RqI/sNloN/y9Cn1sh150mogXAODxRiLpzrwCNQavvEHYH+wcwgq5Tkpd9IL6oIZ2Q0 mmKWBDG744CjA== From: "Mario Limonciello (AMD)" To: Yazen Ghannam , x86@kernel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)), Jean Delvare Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , linux-kernel@vger.kernel.org, "Mario Limonciello (AMD)" Subject: [PATCH 4/5] firmware: dmi: Add debugfs for additional information entries Date: Sun, 14 Dec 2025 12:53:08 -0600 Message-ID: <20251214185309.152614-5-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251214185309.152614-1-superm1@kernel.org> References: <20251214185309.152614-1-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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) --- 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 #include #include +#include #include #include #include @@ -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; =20 /* 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); =20 +static int additional_show(struct seq_file *m, void *v) +{ + const struct dmi_device *dev =3D NULL; + + while ((dev =3D 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); =20 +static void __init dmi_create_debugfs(void) +{ + if (!arch_debugfs_dir) + return; + debugfs_dir =3D 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 =3D dmi_len; bin_attr_DMI.private =3D dmi_table; ret =3D sysfs_create_bin_file(tables_kobj, &bin_attr_DMI); - if (!ret) - return 0; + if (ret) + goto err_sysfs; + + dmi_create_debugfs(); + + return 0; =20 + err_sysfs: sysfs_remove_bin_file(tables_kobj, &bin_attr_smbios_entry_point); err_unmap: --=20 2.43.0