From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EA861DF980 for ; Mon, 22 Dec 2025 18:18:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766427544; cv=none; b=GzVg+sQLhC4bjz6OxK11EnVCtAbrB79qc0RQ3NAX/H5xLsja3E3ZzL3FgHa0tAs46HtRH8UVJklhnd2eDUrtxeixLaAdaFLMwPlMmfQmmhAQAWj35zYYWD23+QTd+WMibZlE5HwYzjJ5KartoS4RgNh+qGH0QX/HPVRHwUZgFe4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766427544; c=relaxed/simple; bh=0Pw87iRt/4GZVvdfTq/D3bDkWxftbJWaqPrgS+EltTs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T2tuDi5mDkRiG/fnwu8hA9jN25ejqWn+RTOSwazTu2Nax0iSdqITFMya980LcI5XXPRIuwg+Ad2r91vAvLc+vHNWeVmwG5WxVP3RYgAIGu70Q4dxepp2YPfwZO7/hrBWGNxfCMWOUpmdMxh44E1YbuOqGUj3ZDyl7koS4drw3DM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=tMf03DB4; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=mflw6+xi; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=OmSi6Eff; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=6u0zbJ2H; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="tMf03DB4"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="mflw6+xi"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="OmSi6Eff"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="6u0zbJ2H" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 98F9F336A5; Mon, 22 Dec 2025 18:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1766427535; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ElcGV8cuZ3zZKt6BhS6Fr5/4D7UAYzilPD3HT0bonYw=; b=tMf03DB4xOPfxr7qMuHBqlg5Jfrlt6Ldld/Iuzbk/CP6dL64Zm0Z8oIxlPmDbEstmTOY2G f9Jc1xwi+T+xMGO/+XTx3XKpnt/TQRqYYMH6tGDQAmCE2Y1utcXRsBnj5+GmE3kkEog4XT RX8RBreQVbQNwJrl7/hqUKcwH3W6ycc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1766427535; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ElcGV8cuZ3zZKt6BhS6Fr5/4D7UAYzilPD3HT0bonYw=; b=mflw6+xi+wDw68Hmh8/nilYocxrgSF3ZZ/zR4Ed0jFSdKY46Fw81OXUMm+8EK76/uaOtQW NDjNWUbBjpxfvtBg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=OmSi6Eff; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=6u0zbJ2H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1766427534; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ElcGV8cuZ3zZKt6BhS6Fr5/4D7UAYzilPD3HT0bonYw=; b=OmSi6EffVBeCxzU1lqIp04iHrwXb7eZobLILzMZBj4d+oYXywDIq+q8BoxwqeDVaKhGm9u YtldbUqoItUctzBXND/7lrWZ9V6ITAAQDN921mxR9UGB10bcExthvKTZLPrDSEIiSvRwyD Sj7v+AwJOzSpr0ZmIZvPOTTAhb7Xmzc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1766427534; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ElcGV8cuZ3zZKt6BhS6Fr5/4D7UAYzilPD3HT0bonYw=; b=6u0zbJ2H1isyow1HxWEuVmjxa7gc0xMvLbr50GtH+EK9KMYT14By7OT4Nvct6Y3yHg8trc 0sYBUJwc3+dWnRDg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 355703EA63; Mon, 22 Dec 2025 18:18:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id IuRdCo6LSWmlKwAAD6G6ig (envelope-from ); Mon, 22 Dec 2025 18:18:54 +0000 Date: Mon, 22 Dec 2025 19:18:52 +0100 From: Jean Delvare To: "Mario Limonciello (AMD)" Cc: Yazen Ghannam , x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] x86/CPU/AMD: Output the AGESA version to the logs Message-ID: <20251222191852.47fb515e@endymion> In-Reply-To: <20251216123354.9219-8-superm1@kernel.org> References: <20251216123354.9219-1-superm1@kernel.org> <20251216123354.9219-8-superm1@kernel.org> Organization: SUSE Linux X-Mailer: Claws Mail 4.2.0 (GTK 3.24.43; x86_64-suse-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.998]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; HAS_ORG_HEADER(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:106:10:150:64:167:received]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[9]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:dkim]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spam-Level: X-Rspamd-Queue-Id: 98F9F336A5 X-Spam-Flag: NO X-Spam-Score: -4.01 Hi Mario, On Tue, 16 Dec 2025 06:33:54 -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. This last sentence sounds clumsy. > > Signed-off-by: Mario Limonciello (AMD) > --- > arch/x86/kernel/cpu/amd.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c > index c19c4ee74dd1f..8f44439d3f993 100644 > --- a/arch/x86/kernel/cpu/amd.c > +++ b/arch/x86/kernel/cpu/amd.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0-only > #define pr_fmt(fmt) "x86/amd: " fmt > > +#include > #include > #include > #include > @@ -1406,3 +1407,20 @@ static __init int print_s5_reset_status_mmio(void) > return 0; > } > late_initcall(print_s5_reset_status_mmio); > + > +#ifdef CONFIG_DMI > +static __init int print_agesa_dmi_info(void) > +{ > + const struct dmi_device *dev = NULL; > + > + while ((dev = dmi_find_device(DMI_DEV_TYPE_ADDITIONAL, NULL, dev))) { > + if (!strncmp(dev->name, "AGESA", 5)) { > + pr_info("%s\n", dev->name); > + break; > + } > + } In theory, type 40 DMI records are supposed to be a temporary workaround until a new definition makes its way to the SMBIOS specification. There is supposed to be a field in a standard DMI record which will hold the same information in the future, at which point systems will no longer need to provide the additional information entry. I'm therefore surprised that you look for the AGESA information only in type 40 and not in the standard DMI type where this piece of information is supposed to be added in a near future. So I checked my collection of DMI table dumps to find examples. I found a number of occurrences of such type 40 entries. And it's a mess, I'm sorry to say. Some properly reference the Firmware Information handle (0x000) but others reference handle 0xFFFF instead (which is invalid). Some reference offset 0x05 within that record (which corresponds to the Firmware Version string) while others reference offset 0x00 (which is invalid). All have a 4-byte data field at the end of the entry, with value 0x00000000, which is needlessly large. This really looks like an abuse of DMI type 40. These entries are supposed to overlay enumerated values in other types. This applies to numeric fields only, overlaying a string field with another string field is a technical non-sense. Not sure what AMD engineers had in mind when implementing this. If they wanted to mention the AGESA version in the firmware string, they could have done that in DMI type 0, firmware version string directly. Alternatively, OEM-specific records can be implemented, where hardware vendors can store any kind of information they like. OEM strings (type 11) would also have been a valid alternative. Using DMI type 40 was clearly not the right way to do it. > + > + return 0; > +} > +late_initcall(print_agesa_dmi_info); > +#endif -- Jean Delvare SUSE L3 Support