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.21911.1678719793274492104 for ; Mon, 13 Mar 2023 08:03:13 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=PyaQai2w; 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 32DBAE4p009828; Mon, 13 Mar 2023 15:03:11 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=NFbHENTNWsH2Ne3pZRBrAjwuf4jmVy0Y4kORh/l8iCQ=; b=PyaQai2wyvOq1NGPVN2pR7gdX18LPgLf/DHek/C0lcWGdYFhZ52DFtEuxKJ4oQgscGzh g/DJ2MRb+2JrV9yZLgqQSCRxj69r6Upyb6isVMq/LFSAB2WCC6G8oe2K0PHKCvSzQrwy HJokxbH1/WGzEaIDSjGnxcE9OFrvADE2wgTgGsRcENDMWPXRP3N3NsRTlRpgE9znYOeU lrabQuqCuwOKEbl+YvDRlHnvX3xrdE6wCQdWBPGNWBorpL4hDQW6pKjNfo91G5v7erwe Z/Mt/1l6dN19KEHUkYJCz6MIVsIq4GHwJY+EJwbKFEbLMrca87pckswdvjdR69Aewkep 9Q== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pa1qgrsgp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Mar 2023 15:03:11 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32DF3A1q032454 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Mar 2023 15:03:10 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; Mon, 13 Mar 2023 08:03:08 -0700 Date: Mon, 13 Mar 2023 15:03:05 +0000 From: "Leif Lindholm" To: Tinh Nguyen CC: , , , Nhi Pham Subject: Re: [PATCH 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version Message-ID: References: <20230313064321.170866-1-tinhnguyen@os.amperecomputing.com> MIME-Version: 1.0 In-Reply-To: <20230313064321.170866-1-tinhnguyen@os.amperecomputing.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: l3f4fKhibN7j8_Rp56DpCVhv8ZuBE3Lj X-Proofpoint-GUID: l3f4fKhibN7j8_Rp56DpCVhv8ZuBE3Lj 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-13_07,2023-03-13_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 bulkscore=0 priorityscore=1501 mlxlogscore=999 spamscore=0 clxscore=1011 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2303130118 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Mon, Mar 13, 2023 at 13:43:21 +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. Wait. Firmware version modified at boot time for extended information? What type of 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. > > Reviewed-by: Nhi Pham > Signed-off-by: Tinh Nguyen > --- > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 36 ++++++++++++++------ > 1 file changed, 25 insertions(+), 11 deletions(-) > > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > index 66ead22a6e2c..31a3f6cde544 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.
> @@ -170,6 +170,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { > EFI_STRING_ID TokenToGet; > SMBIOS_TABLE_TYPE0 *SmbiosRecord; > SMBIOS_TABLE_TYPE0 *InputData; > + CHAR16 *DefaultVersionString; > > // > // First check for invalid parameters. > @@ -187,17 +188,30 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL); > } > > - Version = GetBiosVersion (); GetBiosVersion exists as a helper function to avoid cluttering higher-level functions with unnecessary details. If this change is needed, that is where it should go. But I still don't understand the purpose of this patch, so cannot comment on whether I feel this is the right approach or not. Please elaborate. / Leif > + DefaultVersionString = HiiGetString ( > + mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BIOS_VERSION), > + NULL > + ); > > - 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 > - ); > + 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 = GetBiosVersion (); > + if (StrLen (Version) > 0) { > + TokenToUpdate = STRING_TOKEN (STR_MISC_BIOS_VERSION); > + HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); > + } > } > > Char16String = GetBiosReleaseDate (); > -- > 2.39.2 >