From mboxrd@z Thu Jan 1 00:00:00 1970 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 810F743CED5 for ; Wed, 21 Jan 2026 22:06:37 +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=1769033197; cv=none; b=nepQQnNTkUIayQTbOm8/a8PF+vnDXcv8i2EbsgZhJk+9CvN9BvoioL7H0M7Fbl5yV5CIuDmrmdVt/WMGfRmzOrRm1FsJDnIGhakB0AmvGBvhMcTnIVKKDf3KOtyM/oZS0SlZglOnJmSUigcmlc71w/cyRNREaERcdE1Tcj9Dk6M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769033197; c=relaxed/simple; bh=9typLTwfIM4dKmXhDQ6QpoVGq1I3WOm+x38IPEM4ov4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=e1Ms6pDpe+a5CZvtxeKwIKVhy4LMG+Gw+olLwb7U3pbEugYEuvNlIePo5uDIMQknFrIdX3Ie7vzW1JV0MnkzNVcGc3rik3gfMu8+O1JrNXuObyQvHOHb9DmJ3t0/+oX9zqu8EWm5yZyKSt7EWXjCUgSRC3rxat3mMN9BoCEMa7A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Oy6nTUuJ; 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="Oy6nTUuJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BCF7C4CEF1; Wed, 21 Jan 2026 22:06:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769033197; bh=9typLTwfIM4dKmXhDQ6QpoVGq1I3WOm+x38IPEM4ov4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Oy6nTUuJce9YHZlJHb8aZBksrVZNb7L1PeV3M8qzdNuo8C6MZLWf0GyHRsgMUQuVn 4H8S1O+CPLkEPZ5zjTsbmehcRIpVumbi1itzDHl3tpRxcwszAcfEWFJxB/2uMFf1DE XvIetqEuU5owTxrSCTdRceBjOrmOhf+Z3AapLr7cD5H6y9cPhhQSC9uz+vhdu6Uc46 /hPtE18vuyBMeimAbubsFweggnufygZQfmWCyxGw4GKaqgymGQzjw8/ON5t1LRdWQ/ 6xYuMdgoOeU7p8BcanVsaluP/nJ5N6sL2tdi2cH48Uf/Qh8is6mijobyvAgqjM1bnp QHwudDJxSEtew== Message-ID: <3fee6c8b-efa8-45a3-b0b8-07428f2a20c9@kernel.org> Date: Wed, 21 Jan 2026 16:06:35 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 6/6] x86/CPU/AMD: Print AGESA string from DMI additional information entry To: Yazen Ghannam Cc: Jean Delvare , linux-kernel@vger.kernel.org, Borislav Petkov References: <20260121060431.432350-1-superm1@kernel.org> <20260121060431.432350-7-superm1@kernel.org> <20260121142654.GA1784626@yaz-khff2.amd.com> <3ec8b151-5f3a-48e4-bcb2-3e8524d85083@kernel.org> <20260121213030.GA1992440@yaz-khff2.amd.com> Content-Language: en-US From: "Mario Limonciello (AMD) (kernel.org)" In-Reply-To: <20260121213030.GA1992440@yaz-khff2.amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 1/21/2026 3:30 PM, Yazen Ghannam wrote: > On Wed, Jan 21, 2026 at 02:50:49PM -0600, Mario Limonciello wrote: >> On 1/21/26 8:26 AM, Yazen Ghannam wrote: > > [...] > >>>> + do { >>>> + struct dmi_a_info_entry *entry; >>>> + const char *string_ptr; >>>> + >>>> + entry = (struct dmi_a_info_entry *)next; >>>> + >>>> + /* >>>> + * Not much can be done to validate data. At least the entry >>>> + * length shouldn't be 0. >>>> + */ >>>> + if (!entry->length) >>>> + return; >>>> + >>>> + string_ptr = dmi_string_nosave(&info->header, entry->str_num); >>>> + >>>> + /* Only one AGESA string is expected. */ >>>> + if (!strncmp(string_ptr, "AGESA", 5)) { >>>> + pr_info("%s\n", string_ptr); >>>> + break; >>>> + } >>>> + > > [...] > >>>> +static inline const char * >>>> + dmi_string_nosave(const struct dmi_header *dm, u8 s) { return dmi_empty_string; } >>> >>> The dmi_empty_string needs to be moved to this header file from >>> dmi_scan.c. >>> >>> Otherwise, there's a build issue as the test bot reported. >>> >>> Thanks, >>> Yazen >> >> I don't think it's actually appropriate to move dmi_empty_string in this >> case. It's a static variable, shouldn't really be in a header. >> >> I would think it's better to just return NULL. > > dmi_string_nosave() should always return a string. The callers expect > it. That's why we don't need a NULL pointer check above. > > +static inline const char * > + dmi_string_nosave(const struct dmi_header *dm, u8 s) { return ""; } > > Rather than move the variable, just return the empty string directly. > > Thanks, > Yazen Got it; thanks for clarifying.