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 BF75A34E753 for ; Tue, 16 Dec 2025 12:34:20 +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=1765888460; cv=none; b=DjLDlO/NWBpiwhWMeObcZ0q42jbZNDFwuwmEHUu/y/jjcDgi7X66TQcWFXTdz5iaxlns+8SaIi+jG7lopo5DsCJH7QQCiKSvKtoM9uFdgRGVAypGoc6xOqJ9MRBxd7cmgbJ4Z3Xit6syNpzWe2DxC/NH+oXbqjwn+EL6a2egcV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765888460; c=relaxed/simple; bh=qR1Fo3ouDMBq7M+YD46yollYUf2Hpr4DOYACrJldru0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ofxD45CUl/FmZElGkTi5D0n4bH+Z4fx7+mITgDlnXucAE8XDm33m5jqMW1cwpPaJLASYqK6R0cl5m+xC7o3b1lmgxYwgv7ApmXvRhUt8csXJxefujUL3ORNCLZRa3lojH1h027K+wbRXdsyC5EGzfGhRpJtcxP31KZjEP5VkrZA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c6QuxTfP; 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="c6QuxTfP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC144C16AAE; Tue, 16 Dec 2025 12:34:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1765888460; bh=qR1Fo3ouDMBq7M+YD46yollYUf2Hpr4DOYACrJldru0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c6QuxTfPinLjKuHQ501wkKlt8SzcR6N2lzM/nWDZuv55EjYRpeM85q8zW7k5sbori x5dQWJ3eP5m26usEK4vLIX7Rv2rZrA8Hcblg8xLCU0XUnEIOeSKycmZMMx/hBBgY51 bcHeloAUhwNmGBnkou9aPBhAL18vjCKt/KocnSDBO4xt+aQtJvMleGPVrE7mI7BtYK x8BeHhS309SH1CjvIR8vCWXFLUrC2RjfaERQwqBv4kEX++s0MbTbaIOospVkOcNMhC gH6/1xLligt3byFRaWAJAWOl9x6NFYNY0wIOLuAPcRvWD7jgnnueS4y+eHFjviZkZc AoH8Fh9kw2BiA== 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 3/7] firmware: dmi: Read additional information when decoding DMI table Date: Tue, 16 Dec 2025 06:33:50 -0600 Message-ID: <20251216123354.9219-4-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" 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) --- v2: * Drop some unneeded variables (LKP robot) * Allow any length strings, not just 5 and longer --- drivers/firmware/dmi_scan.c | 38 +++++++++++++++++++++++++++++++++++++ include/linux/dmi.h | 7 +++++++ 2 files changed, 45 insertions(+) diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c index 80aded4c778bc..ec84fe3935c1e 100644 --- a/drivers/firmware/dmi_scan.c +++ b/drivers/firmware/dmi_scan.c @@ -393,6 +393,40 @@ 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 u8 *data; + int i; + + if (!info || info->header.length < 5 + info->count * 5) + return; + + data =3D info->entries; + + for (i =3D 0; i < info->count; i++) { + u8 string_num =3D data[i * 5 + 4]; + const char *string_ptr; + char *value; + int len; + + 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); + } +} + static void __init dmi_save_extended_devices(const struct dmi_header *dm) { const char *name; @@ -526,8 +560,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