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 86F2330DEDD for ; Sun, 14 Dec 2025 18:53:25 +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=1765738405; cv=none; b=Zee0s+4slPi4SDzqiZB64PZutDaXmixlEZuN8TXa3k1G7JdP3Zb1C+kgBf2vXMpHpMU+oz5Vl8AdQly8CP/RED6KcWI6uxp+IedGnp7lEI/49GkFcnxJvqi4KwhEwug86RSvVEO/04rcOwmP9kLXVWUDTbkp9v15BixuQjMR6Sc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765738405; c=relaxed/simple; bh=MRoqQkv+dvWlXIc36DDvL0BxsDgDg0QDyqylGAt7faU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MNf1b/rvgvEvxyhVAiehO2bxYyqzYpSKIWpFebM5zn6yl4PzcavD5g8eaTg4eq1JuaSx/AoKgSuJv+lc77fc93IWc++vxocISkPViS0eI5dkwThSp3XlfB4sqw8n03D0fI2Rkc/JIVr12T+dOcq3KfC5nRcnink67syosfhQB1k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ciFiOfjA; 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="ciFiOfjA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2826FC16AAE; Sun, 14 Dec 2025 18:53:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765738405; bh=MRoqQkv+dvWlXIc36DDvL0BxsDgDg0QDyqylGAt7faU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ciFiOfjADpw1wkH1L+Ywhxdr2dyhHHC+QVgWa9fGDGIsIPGT/aYmKZ4ItsWG9GkU/ hl/5ztoxotDCLm05sMmcwcB7L5OeNGhe6R3WGdiVfVh+nkxODiq3cCgclEDYrsfyTN R8+FrKB+IGXZEbRVGvBDdkUwsavIrbF4xg6hc7wvbLMjzAkA129QLqzM4VgB5vtV27 fzSzKv4r22WE6hWHEYZty6SH7waKpQkzA2u5MzlXnjd9hOowNSbUTGBMF2r9arDydZ C7+SjeyT9x10UIaZCv38wASCk9P1dbRJQ28WVWWcegF28qWsUk7yUnVA+vHSgkVfjS IXr/bQ9j+LEvA== 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 3/5] firmware: dmi: Read additional information when decoding DMI table Date: Sun, 14 Dec 2025 12:53:07 -0600 Message-ID: <20251214185309.152614-4-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" 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) --- 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); } =20 +static void __init dmi_save_additional(const struct dmi_additional_info *i= nfo) +{ + const char *strings; + const u8 *data; + int count =3D 0; + int i; + + if (!info || info->header.length < 5 + info->count * 5) + return; + + data =3D info->entries; + strings =3D (const char *)(data + info->count * 5); + + for (i =3D 0; i < info->count; i++) { + u8 entry_length =3D data[i * 5]; + u8 string_num =3D data[i * 5 + 4]; + const char *string_ptr; + char *value; + int len; + + if (entry_length < 5 || string_num =3D=3D 0) + continue; + + string_ptr =3D dmi_string_nosave(&info->header, string_num); + if (!string_ptr || !*string_ptr) + continue; + + len =3D strlen(string_ptr); + if (len =3D=3D 0) + continue; + + value =3D 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; } } =20 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 =3D -2, DMI_DEV_TYPE_DEV_ONBOARD =3D -3, DMI_DEV_TYPE_DEV_SLOT =3D -4, + DMI_DEV_TYPE_ADDITIONAL =3D -5, }; =20 enum dmi_entry_type { @@ -87,6 +88,12 @@ struct dmi_device { void *device_data; /* Type specific data */ }; =20 +struct dmi_additional_info { + struct dmi_header header; + u8 count; + u8 entries[]; +} __packed; + #ifdef CONFIG_DMI =20 struct dmi_dev_onboard { --=20 2.43.0