From nobody Fri Dec 19 04:23:16 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 DFC83350A0C for ; Tue, 16 Dec 2025 12:34:21 +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=1765888462; cv=none; b=vEjlCPTW/HVLd9ZSVQ7thc3V2puTIy8EgLgC91C0FwhTsZrVxrpn4aq3G+nunE+Ly89+bIbjbyDBnhd17x10RRt2AIHI9IIED6+MTUET3nLp2NoNl+F48xuuPmdUqHAf1m9FfefHbY4sf40FqDqsFgClKh6qdSGsNecWBxwv6tA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765888462; c=relaxed/simple; bh=TufGXkKSDwgg81O760l0nwPD7a6TqwsHtBrFk1ONC5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uco4RrO9Ti2KQZxKjRNE36zzLWRvIWmEMFpyxOzj5evL/BxqQn3iyysYDWoi5urm9PCQY+6HEmdKyPFvb9e+dOPAEvw7o714a59L2/Bak+PRB2AaLAwfhNannb+0zgt94zaLezHu39qJtjWmFx8Cp/nxGpAN99h+jSTTJWNhYyg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jiOMp6Wt; 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="jiOMp6Wt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA56BC4CEF1; Tue, 16 Dec 2025 12:34:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765888461; bh=TufGXkKSDwgg81O760l0nwPD7a6TqwsHtBrFk1ONC5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jiOMp6Wt56dcFyJVxB9mVC5uc2N6Nsg/XndUH0gDX3IRfzgHG0de0UyY47G+9bQSO OfSsVoHwN35DNk2+XyzpSTKCmc136uoyDT81bpjX/nLFeW+wTxKWvv++JmeBzhUMJO rNJ+F6fYYG3peYzF+XbqV/eruvc2zBSvWaQG9tobCC4SHoCs++k0WgRLj4aX8GI9X/ DxmzG1XhJt7ZW4piknjVEVpAhZ+7qaYDo4ktddADtQJafYtxAyzGkaKpmAvpaWFxgo WUnGhNJ19wo51iFxoC+39IrFgtXrgLIJXzS7JhL83wEZnK13bqpFBII/FpdlDDd35g U1Cq4/QvLOwww== 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 v2 4/7] firmware: dmi: Add debugfs for additional information entries Date: Tue, 16 Dec 2025 06:33:51 -0600 Message-ID: <20251216123354.9219-5-superm1@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251216123354.9219-1-superm1@kernel.org> References: <20251216123354.9219-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 ec84fe3935c1e..5361b8b8a39d5 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 */ @@ -802,6 +815,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; @@ -837,9 +864,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