From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web10.69439.1680016244869423147 for ; Tue, 28 Mar 2023 08:10:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=IbD4Spxh; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_llindhol@quicinc.com) Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32SDm6Nq031165; Tue, 28 Mar 2023 15:10:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=HnarfBNZ3yu7wmuFc3nxbs7Q42bdn7YVYqnfQcUnPE8=; b=IbD4SpxhjxyBDiiJMrArBgG2CLwwAyFbTpg/Rodj7fC8bCHbCUDCc0kDSjKQ4JAK4eWD oHtbE0nR3YEJCb4xJYCKKx+4OHoZY7hi1xLio7pjClecp+nGnhzQWSIJIAGOWwWuxJU+ Vjq0uGW1Vzq8YoSlNKTIz6ngyc1pVKf9z8X+TAKH+V18Wt3/zTS0ktcbQC4pvCAsfXM5 nQSykj99d4/ckDcB5uGjfcNO7Neg+MydtwL+lr+Lzz5I8xYnlQaIHWfmivOffM9QfH9o n0djq8uDMR/CawlpM/kFIpo+oVA9FkLpb5z/72AhgciKsKvNjL22PvEUok7KnHVElU/M Dg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pkk7ba6vp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 15:10:34 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32SFAXfW014586 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 28 Mar 2023 15:10:33 GMT Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Tue, 28 Mar 2023 08:10:31 -0700 Date: Tue, 28 Mar 2023 16:10:28 +0100 From: "Leif Lindholm" To: Tinh Nguyen CC: , , , , , Subject: Re: [PATCH v4 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version Message-ID: References: <20230326183543.1980914-1-tinhnguyen@os.amperecomputing.com> MIME-Version: 1.0 In-Reply-To: <20230326183543.1980914-1-tinhnguyen@os.amperecomputing.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: rLhYHcwfpQhLkCCEtZLekLlT55EQZB8V X-Proofpoint-GUID: rLhYHcwfpQhLkCCEtZLekLlT55EQZB8V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-24_11,2023-03-28_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 phishscore=0 bulkscore=0 mlxscore=0 lowpriorityscore=0 mlxlogscore=999 clxscore=1011 malwarescore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303280119 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Mar 27, 2023 at 01:35:43 +0700, Tinh Nguyen wrote: > The BIOS Firmware Version in the SMBIOS Type 0 can be fetched from > the fixed PcdFirmwareVersionString or platform specific OemMiscLib. > In fact, the support from OemMiscLib comes into play when the firmware > version may be modified at boot time for extended information. > Therefore, the priority of getting the version from OemMiscLib should > be higher. > > In case there is no modification in the OemMiscLib, we have to keep > HII string STR_MISC_BIOS_VERSION empty or 'Not Specified' > to indicate that the firmware version should be fetched from > the PcdFirmwareVersionString. > > Signed-off-by: Tinh Nguyen > Reviewed-by: Rebecca Cran > Reviewed-by: Oliver Smith-Denny > Reviewed-by: Leif Lindholm Thanks, merged as 07e17188df90. / Leif > --- > > Changes since v1: > + Change GetBiosVersion () to SetBiosVersion () and move the selection logic > fully into SetBiosVersion (). > Changes since v2: > + Add R-B by Rebecca and remove @retval > VOID > Changes since v3: > + Change the function's comment. Add R-B by Leif and Oliver. > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 58 ++++++++++++-------- > 1 file changed, 36 insertions(+), 22 deletions(-) > > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > index 66ead22a6e2c..c9f25b750254 100644 > --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > @@ -1,6 +1,6 @@ > /** @file > > - Copyright (c) 2022, Ampere Computing LLC. All rights reserved.
> + Copyright (c) 2022 - 2023, Ampere Computing LLC. All rights reserved.
> Copyright (c) 2021, NUVIA Inc. All rights reserved.
> Copyright (c) 2009, Intel Corporation. All rights reserved.
> Copyright (c) 2015, Hisilicon Limited. All rights reserved.
> @@ -124,22 +124,47 @@ GetBiosReleaseDate ( > return ReleaseDate; > } > > -/** > - Fetches the firmware ('BIOS') version from the > - FirmwareVersionInfo HOB. > +/** Fetches the Firmware version string for SMBIOS type 0 > + > + This function first acquires the firmware version string from OemMiscLib; > + if it is invalid, PcdFirmwareVersionString is used as a fallback, > + and then sets it in SMBIOS type 0. > > - @return The version as a UTF-16 string > **/ > -CHAR16 * > -GetBiosVersion ( > +VOID > +SetBiosVersion ( > VOID > ) > { > - CHAR16 *ReleaseString; > + CHAR16 *DefaultVersionString; > + CHAR16 *Version; > + EFI_STRING_ID TokenToUpdate; > > - ReleaseString = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString); > + DefaultVersionString = HiiGetString ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BIOS_VERSION), > + NULL > + ); > > - return ReleaseString; > + OemUpdateSmbiosInfo ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BIOS_VERSION), > + BiosVersionType00 > + ); > + > + Version = HiiGetString ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BIOS_VERSION), > + NULL > + ); > + > + if (((StrCmp (Version, DefaultVersionString) == 0) || (StrLen (Version) == 0))) { > + Version = (CHAR16 *)FixedPcdGetPtr (PcdFirmwareVersionString); > + if (StrLen (Version) > 0) { > + TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION); > + HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); > + } > + } > } > > /** > @@ -187,18 +212,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL); > } > > - Version = GetBiosVersion (); > - > - if (StrLen (Version) > 0) { > - TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION); > - HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); > - } else { > - OemUpdateSmbiosInfo ( > - mSmbiosMiscHiiHandle, > - STRING_TOKEN (STR_MISC_BIOS_VERSION), > - BiosVersionType00 > - ); > - } > + SetBiosVersion (); > > Char16String = GetBiosReleaseDate (); > if (StrLen (Char16String) > 0) { > -- > 2.39.2