From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (NAM11-BN8-obe.outbound.protection.outlook.com [40.107.236.100]) by mx.groups.io with SMTP id smtpd.web11.25726.1678726375264441993 for ; Mon, 13 Mar 2023 09:52:55 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="no key for verify" header.i=@amperemail.onmicrosoft.com header.s=selector1-amperemail-onmicrosoft-com header.b=IZMBLoYW; spf=pass (domain: os.amperecomputing.com, ip: 40.107.236.100, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nRkIsvEtqKLSz88BnzVrsvOrM7mt58gOgdeUfCQ/diXEJvrpnKsGzrbbhyWwhBDq3xKOlGGaNAZSvuO7PKIW5UqE5slMKbM3Z+bEL++eIQnwlkOiGIJpYZMX/xWiwdR/Rjz0gI3tEjP29Q4KhdjpirAS8JPLx2e6Hc6Kwk/8GLeAmb4vW1YYGkqKcUq5TT81BNvWWsGCnBTlDKsLBoA1TRGr2E6QErZvrZR9sb1mm7OQFs8/T3jV3fBA5hGJoXjDbaiWdylseyQ59IYDnvyk2xKpkaATsLH0mcTCgY/W5zCjdQn/dbYvCS2P76m/3xFegD0HLB4YD1N8uQEpvrxt+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ZUSWNdUVfMtqe21CFgohFCTkDPabfxir0fSLuJYjz/k=; b=Yq53jrIO5CFsIRd5LBkt54xE3MYivOAAAgWoe5DgW3kjDSzxT+Z/bEhT1HAdAEq4u0Ekd3Dp3/emm836JyGFk5eayPbFZbkRm9qXNKHs6llzuyYeHfEupS/SClOXIQv04x/wPt9PSu5c8fWd0ryMw1RkOXKP+DzxoOj7xSGuNHhp7iHfU0wPQBMO+uMdSe5VVnDU0s2dP0ED6HSX1C6F1hrDHb12higejSuYq6ylEm03DPMadSZrwQZ/Wx8nHvxO0Uwj/0nhIT13MHnDskmaqcZg7SEGGg6uoGxgRUQpQJfcVfRghRO227eHXpQt/oBCYS3PP5i5e2pmmlbEOMihLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=amperemail.onmicrosoft.com; dkim=pass header.d=amperemail.onmicrosoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amperemail.onmicrosoft.com; s=selector1-amperemail-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZUSWNdUVfMtqe21CFgohFCTkDPabfxir0fSLuJYjz/k=; b=IZMBLoYWMJZ8/bmz75o9/trLLZ2GuPDi4J9mAkbmLd2R0Z4WcpcspiDlq1/4n1+llRiibBLePQiaF/LEwJhKBo9EAEgKvteoRJEnVTrr4SANvpcKuiB+FW2U5EF/Wmcd7OVcnZAqiG1tgMKn3ebMO7vvMkDx15dsDeihWSyAqQQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from PH0PR01MB7506.prod.exchangelabs.com (2603:10b6:510:f5::22) by BN8PR01MB5538.prod.exchangelabs.com (2603:10b6:408:ad::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 16:52:51 +0000 Received: from PH0PR01MB7506.prod.exchangelabs.com ([fe80::c431:46ee:f0b7:3818]) by PH0PR01MB7506.prod.exchangelabs.com ([fe80::c431:46ee:f0b7:3818%8]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 16:52:50 +0000 Message-ID: <0e962fce-d8d2-9622-94af-5f32e5a51ca4@amperemail.onmicrosoft.com> Date: Mon, 13 Mar 2023 23:52:41 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version To: Leif Lindholm , Tinh Nguyen CC: devel@edk2.groups.io, patches@amperecomputing.com, ardb+tianocore@kernel.org, Nhi Pham References: <20230313064321.170866-1-tinhnguyen@os.amperecomputing.com> From: "Tinh Nguyen" In-Reply-To: X-ClientProxiedBy: SG2PR06CA0216.apcprd06.prod.outlook.com (2603:1096:4:68::24) To PH0PR01MB7506.prod.exchangelabs.com (2603:10b6:510:f5::22) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7506:EE_|BN8PR01MB5538:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f3edc51-132b-4645-1a4d-08db23e3617e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hOwO/wM04x2kSMGYbfRn6Rpo6d4I/mo05Rg2kvbfRNSBZzEb/qZ5it3zWkQ5YRP3WdIMF8FZvPmb6yqoB3uiFyt/Vby+oqkJLgLd86WVUSXng8DOFceRTzEcYkDasRqexU7MkXIMPnuks1N5wnMAWH8ujp+VzbMYT0zAMF3eUw9m/41YR7XKa0/cR3HFJH+I8jUf2ZeslGEjZF8EAyXw4kmfhKM+tBfKhhMKUApJVDt5e/VlHFf8H+F0xIAaIg6pa99EybpkQcDDbfgiMq/8vQDpvTZLwdgT4g4YTUDHnvNYMtOq+TPrVLZmxM1KjFwuZj+M76o/J38NLlzYa9o5SiVYv1PQUOXit0piTKvFhFQEWC38VG2wZl+CSib96EGGLxhFxR3YofA2c1C2ysOit3m4BZh62TMBRSmmJ+cZsIYf62dR47WQg719RH0LjitbSBPjuDuc8THlmF7l6gbHU9o09K1IKIYHhYb5o3b1rFj386Y8jwTllI1ODz3MdMGnVciVxmdNZ6b3/SN/G9PurzQ2vsHA8M0ZncoFF5EHmzn3WIY0PBjEjoLZlGdxhvrWvDc5kwvBgPJ+/f9aTcoDkJUCD9E2Bd00T2H1yViCAJIQ2PtQA2MJFX64Epd2TZMrK3vdMaqFwu229ffSRsxa7l8AR5lsRQmGcKG6CDkbw/OQiLdk1TzxhyuqNGtwFFWk+vxj0+zL3Dc3sgknNcmYRg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7506.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(396003)(136003)(366004)(346002)(39850400004)(376002)(451199018)(6512007)(6506007)(26005)(53546011)(31686004)(2616005)(42882007)(107886003)(6666004)(186003)(2906002)(6486002)(83380400001)(5660300002)(316002)(110136005)(83170400001)(66556008)(66946007)(66476007)(38100700002)(8676002)(4326008)(478600001)(41300700001)(8936002)(31696002)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bJPVG8+fUGmzMCnlkjZZkKiZJytbXmQq4VBHb0tOLt7KKVZy6QrMu8HUDOIe?= =?us-ascii?Q?eu84ipEYSKdNkY6hLGOpMZ3Fjq+vuyTCXG56p9H5ElvqwcTTROU0rV+kiGNt?= =?us-ascii?Q?LQ6AtF1F0nbkJ2+Kxmm43wjF7tkLI2PQDK1tGPRp+f3sRlRbuuQ9R/IyH0X5?= =?us-ascii?Q?ATSYbwQxvLI6EcPOfdtJL9Tqb75+K0aRyBs7Jjx3sXX5zII9gmidtwZlB8tV?= =?us-ascii?Q?gsbA/hBocFKev8ldQVwqJFsgt6ONiRvZsOuszKHvyY5Ms16tSEGEfOfVOE4h?= =?us-ascii?Q?mH2VfoN+eDXKD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?us-ascii?Q?ho1uE4fHfuKT46oc+qhlWz/o1FIJXjaKZZBrlyVwvypw8E2auRz7VT4/lpaj?= =?us-ascii?Q?/6LXvmEmXgjF+guKNxpNMW4hgrj7JtMjctxjh6fj4bN+qTnFgZJTVl8Arilj?= =?us-ascii?Q?5zZVgWb6aFrHd+5WoDTK7m9nrbAjxAbfZH6lJKpAhQAyBp82y8+vWyk9x5bQ?= =?us-ascii?Q?n5yoVszZptGohSeF7moCfbHn47wDVwBUHKoupUBx6d6RfEgFjFQv0T7w2yjG?= =?us-ascii?Q?bW5/8X3O+qxkJABuNfSRZR6BLRaaRzWa9opfpYG1HcYO8mNDGjNyxenRjHCT?= =?us-ascii?Q?ApVGa++7c8pWXeGBTowKmSBJFlZJcn540dQ76ltSruECotu3ToFg63lJASN6?= =?us-ascii?Q?ALlrCV7K6eUk6W2aBfJEfOky4bm+86Mafr+sS2jL/TU9S1w1QHL9MV2LRZ3G?= =?us-ascii?Q?7wlGvv06+URldNEVyfrd46nP/zMX85UuaR2OgdbuS+Q2?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9f3edc51-132b-4645-1a4d-08db23e3617e X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7506.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 16:52:50.7133 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nEH1LrsH35FbrvTS8QS1oQ/TcGGZJ0+l+dwZJb5M0RZOVj017KNsVYAtOY9HlpcygRPEO1wzjnMkUI3zxSXV7GmweLguDkdC2ByDCua7Yd/4UVO1SY+4AlvVB7XQHrii X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR01MB5538 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Leif, My comments is in below On 3/13/2023 10:03 PM, Leif Lindholm wrote: > 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? That could be SCP version, TF-A version, etc. >> 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/MiscBiosVendor= Function.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFun= ction.c >> index 66ead22a6e2c..31a3f6cde544 100644 >> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunctio= n.c >> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunctio= n.c >> @@ -1,6 +1,6 @@ >> /** @file >> =20 >> - 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; >> =20 >> // >> // First check for invalid parameters. >> @@ -187,17 +188,30 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) { >> HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Vendor, NULL); >> } >> =20 >> - Version =3D 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. This change is based on existing code, and goal is to get the Firmware=20 version string from OemMiscLib first, rather than PcdFirmwareVersionString. =C2=A0I would rather not make any changes that aren't relevant. > 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. The firmware version is currently being updated: 1. Get the string from Fixed PcdFirmwareVersionString. 2. Check to see if this string is null; if not, update the SMBIOS=20 firmware version string. 3. if PcdFirmwareVersionString is null, retrieve the string from OemMiscLib= . As you can see, the implementation is intended to honor the=20 PcdFirmwareVersionString. We can't get the extend information (which can be derived from runtime)=20 into the SMBIOS firmware version string if we don't set=20 PcdFirmwareVersionString null However,=C2=A0 in some cases we don't want to set PcdFirmwareVersionString = to=20 null because it might be used by other modules. =C2=A0 I think it makes sense to prioritize OemMiscLib since it's more=20 flexible than Pcd. > / > Leif > >> + DefaultVersionString =3D HiiGetString ( >> + mSmbiosMiscHiiHandle, >> + STRING_TOKEN (STR_MISC_BIOS_VERSION), >> + NULL >> + ); >> =20 >> - if (StrLen (Version) > 0) { >> - TokenToUpdate =3D 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 =3D HiiGetString ( >> + mSmbiosMiscHiiHandle, >> + STRING_TOKEN (STR_MISC_BIOS_VERSION), >> + NULL >> + ); >> + >> + if (((StrCmp (Version, DefaultVersionString) =3D=3D 0) || (StrLen (Ve= rsion) =3D=3D 0))) { >> + Version =3D GetBiosVersion (); >> + if (StrLen (Version) > 0) { >> + TokenToUpdate =3D STRING_TOKEN (STR_MISC_BIOS_VERSION); >> + HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL)= ; >> + } >> } >> =20 >> Char16String =3D GetBiosReleaseDate (); >> --=20 >> 2.39.2 >>