From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.65]) by mx.groups.io with SMTP id smtpd.web11.2285.1678263550506292503 for ; Wed, 08 Mar 2023 00:19:11 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=WelqSjUV; spf=pass (domain: arm.com, ip: 40.107.20.65, 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=wM+0sEmKHQ0IFyOWDrBKkvA/6A7uOrhPoo/NSEJPJ+Y=; b=WelqSjUVCBLWy72NfAIZqDGDgzYkTpATq22mjyIPCUN1bjm6Cr3j0IeW2J4rl3u5pa0KAdoJhCF3uTV/l0EIF9s1M758Ctl06SLSlCeU4npaKsNnpn8woHh2jgSLNRZdJa7keEn0FOAqF/iC9kwAX2QkisWvsUbK1a2At8zH5KQ= Received: from FR0P281CA0098.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a9::8) by PAWPR08MB9890.eurprd08.prod.outlook.com (2603:10a6:102:332::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 08:19:02 +0000 Received: from VI1EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:a9:cafe::e) by FR0P281CA0098.outlook.office365.com (2603:10a6:d10:a9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.16 via Frontend Transport; Wed, 8 Mar 2023 08:19:01 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VI1EUR03FT046.mail.protection.outlook.com (100.127.144.113) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.29 via Frontend Transport; Wed, 8 Mar 2023 08:19:01 +0000 Received: ("Tessian outbound f2a8d6d66d12:v135"); Wed, 08 Mar 2023 08:19:01 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f3b4b668875372d3 X-CR-MTA-TID: 64aa7808 Received: from e4dd5b173bd7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id AFEE6F0C-18EC-4A0E-9B43-C00B74744114.1; Wed, 08 Mar 2023 08:18:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e4dd5b173bd7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 08 Mar 2023 08:18:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LwNBbYC4YtUMOHre5qffnvBb2uftgjxqXJjSgPT4qxqh/qEu0ET3k3jjeT/XArSLAccE2bI6pS2KIy0ulzmgJl23foksW7/2xi9PCI2Up9i3jhxgtDKY8G7ktAHfaVQ00/26fIH/YpS+gjKmB85V4ILWuRw1RbJEn3VaiV+m8/VRdvQcUJjp9WiYfSbhbQSwSYquFKMmtQa2iq9877DX1lVShHT7x06z+LhCvwmmDTb2qnfWE5D/8zpNQ3MifLdF3YWDyNtllXWBfvY/6v5+jqMcMUq5SHEysBET04wWZrIfEL59CBkE1Ulm15H+Z506Gv6iOImrHl0lBDfNoGg9IQ== 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=wM+0sEmKHQ0IFyOWDrBKkvA/6A7uOrhPoo/NSEJPJ+Y=; b=AzKuyIk7iaGq45Wg+BfgzrprZXmm78YC8fxp9liLQdYO6qa8WoFiSiFAmOl0ogUUZNDR+H0lRfXRXLfEv1BUzZv8Q7IkG8S3VPAcMPuV06X3blnk5MP1Fn29E1IOA5+YhE5D2o+xUSwvT9U8nYb9vt0zu1aulNZPr64fiKdMi7jjgh2H/QIHrbFSWTvr9FEqO67mOQBA+lFBrB7/pP57TrnMrvqLcWFCXgn2ZmgvXFiehe4R54VcVFs2UEvIWMd0tcISqgvpsq/Uz2SwdnMvtggPN4Bnp6ppPrCutleVgOxLP3B5HMdE9BS9namsYxQLDzd9AB9vUr1ClPtbEPTlyQ== 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=wM+0sEmKHQ0IFyOWDrBKkvA/6A7uOrhPoo/NSEJPJ+Y=; b=WelqSjUVCBLWy72NfAIZqDGDgzYkTpATq22mjyIPCUN1bjm6Cr3j0IeW2J4rl3u5pa0KAdoJhCF3uTV/l0EIF9s1M758Ctl06SLSlCeU4npaKsNnpn8woHh2jgSLNRZdJa7keEn0FOAqF/iC9kwAX2QkisWvsUbK1a2At8zH5KQ= 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 GV2PR08MB9349.eurprd08.prod.outlook.com (2603:10a6:150:da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Wed, 8 Mar 2023 08:18:45 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::c224:ef61:cd4c:7727]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::c224:ef61:cd4c:7727%3]) with mapi id 15.20.6178.016; Wed, 8 Mar 2023 08:18:45 +0000 Message-ID: Date: Wed, 8 Mar 2023 08:18:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 From: "Sami Mujawar" Subject: Re: [edk2-devel] [PATCH 2/2] DynamicTablesPkg: Add Smbios Type17 Table generator To: Girish Mahadevan , devel@edk2.groups.io, Alexei Fedorov , Pierre Gondois , Abner.Chang@amd.com CC: Samer El-Haj-Mahmoud , Jeff Brasen , Ashish Singhal , Akanksha Jain , Matteo Carlini , Hemendra Dassanayake , Nick Ramirez , William Watson , "nd@arm.com" , Jose Marinho References: <90bcdad9b53f1ca184a857da720aac1ab89882f7.1661534045.git.gmahadevan@nvidia.com> <2204e785-d05a-a47d-2da6-a9b6b8e608a0@nvidia.com> <4b32fed8-4c50-1f56-ad5e-ed6feefbfb01@nvidia.com> In-Reply-To: <4b32fed8-4c50-1f56-ad5e-ed6feefbfb01@nvidia.com> X-ClientProxiedBy: LO2P265CA0424.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a0::28) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|GV2PR08MB9349:EE_|VI1EUR03FT046:EE_|PAWPR08MB9890:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bff063b-c245-4806-28ba-08db1fadc637 X-LD-Processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: BHqLDFxl4qJckxtMXDHhz1lG1yF2UMSfVar0Zy420asRnBwJGzxwvlM7Hb9h0+mWO0i4K/M7h1bkJbqINttsry0IYNNp4I4iz47b+N0EuaVLfFCnsTXKiNyW7uw2fHB9NiYA1590nHA5I+qdlMVN+elDOpdSjRUzj1MOwR6use78+PGihpCv27iwzCbslKuc+2V1WvuYQC8pTSy2IGdBzso80rUbxqS2qR9BALAr6I2cBrucwawtiRO9cH0JLlRzSPu0fo01TlhSjU4nD7eVFIybVUSuYExJ0liplr5HuXnmSJEEhD3yumVD/CtTNAwOSliLJWPbkTIAFvndxy/TjlV9fnPMgmeOvYjastJVsAZDIEVRQCjvlRgCz1fBPzl1bEM00vVLJ/FBZIV5vS/dZmKTgOiTXs3kl3ll1LQGy4AIBk6yINsxvU4cbP+EE+BBu0TNQ+lYuiz3a54BejtH/6MScLBFuKfBtSqm5tULT9c/c2JRX6MRfPH+awl6qMArJRX7BfDuYDsrzRmXtR3EbrHTcMcBF39m8Xk9rsJQA0LJ6XEHoxpFKfEHZNASK5w7Bw1fY2wVwbEbRAXvyjVdvhquRrumlaGAIUHOggCd+4+pi4l5aRtRQ4jQsFU2yuwHXQI4CFzMyyR5Ot7BxDv1FImT85AusO3SouCYbsXdWOvDbsvZNPhKC9KMRwT7EH+jQvt0ep/N7dGwPuGupytd1ZLRlCo/6G6zMtAvX7qclVTRu61K0gy+dMHQw+xT6Bf2hqLPKwQSVR/1TyM49Wb5iYPdAu4qfTUR9h6qRZbsF6M= 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:(13230025)(4636009)(396003)(346002)(376002)(136003)(39860400002)(366004)(451199018)(83380400001)(478600001)(36756003)(186003)(54906003)(38100700002)(45080400002)(19627235002)(2906002)(66556008)(66476007)(66946007)(8676002)(4326008)(26005)(6512007)(44832011)(6506007)(66899018)(53546011)(2616005)(31696002)(5660300002)(30864003)(31686004)(316002)(110136005)(6486002)(966005)(41300700001)(8936002)(86362001)(21314003)(45980500001)(43740500002)(579004);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9349 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: VI1EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: aee2f673-2928-488b-ee59-08db1fadbc1a X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nwRiwobVMNwWKBdmM1I50T6rL8bN3fXX4yrmeREYs0m5jVVugSytV19b/5NcOtV5aLRQdQ6gNb2ZD/rnhQzlhWvousYA/M7cEstzn/X8QzSaRbIfxZP/3UDNW9JQwFMQAHdqg5ug6ffnpSSsXk0+sXIgVZT6ljD5drrxt1k/cCBiJaCxWBBtHyyIgugX0RUl3KrvUINRnEtWTOvrRdYR/LJm1XfN5a+gXd7H8paM6DwZHa2xK2UpIp6fn3doYLMDaXsXrYmpZGSXpzRy8eSI7Az6njYg5tC2VRcknDC7zycpXNjpSlfF+aSpNMBxhTLeejvItHflp8O+JymONSz0qkH4SbnzK/XIibd+CEVoeNPjz88yywNn3Qm5tHK1pf3YrC125AzF4fDV9f/01G5gcIuC9gOO6D3Jckkyv6j4ExFprBJjRK2ecN3TNcVmfyx8jPxeRe5vT+NA9uhsTL6D9HCWuqy+OIb/l/Iek2+KjkYlnnInayedWvtF1x7shx5kXl0CxRoqyqNR7zVmPlf2bf3xcwz8LgZnQOvzr3dyMrja/uJn2uX6ulfR/Fnb6nx59NefoINUWsTi714ozseXllcHoc6bIbNtUrZUtyMQnUKX5X7CqFCV+sZSUnJPIFwaqUQNWUDkuoPGInhPoHuCvE/3vnkVgO2MhhLrpz+Z8Dxh8Cj6tzlaYe2ZCdvkQ+HQ16S3Zo7Zz4yIAYnK28WHyCAq8Sk3KqPH9dbHNHW1M9v/qVJB+naN6eLUv9dkJ/AkEnjZxVKfdioU+ry0P9zwriHBE3I6/i2q4NBs+vhBh4c= 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:(13230025)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199018)(40470700004)(46966006)(36840700001)(36756003)(30864003)(8936002)(5660300002)(26005)(82740400003)(36860700001)(53546011)(6506007)(6512007)(81166007)(82310400005)(47076005)(83380400001)(336012)(2616005)(186003)(40480700001)(54906003)(19627235002)(86362001)(316002)(41300700001)(110136005)(40460700003)(70206006)(8676002)(31696002)(70586007)(4326008)(356005)(45080400002)(6486002)(966005)(478600001)(31686004)(2906002)(66899018)(44832011)(21314003)(43740500002)(579004);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2023 08:19:01.6957 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8bff063b-c245-4806-28ba-08db1fadc637 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: VI1EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9890 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Girish, Apologies for the delay in reply. Please find my response marked inline as [SAMI]. Regards, Sami Mujawar On 28/01/2023 12:09 am, Girish Mahadevan wrote: > Hi Sami > > Sorry for the long silence. I've sent you v2 of the patch (only=20 > framework not the Type17) which includes a link to a github branch. > > Few more comments inline , prefixed by [GM]. > > Best Regards > Girish > > On 10/18/2022 9:36 AM, Sami Mujawar via groups.io wrote: >> *External email: Use caution opening links or attachments* >> >> >> Hi Girish, >> >> Please find my response inline marked [SAMI]. >> >> Regards, >> >> Sami Mujawar >> >> On 04/10/2022 11:43 pm, Girish Mahadevan via groups.io wrote: >>> Hello Sami >>> >>> Thank you so much for your review, I apologize for the late response. >>> >>> My comment in line about the handle manager [GM]. >>> >>> Best Regards >>> Girish >>> >>> On 9/12/2022 8:57 AM, Sami Mujawar wrote: >>>> External email: Use caution opening links or attachments >>>> >>>> >>>> Hi Girish, >>>> >>>> Thank you for this patch and for the effort for bringing forward=20 >>>> dynamic >>>> SMBIOS generation. >>>> >>>> Please find my feedback inline marked [SAMI]. >>>> >>>> Regards, >>>> >>>> Sami Mujawar >>>> >>>> On 26/08/2022 06:37 pm, Girish Mahadevan wrote: >>>>> Add a new CM object to describe memory devices and setup a new >>>>> Generator Library for SMBIOS Type17 table. >>>>> >>>>> Signed-off-by: Girish Mahadevan >>>>> --- >>>>> =C2=A0 .../Include/ArmNameSpaceObjects.h=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 59 +++ >>>>> =C2=A0 .../SmbiosType17Lib/SmbiosType17Generator.c=C2=A0=C2=A0 | 338= =20 >>>>> ++++++++++++++++++ >>>>> =C2=A0 .../SmbiosType17Lib/SmbiosType17LibArm.inf=C2=A0=C2=A0=C2=A0 |= =C2=A0 32 ++ >>>>> =C2=A0 3 files changed, 429 insertions(+) >>>>> =C2=A0 create mode 100644=20 >>>>> DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gener= ator.c >>>>> =C2=A0 create mode 100644=20 >>>>> DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibAr= m.inf >>>>> >>>>> diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h=20 >>>>> b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h >>>>> index 102e0f96be..199a19e997 100644 >>>>> --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h >>>>> +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h >>>>> @@ -63,6 +63,7 @@ typedef enum ArmObjectID { >>>>> =C2=A0=C2=A0=C2=A0 EArmObjPciInterruptMapInfo,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ///< 39 - Pci Interrupt=20 >>>>> Map Info >>>>> =C2=A0=C2=A0=C2=A0 EArmObjRmr,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ///< 40 - Reserved Memory=20 >>>>> Range Node >>>>> =C2=A0=C2=A0=C2=A0 EArmObjMemoryRangeDescriptor,=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 ///< 41 - Memory Range=20 >>>>> Descriptor >>>>> +=C2=A0 EArmObjMemoryDeviceInfo,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ///< 42 - Memory Device=20 >>>>> Information >>>>> =C2=A0=C2=A0=C2=A0 EArmObjMax >>>>> =C2=A0 } EARM_OBJECT_ID; >>>>> >>>>> @@ -1070,6 +1071,64 @@ typedef struct CmArmRmrDescriptor { >>>>> =C2=A0=C2=A0=C2=A0 UINT64=C2=A0=C2=A0=C2=A0 Length; >>>>> =C2=A0 } CM_ARM_MEMORY_RANGE_DESCRIPTOR; >>>>> >>>>> +/** A structure that describes the physical memory device. >>>>> + >>>>> +=C2=A0 The physical memory devices on the system are described by th= is=20 >>>>> object. >>>>> + >>>>> +=C2=A0 SMBIOS Specification v3.5.0 Type17 >>>>> + >>>>> +=C2=A0 ID: EArmObjMemoryDeviceInfo, >>>>> +*/ >>>>> +typedef struct CmArmMemoryDeviceInfo { >>>> [SAMI] I think we may need a Token pointing to the Type 16 object so >>>> that the Physical Memory Array Handle can be setup, see my comment=20 >>>> below >>>> about the HandleManager. >>>>> +=C2=A0 /** Size of the device. >>>>> +=C2=A0=C2=A0=C2=A0 Size of the device in bytes. >>>>> +=C2=A0 */ >>>>> +=C2=A0 UINT64=C2=A0 Size; >>>>> + >>>>> +=C2=A0 /** Device Set */ >>>>> +=C2=A0 UINT8=C2=A0=C2=A0 DeviceSet; >>>>> + >>>>> +=C2=A0 /** Speed of the device >>>>> +=C2=A0=C2=A0=C2=A0 Speed of the device in MegaTransfers/second. >>>>> +=C2=A0 */ >>>>> +=C2=A0 UINT32=C2=A0 Speed; >>>>> + >>>>> +=C2=A0 /** Serial Number of device=C2=A0 */ >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0 *SerialNum; >>>>> + >>>>> +=C2=A0 /** AssetTag identifying the device */ >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0 *AssetTag; >>>>> + >>>>> +=C2=A0 /** Device Locator String for the device. >>>>> +=C2=A0=C2=A0 String that describes the slot or position of the devic= e on=20 >>>>> the board. >>>>> +=C2=A0=C2=A0 */ >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0 *DeviceLocator; >>>>> + >>>>> +=C2=A0 /** Bank locator string for the device. >>>>> +=C2=A0=C2=A0 String that describes the bank where the device is loca= ted. >>>>> +=C2=A0=C2=A0 */ >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0 *BankLocator; >>>>> + >>>>> +=C2=A0 /** Firmware version of the memory device */ >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0 *FirmwareVersion; >>>>> + >>>>> +=C2=A0 /** Manufacturer Id. >>>>> +=C2=A0=C2=A0 2 byte Manufacturer Id as per JEDEC Standard JEP106AV >>>>> +=C2=A0 */ >>>>> +=C2=A0 UINT16=C2=A0 ModuleManufacturerId; >>>>> + >>>>> +=C2=A0 /** Manufacturer Product Id >>>>> +=C2=A0=C2=A0 2 byte Manufacturer Id as designated by Manufacturer. >>>>> +=C2=A0 */ >>>>> +=C2=A0 UINT16=C2=A0 ModuleProductId; >>>>> + >>>>> +=C2=A0 /** Device Attributes */ >>>>> +=C2=A0 UINT8=C2=A0=C2=A0 Attributes; >>>>> + >>>>> +=C2=A0 /** Device Configured Voltage in millivolts */ >>>>> +=C2=A0 UINT16=C2=A0 ConfiguredVoltage; >>>> [SAMI] This field does not appear to be used in the generator. If the >>>> intention is to use this in the future, then it may be better to add >>>> this at a later stage. >>>>> +} CM_ARM_MEMORY_DEVICE_INFO; >>>>> + >>>>> =C2=A0 #pragma pack() >>>>> >>>>> =C2=A0 #endif // ARM_NAMESPACE_OBJECTS_H_ >>>>> diff --git=20 >>>>> a/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gen= erator.c=20 >>>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gen= erator.c=20 >>>>> >>>>> new file mode 100644 >>>>> index 0000000000..5683ca570f >>>>> --- /dev/null >>>>> +++=20 >>>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gen= erator.c >>>>> @@ -0,0 +1,338 @@ >>>>> +/** @file >>>>> +=C2=A0 SMBIOS Type17 Table Generator. >>>>> + >>>>> +=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All righ= ts=20 >>>>> reserved. >>>>> +=C2=A0 Copyright (c) 2020 - 2021, Arm Limited. All rights reserved.<= BR> >>>>> + >>>>> +=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >>>>> +**/ >>>>> + >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>> [SAMI] I could not find SmbiosType17FixupLib.h in this patch=20 >>>> series. Can >>>> you check, please? >>>>> + >>>>> +// Module specific include files. >>>>> +#include >>>>> +#include >>>>> +#include >>>>> +#include >>>> [SAMI] I think Protocol/Smbios.h may not be required in this file. Can >>>> you check, please? >>>>> +#include >>>>> + >>>>> +/** This macro expands to a function that retrieves the Memory=20 >>>>> Device >>>>> +=C2=A0=C2=A0=C2=A0 information from the Configuration Manager. >>>>> +*/ >>>>> +GET_OBJECT_LIST ( >>>>> +=C2=A0 EObjNameSpaceArm, >>>>> +=C2=A0 EArmObjMemoryDeviceInfo, >>>>> +=C2=A0 CM_ARM_MEMORY_DEVICE_INFO >>>>> +=C2=A0 ) >>>>> + >>>>> +// Default Values for Memory Device >>>>> +STATIC SMBIOS_TABLE_TYPE17 MemDeviceInfoTemplate =3D { >>>>> +=C2=A0 {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 // Hdr >>>>> +=C2=A0=C2=A0=C2=A0 EFI_SMBIOS_TYPE_MEMORY_DEVICE,=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 // Type >>>>> +=C2=A0=C2=A0=C2=A0 sizeof (SMBIOS_TABLE_TYPE17),=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 // Length >>>>> +=C2=A0=C2=A0=C2=A0 0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 // Handle >>>>> +=C2=A0 }, >>>>> +=C2=A0 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 // MemoryArrayHandle >>>> >>>> [SAMI] Do you have any thoughts on how the MemoryArrayHandle can be=20 >>>> setup? >>>> >>>> The same applies for the following MemoryErrorInformationHandle field. >>>> >>>> I think we need some sort of a HandleManager in DynamicTablesFramework >>>> that can keep track of the mappings between SMBIOS Objects and Table >>>> Handles. >>>> >>>> e.g. Smbios - HandleManager >>>> >>>> +-------------------------------+-------------------------------+ >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0 Object Token= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 | Table=20 >>>> Handle=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | >>>> >>>> +-------------------------------+-------------------------------+ >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Type16Obj_token=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | Type 16 Table handle=C2=A0=C2=A0=C2=A0 = | >>>> >>>> +-------------------------------+-------------------------------+ >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... >>>> >>>> - The Type17Object i.e. CM_ARM_MEMORY_DEVICE_INFO can then hold a=20 >>>> token >>>> for the Type16Object. >>>> >>>> =C2=A0=C2=A0- If Type 17 table is to be installed, DynamicTablemanager= shall >>>> search the SMBIOS table list to see if a Type16 table is requested=20 >>>> to be >>>> installed. >>>> >>>> - If a Type16 table is present in the list of SMBIOS table to install, >>>> the Type16 table shall be installed first and an entry is made in the >>>> Smbios HandleManager to create a mapping of Type16Obj_token <=3D=3D>= =20 >>>> Type16 >>>> Table Handle. >>>> >>>> - The Type17 table can now be built and if a the Type16Object token is >>>> provided in CM_ARM_MEMORY_DEVICE_INFO, the Smbios HandleManager=20 >>>> shall be >>>> searched (using Type16Obj_token) to retrieve the Type16 Table=20 >>>> handle and >>>> populate the Type 17 Physical Memory Array Handle field. >>>> >>>> I think we may have to experiment a bit before we arrive at the=20 >>>> correct >>>> design. However, please do let me know your thoughts on the above. >>>> >>> >>> [GM] I agree with the idea of having a map of CM_OBJECT_TOKENs to=20 >>> SMBIOS handles. I've added this to the DynamicTableFactoryProtocol. >>> >>> However when it comes to actually figuring out and adding the=20 >>> reference SMBIOS handle We've come up with a slightly different=20 >>> approach. >>> >>> If I understood what you were saying above is: >>> =C2=A0If we happen to parse a Type17 table >>> =C2=A0=C2=A0 if that Type17 table has a token to a Physical memory arra= y CM_OBJ >>> =C2=A0=C2=A0=C2=A0=C2=A0 if there is an existing Smbios Handle (look up= this handle using >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the CM_OBJECT_TOKEN) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 then use this handle. >>> =C2=A0=C2=A0=C2=A0=C2=A0 else if there is a generator for Type16 regist= ered >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 call the Type16 genera= tor code first >>> >>> IMO this gets a bit difficult to manage. Right now the=20 >>> DynamicTableManagerDxe walks the array of EStdObjSmbiosTableList CM=20 >>> objects, finds the generator for each Table, invokes it, gets an=20 >>> SMBIOS record that it then installs via the SmbiosDxe driver. >>> It seemed a bit convoluted to call the generator and install an=20 >>> SMBIOS table while within the generator of another Smbios table. >>> And if there are layers of dependencies (or multiple dependencies)=20 >>> it could add to the complexities. >>> >>> Instead what we came up with is: >>> >>> If we happen to parse a Type17 table >>> =C2=A0 if that Type17 table has a token to a Physical memory array CM_O= BJ >>> =C2=A0=C2=A0=C2=A0=C2=A0 if there is an existing Smbios Handle (look up= this handle using >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the CM_OBJECT_TOKEN ) >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 then use this handle. >>> =C2=A0=C2=A0=C2=A0=C2=A0 else if there is a generator for Type16 Regist= ered >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Generate a= n SMBIOS handle [since SmbiosDxe maintains the >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 handle DB privately I had to >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 pick a handle and check if it >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 clashes with existing records] >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Add this S= MBIOS handle to the map. >>> =C2=A0=C2=A0=C2=A0=C2=A0 else // No generator present >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Proceed without = adding any reference >>> >>> >>> Before Adding any SMBIOS table, we check if there is an existing=20 >>> SMBIOS handle for the CM_OBJECT_TOKEN (the generator will return a=20 >>> CM_OBJECT_TOKEN for each SMBIOS record created). >>> If there is an existing SMBIOS handle, pass that in, else pass in=20 >>> SMBIOS_HANDLE_PI_RESERVED and let SmbiosDxe assign the handle. >>> >>> Here is a sample implementation of this approach (it is a WIP, but I=20 >>> wanted to get your thoughts on it) >>> >>> https://github.com/tianocore/edk2/compare/master...gmahadevan:edk2-upst= ream:RFC/smbios-dyntables=20 >>> >> >> [SAMI] I had a look at the above branch and have the following=20 >> suggestions: >> >> a. To resolve the dependency order, please see my patches for SMBIOS=20 >> table dispatcher at: https://edk2.groups.io/g/devel/message/95340 > > [GM] > Thanks ! > I've setup a new patch/github branch that includes the dispatcher code=20 > and the SMBIOS string helper patch. > > The SMBIOS string helper and dispatcher code look good to me. > >> >> You should be able to apply these patches on your=20 >> 'edk2-upstream:RFC/smbios-dyntables' branch and enable the dispatcher=20 >> in ProcessSmbiosTables(). >> >> e.g. In file=20 >> DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c= ,=20 >> the SMBIOS table dispatcher can be invoked once it is initialised as=20 >> shown below. >> >> @@ -1007,19 +1007,24 @@ ProcessSmbiosTables ( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosTableCount >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> >> +=C2=A0 // Initialise the SMBIOS Table Dispatcher state machine. >> +=C2=A0 InitSmbiosTableDispatcher (SmbiosTableInfo, SmbiosTableCount); >> + >> =C2=A0=C2=A0=C2=A0 for (Idx =3D 0; Idx < SmbiosTableCount; Idx++) { >> -=C2=A0=C2=A0=C2=A0 Status =3D BuildAndInstallSmbiosTable ( >> +=C2=A0=C2=A0=C2=A0 Status =3D DispatchSmbiosTable ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 SmbiosTableInfo[Idx].TableType, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 TableFactoryProtocol, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 CfgMgrProtocol, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 SmbiosProtocol, >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 &SmbiosTableInfo[Idx] >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 SmbiosTableInfo, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 SmbiosTableCount >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 ); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (EFI_ERROR (Status)) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG (( >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to install SM= BIOS Table." \ >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " Id =3D %u Status =3D %r\n"= , >> -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosTableInfo[Idx].TableGe= neratorId, >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to dispatch S= MBIOS Table for installation." \ >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 " Table Type =3D %u Status = =3D %r\n", >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosTableInfo[Idx].TableTy= pe, >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >> >> b. With the SMBIOS dispatcher patch and the handle manager, it should=20 >> be possible to update the handles for dependent tables. This should=20 >> remove the need for the handle generation and management. >> >> c. With regards to the SMBIOS handle manager, I think it would be=20 >> better to add CM_OBJECT_ID for the SmbiosCmTokenin SMBIOS_HANDLE_MAP. >> >> d. A new SMBIOS object namespace should be defined. >> >> =C2=A0=C2=A0=C2=A0=C2=A0 e.g Namespace ID 1010b or 1100b - SMBIOS Object= s, see=20 >> https://github.com/tianocore/edk2/blob/master/DynamicTablesPkg/Include/C= onfigurationManagerObject.h#L30-L34 >> >> =C2=A0=C2=A0=C2=A0 With this change, CM_ARM_MEMORY_DEVICE_INFO becomes= =20 >> CM_SMBIOS_MEMORY_DEVICE_INFO >> >> =C2=A0=C2=A0=C2=A0=C2=A0 Similarly, EArmObjMemoryDeviceInfo becomes=20 >> ESmbiosObjMemoryDeviceInfo >> >> e. With regards to DynamicTableManager.c, I think we should split the=20 >> ACPI & SMBIOS processing in individual files (e.g. AcpiBuilder.c &=20 >> SmbiosBuilder.c) under DynamicTableManagerDxe. >> >> f. Status appears to be returned uninitialised in=20 >> DynamicTableManagerDxeInitialize(). >> >> g. DynamicTablesPkg\Library\Smbios\Arm\SmbiosType17Lib can be moved=20 >> to DynamicTablesPkg\Library\Smbios\SmbiosType17Lib. >> >> I prefer a github branch with the patch as it is very helpful to view=20 >> the code being reviewed. However, it is difficult to provide=20 >> feedback. Is it possible to submit a patch for the changes with the=20 >> link for the guthub branch in the future, please? > > [GM] > I've sent a new version of the patch minus the Type17 code as I wanted=20 > to just focus on the framework code first. > I've incorporated the comments from above except for the suggestion on=20 > using CM_OBJECT_ID instead of the CM_TOKEN for the SmbiosHandleMap. [SAMI] Sorry for not being clear in my earlier response. I meant we need=20 CM_OBJECT_ID in addition to the CM_OBJECT_TOKEN. See example below: typedef struct SmbiosHandleCmObjMap { =C2=A0 ESTD_SMBIOS_TABLE_ID=C2=A0 SmbiosTableId; =C2=A0 SMBIOS_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Smbio= sTblHandle; =C2=A0 +CM_OBJECT_ID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ObjectId; =C2=A0 CM_OBJECT_TOKEN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosCmToken; } SMBIOS_HANDLE_MAP; Otherwise it would not be possible to identify the type of object=20 pointed by SmbiosCmToken, right? [/SAMI] > IMO the CM_TOKEN is better since we can have unique tokens for cases=20 > where a single SMBIOS CM_OBJECT_ID can have multiple entries=20 > (type17/type9 etc), let me know your thoughts. [SAMI] I think I am missing something, can you explain the scenario, please= ? > > Best Regards > Girish > >> >> I am not sure if we need an edk2-staging branch for this feature. But=20 >> if you think it would be helpful then please let me know and I will=20 >> send out a request to create a new feature branch. >> >> [/SAMI] >> >>> Sorry for the long message, please let me know your thoughts. >>> >>> [/GM] >>> >>>> [SAMI] >>>>> + 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 //=20 >>>>> MemoryErrorInformationHandle >>>>> +=C2=A0 0xFFFF,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // TotalWidth >>>>> +=C2=A0 0xFFFF,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // DataWIdth >>>> >>>> [SAMI] I need to find out how these fields should be populated, but=20 >>>> the >>>> Annex A, SMBIOS specification version 3.6.0 says the following: >>>> >>>> 4.8.4 Total Width is not 0FFFFh (Unknown) if the memory device is >>>> installed. (Size is not 0.) >>>> >>>> 4.8.5 Data Width is not 0FFFFh (Unknown). >>>> >>>> Can you explain how this field is used, please? >>>> >>>> [/SAMI] >>>> >>>>> + 0x7FFF,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Size (always use=20 >>>>> Extended Size) >>>> >>>> [SAMI] I think this field should be set based on the Size. >>>> >>>> The spec says "If the size is 32 GB-1 MB or greater, the field=20 >>>> value is >>>> 7FFFh and the actual size is stored in the Extended Size field." >>>> >>>> I think it would be good to have a static function=C2=A0 that encodes = the >>>> size in wither the Size field or the Extended Size field. >>>> >>>> e.g. UpdateSmbiosTable17Size (SMBIOS_TABLE_TYPE17 *SmbiosRecord, UINTN >>>> Size) { >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (Size > 32GB= -1MB) { >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 SmbiosRecord->Size =3D EncodeSize (xxx); >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 SmbiosRecord->ExtendedSize =3D EncodeExtendedSize (xxx); >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >>>> >>>> =C2=A0=C2=A0=C2=A0=C2=A0 } >>>> >>>> [/SAMI] >>>> >>>>> + MemoryTypeUnknown,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2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A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 // TypeDetail >>>>> +=C2=A0=C2=A0=C2=A0 0 >>>>> +=C2=A0 }, >>>>> +=C2=A0 0xFFFF,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Speed (Use Ext= ended=20 >>>>> Speed) >>>> [SAMI] Maybe we need a helper function (similar to >>>> UpdateSmbiosTable17Size()) for this field as well. >>>>> + 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 // Manufacturer >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 // (Unused Use=20 >>>>> ModuleManufactuerId) >>>>> +=C2=A0 3,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2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2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 // MaximumVoltage >>>>> +=C2=A0 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 // ConfiguredVoltage >>>>> +=C2=A0 MemoryTechnologyDram,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // MemoryTe= chnology >>>> [SAMI] Should this be provided through CM_ARM_MEMORY_DEVICE_INFO? >>>>> + {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 //=20 >>>>> MemoryOperatingModeCapability >>>>> +=C2=A0=C2=A0=C2=A0 .Uint16 =3D 0x000 >>>>> +=C2=A0 }, >>>> [SAMI] I think the above initialisation may not be portable. >>>>> + 5,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A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C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 // ExtendedSpeed >>>>> +=C2=A0 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 //=20 >>>>> ExtendedConfiguredMemorySpeed >>>>> +}; >>>>> + >>>>> +STATIC CHAR8=C2=A0 UnknownStr[] =3D "Unknown\0"; >>>> [SAMI] Would it be possible to add the CONST qualifier, please? >>>>> + >>>>> +STATIC >>>>> +EFI_STATUS >>>>> +EFIAPI >>>>> +FreeSmbiosType17TableEx ( >>>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST SMBIOS_TABLE_GENERATOR= *CONST=C2=A0=C2=A0=C2=A0 This, >>>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST CM_STD_OBJ_SMBIOS_TABL= E_INFO *CONST=C2=A0=C2=A0=C2=A0=20 >>>>> SmbiosTableInfo, >>>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST EDKII_CONFIGURATION_MA= NAGER_PROTOCOL *CONST=C2=A0=C2=A0=C2=A0=20 >>>>> CfgMgrProtocol, >>>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SMBIOS_STRUC= TURE ***CONST=C2=A0 Table, >>>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST UINTN TableCount >>>>> +=C2=A0 ) >>>>> +{ >>>>> +=C2=A0 return EFI_SUCCESS; >>>>> +} >>>>> + >>>>> +/** Construct SMBIOS Type17 Table describing memory devices. >>>>> + >>>>> +=C2=A0 If this function allocates any resources then they must be fr= eed >>>>> +=C2=A0 in the FreeXXXXTableResources function. >>>>> + >>>>> +=C2=A0 @param [in]=C2=A0 This=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 Pointer to the SMBIOS table=20 >>>>> generator. >>>>> +=C2=A0 @param [in]=C2=A0 SmbiosTableInfo Pointer to the SMBIOS table= =20 >>>>> information. >>>>> +=C2=A0 @param [in]=C2=A0 CfgMgrProtocol=C2=A0 Pointer to the Configu= ration Manager >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Protocol interface. >>>>> +=C2=A0 @param [out] Table=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 Pointer to the SMBIOS table. >>>>> + >>>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 Table generated successfully. >>>>> +=C2=A0 @retval EFI_BAD_BUFFER_SIZE=C2=A0=C2=A0=C2=A0 The size return= ed by the=20 >>>>> Configuration >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Manager is less than th= e Object=20 >>>>> size for >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 the requested object. >>>>> +=C2=A0 @retval EFI_INVALID_PARAMETER=C2=A0 A parameter is invalid. >>>>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 Could not find information. >>>>> +=C2=A0 @retval EFI_OUT_OF_RESOURCES=C2=A0=C2=A0 Could not allocate m= emory. >>>>> +=C2=A0 @retval EFI_UNSUPPORTED=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 Unsupported configuration. >>>>> +**/ >>>>> +STATIC >>>>> +EFI_STATUS >>>>> +EFIAPI >>>>> +BuildSmbiosType17TableEx ( >>>>> +=C2=A0 IN=C2=A0 CONST SMBIOS_TABLE_GENERATOR=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *This, >>>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CM_STD_OBJ_SMBIO= S_TABLE_INFO *CONST=C2=A0 SmbiosTableInfo, >>>>> +=C2=A0 IN=C2=A0 CONST EDK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C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *B= ankLocator; >>>>> +=C2=A0 UINTN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Fi= rmwareVersionLen; >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *F= irmwareVersion; >>>>> +=C2=A0 CHAR8=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *O= ptionalStrings; >>>>> +=C2=A0 SMBIOS_TABLE_TYPE17=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= *SmbiosRecord; >>>>> + >>>>> +=C2=A0 ASSERT (This !=3D NULL); >>>>> +=C2=A0 ASSERT (SmbiosTableInfo !=3D NULL); >>>>> +=C2=A0 ASSERT (CfgMgrProtocol !=3D NULL); >>>>> +=C2=A0 ASSERT (Table !=3D NULL); >>>>> +=C2=A0 ASSERT (TableCount !=3D NULL); >>>>> +=C2=A0 ASSERT (SmbiosTableInfo->TableGeneratorId =3D=3D This->Genera= torID); >>>>> + >>>>> +=C2=A0 DEBUG ((DEBUG_ERROR, "%a : Start \n", __FUNCTION__)); >>>>> +=C2=A0 *Table =3D NULL; >>>>> +=C2=A0 Status =3D GetEArmObjMemoryDeviceInfo ( >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 CfgMgrProtocol, >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 CM_NULL_TOKEN, >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 &MemoryDevicesInfo, >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 &NumMemDevices >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 ); >>>>> +=C2=A0 if (EFI_ERROR (Status)) { >>>>> +=C2=A0=C2=A0=C2=A0 DEBUG (( >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DEBUG_ERROR, >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "Failed to get Memory Devices CM Obje= ct %r\n", >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 )); >>>>> +=C2=A0=C2=A0=C2=A0 return Status; >>>>> +=C2=A0 } >>>>> + >>>>> +=C2=A0 TableList =3D (SMBIOS_STRUCTURE **)AllocateZeroPool (sizeof= =20 >>>>> (SMBIOS_STRUCTURE *) * NumMemDevices); >>>> [SAMI] The memory allocated here should be freed in >>>> FreeSmbiosType17TableEx. >>>>> +=C2=A0 if (TableList =3D=3D NULL) { >>>>> +=C2=A0=C2=A0=C2=A0 DEBUG ((DEBUG_ERROR, "Failed to alloc memory for = %u devices=20 >>>>> table\n")); >>>>> +=C2=A0=C2=A0=C2=A0 Status =3D EFI_OUT_OF_RESOURCES; >>>>> +=C2=A0=C2=A0=C2=A0 goto exit; >>>>> +=C2=A0 } >>>>> + >>>>> +=C2=A0 for (Index =3D 0; Index < NumMemDevices; Index++) { >>>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].SerialNum !=3D NULL)= { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNumLen =3D AsciiStrLen=20 >>>>> (MemoryDevicesInfo[Index].SerialNum); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D Memor= yDevicesInfo[Index].SerialNum; >>>>> +=C2=A0=C2=A0=C2=A0 } else { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNumLen =3D AsciiStrLen (Unknown= Str); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D Unkno= wnStr; >>>> >>>> [SAMI] If the serial number is not provided, then should the string >>>> field be set to 0? >>>> >>>> See Section 6.1.3, SMBIOS Spec Version 3.6.0 which states >>>> >>>> "If a string field references no string, a null (0) is placed in that >>>> string field." >>>> >>>> [/SAMI] >>>> >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].AssetTag !=3D NULL) = { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTagLen =3D AsciiStrLen (MemoryDe= vicesInfo[Index].AssetTag); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D Memory= DevicesInfo[Index].AssetTag; >>>>> +=C2=A0=C2=A0=C2=A0 } else { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTagLen =3D AsciiStrLen (UnknownS= tr); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D Unknow= nStr; >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].DeviceLocator !=3D N= ULL) { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocatorLen =3D AsciiStrLen=20 >>>>> (MemoryDevicesInfo[Index].DeviceLocator); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocator=C2=A0=C2=A0=C2=A0 =3D M= emoryDevicesInfo[Index].DeviceLocator; >>>>> +=C2=A0=C2=A0=C2=A0 } else { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocatorLen =3D AsciiStrLen (Unk= nownStr); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocator=C2=A0=C2=A0=C2=A0 =3D U= nknownStr; >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].BankLocator !=3D NUL= L) { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocatorLen =3D AsciiStrLen=20 >>>>> (MemoryDevicesInfo[Index].BankLocator); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocator=C2=A0=C2=A0=C2=A0 =3D Mem= oryDevicesInfo[Index].BankLocator; >>>>> +=C2=A0=C2=A0=C2=A0 } else { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocatorLen =3D AsciiStrLen (Unkno= wnStr); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocator=C2=A0=C2=A0=C2=A0 =3D Unk= nownStr; >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].FirmwareVersion !=3D= NULL) { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersionLen =3D AsciiStrLen=20 >>>>> (MemoryDevicesInfo[Index].FirmwareVersion); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersion=C2=A0=C2=A0=C2=A0 =3D= MemoryDevicesInfo[Index].FirmwareVersion; >>>>> +=C2=A0=C2=A0=C2=A0 } else { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersionLen =3D AsciiStrLen (U= nknownStr); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersion=C2=A0=C2=A0=C2=A0 =3D= UnknownStr; >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord =3D (SMBIOS_TABLE_TYPE17 *)AllocateZ= eroPool ( >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 sizeof=20 >>>>> (SMBIOS_TABLE_TYPE17) + >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNumLen + 1 + >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTagLen + 1 +=20 >>>>> DeviceLocatorLen + 1 + >>>>> + BankLocatorLen + 1 + FirmwareVersionLen + 1 + 1 >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ); >>>> [SAMI] The memory allocated here needs to be freed in >>>> FreeSmbiosType17TableEx as=C2=A0 SmbiosProtocol->Add () makes a copy o= f the >>>> SmbiosTable, see >>>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgi= thub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSm= biosDxe%2FSmbiosDxe.c%23L476&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7= C1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C= 0%7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi= V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DEnTxn07e= kjA7bGUeCg2c0BaUMVW0yU5JFjXNOcZuhQA%3D&reserved=3D0=20 >>>> >>>> and >>>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgi= thub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSm= biosDxe%2FSmbiosDxe.c%23L516&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7= C1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C= 0%7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoi= V2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dd6kU6Cdy= wK4fnOdxE8CyTTM9eQHDE38FzZB7SA2FTqc%3D&reserved=3D0.=20 >>>> >>>> >>>>> +=C2=A0=C2=A0=C2=A0 if (SmbiosRecord =3D=3D NULL) { >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Status =3D EFI_OUT_OF_RESOURCES; >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto exit; >>>>> +=C2=A0=C2=A0=C2=A0 } >>>>> + >>>>> +=C2=A0=C2=A0=C2=A0 CopyMem (SmbiosRecord, &MemDeviceInfoTemplate, si= zeof=20 >>>>> (SMBIOS_TABLE_TYPE17)); >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedSize=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D=20 >>>>> MemoryDevicesInfo[Index].Size; >>>> >>>> [SAMI] CM_ARM_MEMORY_DEVICE_INFO.Size is documented as size in bytes, >>>> while looking at the SMBIOS specification, section 7.18.5 for the >>>> Extended Size Bits 30:0 represent the size of the memory device in >>>> megabytes. >>>> >>>> I think it will be useful to create UpdateSmbiosTable17Size() which=20 >>>> does >>>> the appropriate encoding and updation of the SMBIOS table fieds. >>>> >>>> [/SAMI] >>>> >>>>> + SmbiosRecord->DeviceSet=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0 =3D=20 >>>>> MemoryDevicesInfo[Index].DeviceSet; >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ModuleManufacturerID =3D >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemoryDevicesInfo[Index].ModuleManufa= cturerId; >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ModuleProductID =3D >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemoryDevicesInfo[Index].ModuleProduc= tId; >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->Attributes =3D >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemoryDevicesInfo[Index].Attributes; >>>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedSpeed =3D MemoryDevicesInfo= [Index].Speed; >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D (CHAR8 *)(SmbiosRecord + 1); >>>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, DeviceLocatorLen + = 1,=20 >>>>> DeviceLocator); >>>> [SAMI] I think we can simplify the publishing of the SMBIOS strings >>>> using SmbiosStringTableLib. Please see the patch at >>>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fed= k2.groups.io%2Fg%2Fdevel%2Fmessage%2F93651&data=3D05%7C01%7Cgmahadevan%= 40nvidia.com%7C1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd= 9ccc17a%7C0%7C0%7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLj= AwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sd= ata=3D4xHMP2KfNlcdeBrtH%2FIT1F249uWIoz0XZreF3FSugq8%3D&reserved=3D0=20 >>>> >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + DeviceLocat= orLen + 1; >>>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, BankLocatorLen + 1,= BankLocator); >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + BankLocator= Len + 1; >>>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, SerialNumLen + 1, S= erialNum); >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + SerialNumLe= n + 1; >>>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, AssetTagLen + 1, As= setTag); >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + AssetTagLen= + 1; >>>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, FirmwareVersionLen = + 1,=20 >>>>> FirmwareVersion); >>>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings=C2=A0 =3D OptionalStrings + Firmw= areVersionLen + 1; >>>>> +=C2=A0=C2=A0=C2=A0 TableList[Index] =3D (SMBIOS_STRUCTURE *)SmbiosRe= cord; >>>>> +=C2=A0 } >>>>> + >>>>> +=C2=A0 *Table=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D TableList; >>>>> +=C2=A0 *TableCount =3D NumMemDevices; >>>>> + >>>>> +exit: >>>>> +=C2=A0 DEBUG ((DEBUG_ERROR, "%a : Done \n", __FUNCTION__)); >>>>> +=C2=A0 return Status; >>>>> +} >>>>> + >>>>> +/** The interface for the SMBIOS Type17 Table Generator. >>>>> +*/ >>>>> +STATIC >>>>> +CONST >>>>> +SMBIOS_TABLE_GENERATOR=C2=A0 SmbiosType17Generator =3D { >>>>> +=C2=A0 // Generator ID >>>>> +=C2=A0 CREATE_STD_SMBIOS_TABLE_GEN_ID (EStdSmbiosTableIdType17), >>>>> +=C2=A0 // Generator Description >>>>> +=C2=A0 L"SMBIOS.TYPE17.GENERATOR", >>>>> +=C2=A0 // SMBIOS Table Type >>>>> +=C2=A0 EFI_SMBIOS_TYPE_MEMORY_DEVICE, >>>>> +=C2=A0 NULL, >>>>> +=C2=A0 NULL, >>>>> +=C2=A0 // Build table function Extended. >>>>> +=C2=A0 BuildSmbiosType17TableEx, >>>>> +=C2=A0 // Free function Extended. >>>>> +=C2=A0 FreeSmbiosType17TableEx >>>>> +}; >>>>> + >>>>> +/** Register the Generator with the SMBIOS Table Factory. >>>>> + >>>>> +=C2=A0 @param [in]=C2=A0 ImageHandle=C2=A0 The handle to the image. >>>>> +=C2=A0 @param [in]=C2=A0 SystemTable=C2=A0 Pointer to the System Tab= le. >>>>> + >>>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 The Generator is registered. >>>>> +=C2=A0 @retval EFI_INVALID_PARAMETER A parameter is invalid. >>>>> +=C2=A0 @retval EFI_ALREADY_STARTED=C2=A0=C2=A0 The Generator for the= Table ID >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 is already registered. >>>>> +**/ >>>>> +EFI_STATUS >>>>> +EFIAPI >>>>> +SmbiosType17LibConstructor ( >>>>> +=C2=A0 IN=C2=A0 EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ImageHandle, >>>>> +=C2=A0 IN=C2=A0 EFI_SYSTEM_TABLE=C2=A0 *SystemTable >>>>> +=C2=A0 ) >>>>> +{ >>>>> +=C2=A0 EFI_STATUS=C2=A0 Status; >>>>> + >>>>> +=C2=A0 Status =3D RegisterSmbiosTableGenerator (&SmbiosType17Generat= or); >>>>> +=C2=A0 DEBUG (( >>>>> +=C2=A0=C2=A0=C2=A0 DEBUG_INFO, >>>>> +=C2=A0=C2=A0=C2=A0 "SMBIOS Type 17: Register Generator. Status =3D %= r\n", >>>>> +=C2=A0=C2=A0=C2=A0 Status >>>>> +=C2=A0=C2=A0=C2=A0 )); >>>>> +=C2=A0 ASSERT_EFI_ERROR (Status); >>>>> + >>>>> +=C2=A0 return Status; >>>>> +} >>>>> + >>>>> +/** Deregister the Generator from the SMBIOS Table Factory. >>>>> + >>>>> +=C2=A0 @param [in]=C2=A0 ImageHandle=C2=A0 The handle to the image. >>>>> +=C2=A0 @param [in]=C2=A0 SystemTable=C2=A0 Pointer to the System Tab= le. >>>>> + >>>>> +=C2=A0 @retval EFI_SUCCESS=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 The Generator is deregistered. >>>>> +=C2=A0 @retval EFI_INVALID_PARAMETER A parameter is invalid. >>>>> +=C2=A0 @retval EFI_NOT_FOUND=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 The Generator is not registered. >>>>> +**/ >>>>> +EFI_STATUS >>>>> +EFIAPI >>>>> +SmbiosType17LibDestructor ( >>>>> +=C2=A0 IN=C2=A0 EFI_HANDLE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ImageHandle, >>>>> +=C2=A0 IN=C2=A0 EFI_SYSTEM_TABLE=C2=A0 *SystemTable >>>>> +=C2=A0 ) >>>>> +{ >>>>> +=C2=A0 EFI_STATUS=C2=A0 Status; >>>>> + >>>>> +=C2=A0 Status =3D DeregisterSmbiosTableGenerator (&SmbiosType17Gener= ator); >>>>> +=C2=A0 DEBUG (( >>>>> +=C2=A0=C2=A0=C2=A0 DEBUG_INFO, >>>>> +=C2=A0=C2=A0=C2=A0 "SMBIOS Type17: Deregister Generator. Status =3D = %r\n", >>>>> +=C2=A0=C2=A0=C2=A0 Status >>>>> +=C2=A0=C2=A0=C2=A0 )); >>>>> +=C2=A0 ASSERT_EFI_ERROR (Status); >>>>> +=C2=A0 return Status; >>>>> +} >>>>> diff --git=20 >>>>> a/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Lib= Arm.inf=20 >>>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Lib= Arm.inf=20 >>>>> >>>>> new file mode 100644 >>>>> index 0000000000..78a80b75f0 >>>>> --- /dev/null >>>>> +++=20 >>>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Lib= Arm.inf >>>>> @@ -0,0 +1,32 @@ >>>>> +## @file >>>>> +# SMBIOS Type17 Table Generator >>>>> +# >>>>> +#=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All=20 >>>>> rights reserved. >>>>> +#=C2=A0 Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.=
>>>>> +# >>>>> +#=C2=A0 SPDX-License-Identifier: BSD-2-Clause-Patent >>>>> +## >>>>> + >>>>> +[Defines] >>>>> +=C2=A0 INF_VERSION=C2=A0=C2=A0=C2=A0 =3D 0x0001001B >>>>> +=C2=A0 BASE_NAME=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D SmbiosType17LibAr= m >>>>> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1f063bac-f8f1-4e0= 8-8ffd-9aae52c75497 >>>>> +=C2=A0 VERSION_STRING =3D 1.0 >>>>> +=C2=A0 MODULE_TYPE=C2=A0=C2=A0=C2=A0 =3D DXE_DRIVER >>>>> +=C2=A0 LIBRARY_CLASS=C2=A0 =3D NULL|DXE_DRIVER >>>>> +=C2=A0 CONSTRUCTOR=C2=A0=C2=A0=C2=A0 =3D SmbiosType17LibConstructor >>>>> +=C2=A0 DESTRUCTOR=C2=A0=C2=A0=C2=A0=C2=A0 =3D SmbiosType17LibDestruc= tor >>>>> + >>>>> +[Sources] >>>>> +=C2=A0 SmbiosType17Generator.c >>>>> + >>>>> +[Packages] >>>>> +=C2=A0 MdePkg/MdePkg.dec >>>>> +=C2=A0 MdeModulePkg/MdeModulePkg.dec >>>>> +=C2=A0 EmbeddedPkg/EmbeddedPkg.dec >>>>> +=C2=A0 ArmPlatformPkg/ArmPlatformPkg.dec >>>>> +=C2=A0 DynamicTablesPkg/DynamicTablesPkg.dec >>>>> + >>>>> +[LibraryClasses] >>>>> +=C2=A0 BaseLib >>>>> +=C2=A0 DebugLib >>> >>> >>> >>> >>> >>=20