From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.118]) by mx.groups.io with SMTP id smtpd.web11.34741.1679456314858828167 for ; Tue, 21 Mar 2023 20:38:35 -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=8mi7yP81; spf=pass (domain: os.amperecomputing.com, ip: 40.107.212.118, mailfrom: tinhnguyen@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VRcNufi+fUjw7+4qZwU+lS05JlXauQk/6ie0PlH3ZWbhYneSnhj8WiUhOFtQ6TcVyE7ICP+COg2ZDWonjzYs2GylOStaf6yEaDO8bMezl5HisvAxkBo+RBUvd48mcpWB/vh1KO7i3YrvhPsBSUphWfAa8Qnoq4Dl5ISbCpReZ4CrDsN6l03CavmJUGQ3IM9CSvyFs2FvPQcfUJeqzz+LyTli+Zymy3l2kB0jVBlrufLHb0LBWtotGE8G4svI5j0jbxePPMbiZoatt2rMIxhuIPTe6D0HHRb2C1nHEP2Zkle2PrMtZbySCjn0WciQzl1NpgJLRnpvYRuj84ItcZYIiw== 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=hf5OkArhD3i8/e4xQl4B0g0KSnty9Plw30aeRn3q5p0=; b=C435oOmmz5PUqM1dzsOwErYeuuQSA4xi6uhgzPgL7DWQYu/GPD1PAObQT/OXywbASeAZS7IrTtAovRYQ1xmf0/iE/0Add+/7o9LWvZDKuUuqV3cRh4Fe9xN0qhsI12/cpjs7YqaUt+8QgCoogUji4fX4yc/YLeLM0fWDdCYikkVbunG0ULitWSbND85uD3fimmDuAZ/mhSfXPNZkchge11+ZdRPBBnVsyLKVyeUqK3AMv5YkKsbyJ4FmARLVhM0RPtOrF9BU7T81Z1+MglaINnciU44utf0so1ECB5npAsJClyFWHVXnUg708l/0SI+MkFT/92hD7FSinlygPWtpTQ== 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=hf5OkArhD3i8/e4xQl4B0g0KSnty9Plw30aeRn3q5p0=; b=8mi7yP81POSy6+ll/GRS9dvaeZ5c5W2on8NZcFBXcoU8eqz814jgzKjN6uTZICNCOM4843GiBWpXy0B1tTI0ahUNcj3B61HdehDZDmfH3ebD0YRtQfTng/Etf+mgWWpzu3qnJO3yUqbU+ZI1zv7aNATGHL4ZAMngjFzg3dq93/Q= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amperemail.onmicrosoft.com; Received: from MWHPR0101MB2942.prod.exchangelabs.com (2603:10b6:301:2e::14) by MWHPR01MB2365.prod.exchangelabs.com (2603:10b6:300:45::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6222.8; Wed, 22 Mar 2023 03:38:30 +0000 Received: from MWHPR0101MB2942.prod.exchangelabs.com ([fe80::1d06:a51a:ca3d:c2f6]) by MWHPR0101MB2942.prod.exchangelabs.com ([fe80::1d06:a51a:ca3d:c2f6%4]) with mapi id 15.20.6178.024; Wed, 22 Mar 2023 03:38:30 +0000 Message-ID: <5ee13617-b5da-a338-6832-d43bd4b2fd10@amperemail.onmicrosoft.com> Date: Wed, 22 Mar 2023 10:38:21 +0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH v3 1/1] ArmPkg/SmbiosMiscDxe: Adjust the priority of getting firmware version To: Tinh Nguyen , devel@edk2.groups.io, Leif Lindholm Cc: patches@amperecomputing.com, ardb+tianocore@kernel.org, nhi@os.amperecomputing.com, rebecca@bsdio.com References: <20230321031638.1241041-1-tinhnguyen@os.amperecomputing.com> From: "Tinh Nguyen" In-Reply-To: <20230321031638.1241041-1-tinhnguyen@os.amperecomputing.com> X-ClientProxiedBy: SI1PR02CA0034.apcprd02.prod.outlook.com (2603:1096:4:1f6::10) To MWHPR0101MB2942.prod.exchangelabs.com (2603:10b6:301:2e::14) Return-Path: tinhnguyen@os.amperecomputing.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR0101MB2942:EE_|MWHPR01MB2365:EE_ X-MS-Office365-Filtering-Correlation-Id: b39a7af2-64b1-4a7d-dbf0-08db2a86e733 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: syj1sHBPbw8KzJbnPcCvh/elwsc/B4k92egkV+qf4zwVVqyb4NEeJFwcPhLsPEn1HjswVp3w/p9/zk7R6EJ/aCwYGqf1Q38kHOUMVd0W8PuhDPK4Y9RRgPYr8q+SIMhcQk3ARQFvrh5gLA7RBb8GnW5BZHgi7PFg8CQfnJgcGIq1jmFd/K4lIWBQ9TVkI3OqrmuVMUX3DKz0mD5u5GihJoPN0NTtp2vHE1D8D08peMQ5UVXybfeupGHsPzVZc/kmokKSRHh+MbhuydV5Frf3m5dVGWcc67Ixp9hJRjn/KIgC0rDlv1tLO9x/211uydB3Hxilvt9iBvjB12X9ZV20Kbj/Q6iE3lTAfA5TQJjA4eXJXfpJThAcBlXHcLZvCDUqet10S+rNdo42ENxZAQasm15f3oQKvRr1vAHdbJSywVQbvLTeE3fqc2H8Fp5CpCROqbPspj3fdNdML0KC7NG+7wBNhbS6IN/O8ayTAtpPheH57LpCwjlv1hEgzOJ0FomDKXde8RB8KxJiquPxQF2INBKg+C6xVHRdCpL3oFm3UNsHXNVU12nS4nW+63xs6sUrJHpDkiEyHQ1wnqFZYw9M+9BrV2IH/nDbQ7wTFTU3epx36NdW1RKKlaBDjcbpzWIV96vnFju1EbZFYCwWzWcblTOjASAUOHfSTkpH5eeFioRCoMrbszJ4eW/eCkniEALMYxmH8fZkEsKvnuwnKEOQEQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR0101MB2942.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(366004)(39850400004)(136003)(376002)(346002)(396003)(451199018)(2906002)(5660300002)(8936002)(8676002)(31696002)(4326008)(41300700001)(31686004)(478600001)(2616005)(38100700002)(42882007)(83380400001)(316002)(66946007)(6506007)(186003)(53546011)(26005)(6512007)(83170400001)(110136005)(6486002)(6666004)(66476007)(66556008)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a3JDT2gwbHhaQ2RVclhuM2ROa3F0MFdIMFJpUk9pRU5yeU5VeEk2M2RwMjBF?= =?utf-8?B?RnVmRHNpaHZsRVVWTVFtM1RxTTZlRDhoTHpzbCtaRXB5eHVlbmY1MmxMdTRT?= =?utf-8?B?TzhiTEVOMVdHbE1kYmE1cmhaNTdSdnBCWElKQnMrVDAzNWZtTllYb1Q4UFlI?= =?utf-8?B?djVOZnhDcnA0VWs4VzhMR2p3Rjl6RUNmd2lTZ2ZLS1hIanI2b2t3cklpemN1?= =?utf-8?B?eFA1d1BzMWMrMWlUWDJPUFkxaVhYRm5xd3BLUDcrS0hiZ0JQaVJWdGl6VzV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M01VZVhpWFJwK2JweWRwZmg4SURqTU4yVUkvanJC?= =?utf-8?B?VVhrbFhGTDluODJPUVMrSWk1YkJQbGFPcmpGelg1U3NtR1RsY3FuM3hKaUxV?= =?utf-8?Q?CSbk/ptgBIdYCwJIdK0uhpuLKsDrzRq+pYtDRI/unpxz?= X-OriginatorOrg: amperemail.onmicrosoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b39a7af2-64b1-4a7d-dbf0-08db2a86e733 X-MS-Exchange-CrossTenant-AuthSource: MWHPR0101MB2942.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2023 03:38:30.0820 (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: k9lc4DKkEi0G4L0xRtcm6oPDlPJc8OOCN8T9ED4BvbZZZk9NTOb4DKM4Ka5asFUS1xtiJ/RObVjozQCYzRjkHKGFn4X35d5fdFuJyYNAiYhqSwhhV53CYrc5Q6ZfsK8K X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR01MB2365 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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