From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (EUR03-AM5-obe.outbound.protection.outlook.com [40.107.3.50]) by mx.groups.io with SMTP id smtpd.web12.1325.1639588787339640270 for ; Wed, 15 Dec 2021 09:19:48 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=bgJToZRN; spf=pass (domain: arm.com, ip: 40.107.3.50, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hSKBVG1B14v3Z7SvJK9IFzVU1Dwhk8Zpo47V4N70rfk=; b=bgJToZRN/H36HZeZzSElq/7Xx1/6Ucc/G27XWt0KX47vEOKM+AlBdzY0MH7IyKg8SgXVfTO+0dV2ZDAweq0JRknHOaaFQc2T3zbdLZGRzbT3zVo2Y48hxXvg3TWRbox2FlHuoa7ARsPno1Bs+m6ci9kxdbT/NSesjhqydYmhY30= Received: from DU2PR04CA0033.eurprd04.prod.outlook.com (2603:10a6:10:234::8) by AS8PR08MB6677.eurprd08.prod.outlook.com (2603:10a6:20b:39a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec 2021 17:19:43 +0000 Received: from DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:234:cafe::b1) by DU2PR04CA0033.outlook.office365.com (2603:10a6:10:234::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.14 via Frontend Transport; Wed, 15 Dec 2021 17:19:43 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT018.mail.protection.outlook.com (10.152.20.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.12 via Frontend Transport; Wed, 15 Dec 2021 17:19:43 +0000 Received: ("Tessian outbound 1cd1a01725a6:v110"); Wed, 15 Dec 2021 17:19:43 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ab7673a8748196c3 X-CR-MTA-TID: 64aa7808 Received: from d54c30b1e528.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EE57012F-2337-43D1-8491-BC316ACA6A99.1; Wed, 15 Dec 2021 17:19:26 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d54c30b1e528.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 15 Dec 2021 17:19:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H/KPxyCKjpw7nb2Hd18nN1rbiwOlQ0uJRbpty39TbKDN8+IbsMCflT9dX2BipuD06dAV5EmAr+AzdRAv+HcoRflouhGghC34I/eauJXsGjMbytMXm4EORBgzqDa5Yf0yrusff0pkfyWYLsYM9bXAmGD0WSKMdfHuxQSGdGmgvqiLQ9V4sh8DwN86MmWbJSgcWmK6e05iU2bpNKn4OOTZ9a46/Kl0sPaf99u6yB0EfPEbDHzT0RM0QPS5xASHLJSSY9tYwb9SaB/bKyn7GPEG//i4XYxXcYfsn03I6H/36uh26dUov2S/2mOnpKTFP27DCORVs6VF2pTYTUVdd17f5Q== 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=hSKBVG1B14v3Z7SvJK9IFzVU1Dwhk8Zpo47V4N70rfk=; b=RaDeITDJz0Xn8p0pnmT/PfHwgc+PO5Tle0pDHehUVLhgSKE2SviMQ6M8ZcrzrjMJmcgPeb9r1AyXPsg3wnKaU7IDQFPIr0Gtool9f7a957uR7XNeq2IfLvxxH5h7duMSOZFkUov6w9u42JCGDcOPGsxzc2yjIQHwp+CTbS7W6GhXMfJPpcfX9/Gh+Xev/InuKq+NBc1O65ZhIh1rjSjNOh1yz2W9t/aLHn9Xpp7f4n7QESgPnRoIlzWY+IMDLxlAo2PNc82VsH7FTUCe8CV+RM6HhXz8UF9CXhsCKIopCjECXeT/GrObZh/sMswWciXGry9yzzQj2xZwASFIF8P4FA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hSKBVG1B14v3Z7SvJK9IFzVU1Dwhk8Zpo47V4N70rfk=; b=bgJToZRN/H36HZeZzSElq/7Xx1/6Ucc/G27XWt0KX47vEOKM+AlBdzY0MH7IyKg8SgXVfTO+0dV2ZDAweq0JRknHOaaFQc2T3zbdLZGRzbT3zVo2Y48hxXvg3TWRbox2FlHuoa7ARsPno1Bs+m6ci9kxdbT/NSesjhqydYmhY30= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB3157.eurprd08.prod.outlook.com (2603:10a6:209:48::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4801.14; Wed, 15 Dec 2021 17:19:22 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::bdcf:cfa6:b2bb:38ac%6]) with mapi id 15.20.4755.021; Wed, 15 Dec 2021 17:19:22 +0000 Subject: Re: [edk2-devel] [PATCH 2/3] ArmPkg/SmbiosMiscDxe: Get full SMBIOS strings from OemMiscLib To: devel@edk2.groups.io, nhi@os.amperecomputing.com Cc: patches@amperecomputing.com, Leif Lindholm , Ard Biesheuvel , Rebecca Cran , nd References: <20211201041031.31824-1-nhi@os.amperecomputing.com> <20211201041031.31824-3-nhi@os.amperecomputing.com> From: "Sami Mujawar" Message-ID: <7f613415-2df9-346b-a9d4-cee0c36f9cf0@arm.com> Date: Wed, 15 Dec 2021 17:19:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20211201041031.31824-3-nhi@os.amperecomputing.com> X-ClientProxiedBy: LO4P265CA0030.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::15) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.50) by LO4P265CA0030.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ae::15) with Microsoft SMTP Server (version=TLS1_2, cipher=) via Frontend Transport; Wed, 15 Dec 2021 17:19:21 +0000 X-MS-Office365-Filtering-Correlation-Id: 19d69a5d-aab2-43b5-11c9-08d9bfef15e2 X-MS-TrafficTypeDiagnostic: AM6PR08MB3157:EE_|DB5EUR03FT018:EE_|AS8PR08MB6677:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:4714;OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 4sA/28IZPXo+dojmpErPTHpaEredvUb87tm741cMrrySph+/gd1qI7mLJPL3LClD8BTeBfGpTCHuNUSSgRj1RbJnvWEUHF6fRBycV4G7eMRU9v9feQXkjVyKqGqWBklzliiT16zkeGJ/dfNFKrj99rvANh49RwSXcgcPWT913G1fMI3HzyJp9rYix+5rQWVg/AR08w/pu+qAhONqhyMUAbJwyOc7oFS9kmBo68RC9gLLbRQPwX7zx+3+ff57Bgy4E6Vs2a1sUOAdM5QTZ/jrKs4U6WVobcI5wdamtDcfkL/7r52f6fOXqEXxmSFt6woMl9Xl3+7+P0+Ca4E2ucKC9Ec2O/t3KETdysmBHaqpNjPqVwIXA+ACkx4MXfhVAxNdHdAoksU7tbHLfNWUFZO7KG+TuVFW51zA1LheKC+wfNyTUFRIaRL71boVmaN9OSuqWcO4zOudRTHGl/oRzNLbE0nuzZC5Zq03MYaSoKqd8kjUf0CYI+n+HdIgX2dMLA6cAfwEZctu5+HpYX2+tIygx0tLzhu/7gD1EeIWqY0GKKMUeOxzD/CwTtxyM2MpsMv20yTH6EOEeIhziXFqkIy3gKSESWRT0yrhhPYbNgiC4VIUTO4JGi7PbCibByN1od4d6XhsU9POh/s8+kqpHQIO2aUEjBTajmO9yl3TV6Xz5qhzTRlj1d76EOQ3Yi5bqgONTq8z+wxHJF7YaM06fgIWFFPTKVklQ4Nq8SkOOJP6xdteBaTPT6KNKyn3fl4AbpmFuuUSbu6kRbOfEFUlVvz+sQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(38100700002)(66946007)(38350700002)(66476007)(66556008)(83380400001)(2906002)(316002)(4326008)(36756003)(16576012)(31696002)(6666004)(44832011)(54906003)(508600001)(2616005)(6486002)(52116002)(53546011)(31686004)(45954011)(186003)(956004)(8676002)(5660300002)(26005)(8936002)(19627235002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3157 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c7f2273c-5d34-47b8-cb80-08d9bfef0922 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X+w4fKXGZad2GCryPtYvXUcf98gDmiUqWDWd7rbPMxHBAqKTMVQB9jnNzJqsTXOFPOzZsnL/xd4Lr+rt+GHSgvUP/kYdVd5pTPPiYjcWt61fsCGH8+4+2dhvJ4AqswDFgkvr6jEqiL9SZRMfR+iBtvDFLYSMAHP4tXa1arrvdsquI6ybZ3/Hrcg3ecGjYR0Gm7CJq1XpzzYWUD/YGh+HYlKCMIiNJr0mzgj4UkEgt++R0UXbJSMg8MC8f81prf+8H4+amSudwOpvY9S/4T2+0vkSRw2bawHGDM2bk3eKpKNQWqmBCWKyIhbart39TrgY0+Ft8XQoZDsqTTZhxXauHnEBbt9SZMktBb282eFBabEK6PctYG20Qseeu+M5Yqr3sW6yisWu0klGXCG9izRjRsD9gkFHXAVOsTGD+nenqIroiQf0+moM81UvONodlrC0+Q1QqREMvhQ+hr7cqAGq22V3Isxpku9KgHTK12VHwa/eYhwYn/tg3AaDRmm9KSBm1MlnGkT1kqwPr5SU6fv/PifzZgNcI4KVbrWEQ4k764nDuwYgVQ167L0TZZ0+mmFtJ7qbzUlhZXho4UBtbODUyhHlf5Hq79gbHLTkJa9mYBaKPIBbPUD0dYOK7vRNZNZzA7p4AaM2Aoy/9mShWAL1BWj93jxZUiNB/pPV9v7MNtPs9ttGqgA8ac8GNRiCNDswaZtoC5/PhT/506jrcB9xVmK8R3ZGMvXP95XXmb1JD1myFpS+G4yx94G/bjaFRzOTTfpcfZOqzg96QX9JSHt05x+XffdkppPQkc4RCtn3RauC2w0JqrM/Bh7spxTAlrCoo7sHReRq92BH8ZozBc1DJMgu12YRIRpq2v5CtSLCYgY= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(40470700001)(45954011)(36860700001)(54906003)(53546011)(4326008)(70206006)(70586007)(44832011)(19627235002)(8936002)(2616005)(47076005)(83380400001)(6486002)(316002)(82310400004)(508600001)(186003)(31696002)(336012)(26005)(31686004)(956004)(36756003)(86362001)(81166007)(5660300002)(356005)(8676002)(40460700001)(6666004)(2906002)(16576012)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 17:19:43.4787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19d69a5d-aab2-43b5-11c9-08d9bfef15e2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT018.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6677 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Nhi, Other than the code style issue (which I believe uncrustify will complain about), this patch looks good to me. With that fixed. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 01/12/2021 04:10 AM, Nhi Pham via groups.io wrote: > Typically, the information of the SMBIOS type 1/2/3 is fetched from an > FRU device during UEFI booting intead of fixed PCDs. Therefore, this > patch is to add more HII string fields in the OemMiscLib and support > updating these SMBIOS types with the strings provided by the OemMiscLib > if the PCDs are empty. > > Cc: Leif Lindholm > Cc: Ard Biesheuvel > Cc: Rebecca Cran > Signed-off-by: Nhi Pham > --- > ArmPkg/Include/Library/OemMiscLib.h | 3 +++ > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c | 10 ++++++++++ > ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c | 15 +++++++++++++++ > 3 files changed, 28 insertions(+) > > diff --git a/ArmPkg/Include/Library/OemMiscLib.h b/ArmPkg/Include/Library/OemMiscLib.h > index 0b03fe8d4de3..aa68c0a92632 100644 > --- a/ArmPkg/Include/Library/OemMiscLib.h > +++ b/ArmPkg/Include/Library/OemMiscLib.h > @@ -44,11 +44,14 @@ typedef enum > SerialNumType01, > UuidType01, > SystemManufacturerType01, > + VersionType01, > SkuNumberType01, > FamilyType01, > AssertTagType02, > SerialNumberType02, > BoardManufacturerType02, > + ProductNameType02, > + VersionType02, > SkuNumberType02, > ChassisLocationType02, > AssetTagType03, > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c > index 2c69c2593f5d..2c73d63444fe 100644 > --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c > +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type01/MiscSystemManufacturerFunction.c > @@ -75,12 +75,22 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscSystemManufacturer) > if (StrLen (Product) > 0) { > TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME); > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Product, NULL); > + } else { > + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_SYSTEM_PRODUCT_NAME), > + ProductNameType01 > + ); [SAMI] I think uncrustify would fail here, similar issue at other places. > } > > pVersion = (CHAR16 *) PcdGetPtr (PcdSystemVersion); > if (StrLen (pVersion) > 0) { > TokenToUpdate = STRING_TOKEN (STR_MISC_SYSTEM_VERSION); > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, pVersion, NULL); > + } else { > + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_SYSTEM_VERSION), > + VersionType01 > + ); > } > > OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c > index 097777a23904..7f397d8d2aaa 100644 > --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c > +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type02/MiscBaseBoardManufacturerFunction.c > @@ -79,18 +79,33 @@ SMBIOS_MISC_TABLE_FUNCTION(MiscBaseBoardManufacturer) > if (StrLen (BaseBoardManufacturer) > 0) { > TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER); > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardManufacturer, NULL); > + } else { > + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BASE_BOARD_MANUFACTURER), > + BoardManufacturerType02 > + ); > } > > BaseBoardProductName = (CHAR16 *) PcdGetPtr (PcdBaseBoardProductName); > if (StrLen (BaseBoardProductName) > 0) { > TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME); > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, BaseBoardProductName, NULL); > + } else { > + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BASE_BOARD_PRODUCT_NAME), > + ProductNameType02 > + ); > } > > Version = (CHAR16 *) PcdGetPtr (PcdBaseBoardVersion); > if (StrLen (Version) > 0) { > TokenToUpdate = STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION); > HiiSetString (mSmbiosMiscHiiHandle, TokenToUpdate, Version, NULL); > + } else { > + OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle, > + STRING_TOKEN (STR_MISC_BASE_BOARD_VERSION), > + VersionType02 > + ); > } > > OemUpdateSmbiosInfo (mSmbiosMiscHiiHandle,