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.web11.4542.1679682585459400867 for ; Fri, 24 Mar 2023 11:29:45 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=bkBc9Qv8; 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 (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32OFp6hQ010441; Fri, 24 Mar 2023 18:29:39 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=CGoF7Q7nE8lx3nC9lsjlnge/D+WW9EawLbYU1jKS8ww=; b=bkBc9Qv8Mc1gadFp1JLWIIGlJPN2iz0vmOeLeFwneQpXgdbcaYjoHnW3s0lQSrKZ0jJI +ll/9MgmH2qnAE8bahRvgasvdTf76zDLZ3jRAuyGcrFZ4HOsUjHjYWpFf/6o4SSx1NdK ARd/U8XTAoy0l4QLoOhIyTuQp/DTUnGhne7PQSLrA1n/ontqgRRmrAdQBRmGj0MoGJZM zwf3r1M/zlciG/A7h7gE7nRbTjZaE3HxdDhE7zBsumIMUyS7W1/CYgButMpsMtZxws+t QXBRY4VYFygqJF14buwKuVvGanxBh3Xh6WprxBiJO1gFYDx1aD/TDJVLz+bnQFy8ZEO0 Ww== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3phev48bdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 18:29:39 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32OITcJF008391 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Mar 2023 18:29:39 GMT Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 24 Mar 2023 11:29:37 -0700 Date: Fri, 24 Mar 2023 18:29:33 +0000 From: "Leif Lindholm" To: Tinh Nguyen CC: Tinh Nguyen , , , , , Subject: Re: [PATCH v3 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version Message-ID: References: <20230321031638.1241041-1-tinhnguyen@os.amperecomputing.com> <5ee13617-b5da-a338-6832-d43bd4b2fd10@amperemail.onmicrosoft.com> MIME-Version: 1.0 In-Reply-To: <5ee13617-b5da-a338-6832-d43bd4b2fd10@amperemail.onmicrosoft.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: DhhfjOXkjbB3S_XEZurGxVR0X_OiOlh_ X-Proofpoint-GUID: DhhfjOXkjbB3S_XEZurGxVR0X_OiOlh_ 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-24_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 suspectscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 bulkscore=0 impostorscore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303240145 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Hi Tinh, Sorry, was waiting for a v4 based on your last reply to Oliver. Yes, from my end (with Oliver's feedback addressed): Reviewed-by: Leif Lindholm / Leif On Wed, Mar 22, 2023 at 10:38:21 +0700, Tinh Nguyen wrote: > Hi Leif, > > Do you have any concerns? Could I add you to the review list? > > Thanks, > > Tinh > > On 3/21/2023 10:16 AM, 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 > > --- > > > > Changes since v1: > > + Change GetBiosVersion () to SetBiosVersion () and move the selection logic > > fully into SetBiosVersion (). > > Changes since v2: > > + Add Reviewed-by: Rebecca Cran and remove @retval > > VOID > > > > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 57 ++++++++++++-------- > > 1 file changed, 35 insertions(+), 22 deletions(-) > > > > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > > index 66ead22a6e2c..876a74614285 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,46 @@ GetBiosReleaseDate ( > > return ReleaseDate; > > } > > -/** > > - Fetches the firmware ('BIOS') version from the > > - FirmwareVersionInfo HOB. > > +/** Fetches the Firmware version string for SMBIOS type 0 > > + > > + This function get the Firmware version string from OemMiscLib first, > > + if it is invalid then PcdFirmwareVersionString is used as a fallback. > > - @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 +211,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