From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.53]) by mx.groups.io with SMTP id smtpd.web10.2991.1674864557213209758 for ; Fri, 27 Jan 2023 16:09:17 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=VGlle88f; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: nvidia.com, ip: 40.107.223.53, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RG9tQx//xp/IFJIKWW1vjX1v9sp6rs+dTQNS5qn+2ZuDQzg56bw/Zp/8IcrKiU01yIP2geGWGA+wA5zG2lWWUhtzraBiaQ4T7HMSKqE8aZ+PESeFyvgdFXCpuYfiuaMmSmfJetFxweWbJ4QwRdahqEaisQx0bOTRtgTNPTFjeaDdrkk9tX0oOSNk1ympJ0DgKeB8J+Fz9kMBv11Hi5Fc/4doORKleBmbX/rgsftbjF7SjM6Zip1HGf16XowVAfzbyJfxDjOw8ZgelXkjKICcIzWL4U54jpQv8kAAzGA12UAwLTWI2ei9FgBn05uxDtT3o83a+wmHTr5d2H+2dHTFSw== 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=okjznwXwRGTqKa0MNMUXEgfd5H2U4xQzBMFu5WhuS9Q=; b=TpXzC1eJzrwG6s5vi/rB+gdhVkX3Aez4LWuU1FNeKK55nmrfXh6vMmn+P4/DEIRJURmKh8v58Q01KS6QKWxQbsNMDu+qnjD0XEDtyD8xLO+0OfwH8IVJKEJpUSZtv6tkNM4A1+bkXjKqWbpd/vbUJLGJktjKuvMky5Y8Y2tHjS8ZH36XR+nsjUOSaNF+DL5YsTULQ6+rL/jKgHGDRkV9K7xeyDC+rhjDb3E1ANwOMT20HGCifAmZpVtjX6RQfKefWU5Yn+Mq3Hulber0Aur8cSFE7oTISAGohQGstEnOEjcQ8mzix0quQh8SbE97LXWcp3OSDM37aVEKwn3CMo2abQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=okjznwXwRGTqKa0MNMUXEgfd5H2U4xQzBMFu5WhuS9Q=; b=VGlle88fDvvzAiOD4IqonVqn9frGRq+Mk/s6VZpiEIhXyRWuAUkYmNm4HnpMXrrcUk/hdiGptpRM8lRLh53HKPrj/3QPw9eBeHp0QRYiM42s/HFuGwvE/uv/uYN4JK8BycKSq2mRHI8hou3l/XyPxpFVRsvbtcOEsr8PYfErA/BXoJlqJxv8uoVZHau9ryQ/z4VYxYUVk8twl4MsRgr7EC5GcC62kdBfsdrMgLwwXaWzxwnR/kujYpJx5P1UbbZbPvR2qv4GmyEgUjqIa3fMrZPR4/Klo4S+19xumvmd2J0x7uh3GU8NWH9uIm4QXwiPnaL8wJe7OzXxI8aW3dMNRA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) by SA3PR12MB7878.namprd12.prod.outlook.com (2603:10b6:806:31e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Sat, 28 Jan 2023 00:09:14 +0000 Received: from CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::41d1:95ad:101e:7491]) by CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::41d1:95ad:101e:7491%6]) with mapi id 15.20.6043.022; Sat, 28 Jan 2023 00:09:14 +0000 Message-ID: <4b32fed8-4c50-1f56-ad5e-ed6feefbfb01@nvidia.com> Date: Fri, 27 Jan 2023 17:09:09 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [edk2-devel] [PATCH 2/2] DynamicTablesPkg: Add Smbios Type17 Table generator To: devel@edk2.groups.io, sami.mujawar@arm.com, 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" References: <90bcdad9b53f1ca184a857da720aac1ab89882f7.1661534045.git.gmahadevan@nvidia.com> <2204e785-d05a-a47d-2da6-a9b6b8e608a0@nvidia.com> From: "Girish Mahadevan" In-Reply-To: X-ClientProxiedBy: BN9PR03CA0707.namprd03.prod.outlook.com (2603:10b6:408:ef::22) To CY5PR12MB6297.namprd12.prod.outlook.com (2603:10b6:930:22::19) Return-Path: gmahadevan@nvidia.com MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6297:EE_|SA3PR12MB7878:EE_ X-MS-Office365-Filtering-Correlation-Id: 55d5b9d1-a8db-4b14-783e-08db00c3e3a3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BV2yTARik/n7nLHn2Bu/7+nvn9PM/YlqC8GMHHwZgINRJW3gHcQkrUg1ThvkZrVdGMYH/BPXJmjxjojC4trnBtleKIuOoC8rCt8oUOLshXGzi1VyOjqjQR/dugOLFrQFeHE+Z7FHX7oVmM6fMab730qzP8st5Io/XwQc4O2JNUGgMzefeqYU/I966e8jfVNBEWeuFQqEM/CB8UClOfX/udht7WGKPPKGFErHKdJmw2Dea0ZGTfFq6ZvjnTfA8lV/EVOSj2vG/aUSw+l850/hnjVKZppa+TqliXCxJaGe2qCanFhhJyBTsbVLMFf8iT7fiB++YAaDFTXSGkj/3WpaW49txsveHmB1qoeBqrp2ckpYKT8qrlY7tBJsxPwqyfu1aCa1/X6Jhkc0vBX2yMg3DIzpKEwDsQFNEHRDKBEVsNvtu227YhPy0N9ztvYKca2ibr3DpWXKK3ucmiL1nBlUag4B9xqmNlRj4Y1svcYQvFNP76unlsmjOe31qqSnicDgitKu46e+s4HU9BDA8CxY4wPLy+OOiRTFCuAxFjq01CO4a51L939aOGKkQNz3V0LolXDoYulE1+8g++fOcl3QUIIOd31kVXulnOz3rWukEm0G1QzgxPF+ud9LBFt68dJsQLipIzoh/XILVSJon6G/mbIgPSa26skLO1Xa5sszkTdydQGZvMYmx5PKtb5ZBb7XfUqyECn3P6vFyQ/qLIOyGxmeHhl9B7v5gHf7fNrrSt9P7I/XgK+gHyBlcCW9/QTjXgaAes/Z7HkHY8ug3sWBISCbdUSLhmBMnPx46cVBfvrA6umQ/CvRPxYXFPv/CdX7/irqQsKc5EC5cRFYQh3W1A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY5PR12MB6297.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(376002)(39860400002)(396003)(136003)(346002)(366004)(451199018)(36756003)(7416002)(5660300002)(966005)(66476007)(31696002)(8676002)(30864003)(4326008)(2906002)(66946007)(41300700001)(8936002)(86362001)(38100700002)(19627235002)(31686004)(316002)(54906003)(110136005)(45080400002)(6506007)(478600001)(6486002)(83380400001)(53546011)(6512007)(2616005)(66556008)(6666004)(186003)(26005)(66899018)(21314003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-Chun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?ntkrQwfwGkCTLSPwINUmbjojNE1ozvqxoO4a4VnBwdrE7jM1lgD4a0TDWZZt?= =?us-ascii?Q?Cm9SIjH0Ks4aPBRETh3RB86MhxfGA6h6/+lUR4Yh7zaACi4Yy2Z3zQfoR4jI?= =?us-ascii?Q?aygkcs/aSWe7qThR04FLa2nUBoN0zpU53omxt45JWiowYStJam6HFFp6C593?= =?us-ascii?Q?u/Ki4d9XyY9DAkPBAHZrgzXQcHSn3ZfBfG2VRqPWdvnML0mMQQbamJOSW2G7?= =?us-ascii?Q?K35F3jUdHpEnNuxkXnKuEFXX7XT/ZFkkHnadAnaLqWCuynVpG2amQMEqUuIT?= =?us-ascii?Q?ic8eIX7RUwIXBBnAYPvlOiN0iIMVB6DIs2OWGM/D5fo72zupVbu7qcn6K4YT?= =?us-ascii?Q?9Pqn9Py0pla5QyYza/mElpHlT7sspU96HLYZcvmpIOF065H+4TK8tsZgzrxD?= =?us-ascii?Q?Gc1ajSpQXsrI+BkmaxrmNDpiGTKtTHEtfWlxdKiUHd+SSlO5P2Uvl1ljUBs/?= =?us-ascii?Q?7BOIDzqzl8tKfhXeaT7qGyFzvugz+57ITCIuIB/41smxbHrzDqf+rHjQm+Oz?= =?us-ascii?Q?ycAPbiMcU9THHqwOHf6F+GZzSa/bGrrmO0Nr6499FcUwx8Qhr4SuvqtXZ4LP?= =?us-ascii?Q?SkFRKSM94gN5gDNz81SsZQkQrigRc05cz3exenzQmu51oXnjlRs5NAficf6f?= =?us-ascii?Q?wLWbUUwIG2CJBvttpuxbHxUQbVvTW43gsq8XX955roR1IwcKgXcwa3IyawRE?= =?us-ascii?Q?Elv2bMPOUoWBScIjc0QITMWAv+97gxJoTfC8mq5GBCYb27w5WYQLdh4mDW1K?= =?us-ascii?Q?ag=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55d5b9d1-a8db-4b14-783e-08db00c3e3a3 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jan 2023 00:09:14.3164 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: SRpSJaXhfP83Y3ri2gECr0vSe2n2AT/qpSWqchlkaxAYKKmvABg1dKNfwCNBUL/AJPPmJMr0gtDJuvzm7TAn+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7878 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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* >=20 >=20 > Hi Girish, >=20 > Please find my response inline marked [SAMI]. >=20 > Regards, >=20 > Sami Mujawar >=20 > 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 dynami= c >>> 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/SmbiosType17Genera= tor.c >>>> =C2=A0 create mode 100644=20 >>>> DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibArm= .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 Map=20 >>>> 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 thi= s=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 belo= w >>> 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 device= on the=20 >>>> 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 locat= ed. >>>> +=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/SmbiosType17Gene= rator.c b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17G= enerator.c >>>> new file mode 100644 >>>> index 0000000000..5683ca570f >>>> --- /dev/null >>>> +++=20 >>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gene= rator.c >>>> @@ -0,0 +1,338 @@ >>>> +/** @file >>>> +=C2=A0 SMBIOS Type17 Table Generator. >>>> + >>>> +=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All right= s=20 >>>> reserved. >>>> +=C2=A0 Copyright (c) 2020 - 2021, Arm Limited. All rights reserved. >>>> + >>>> +=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 series. Ca= n >>> 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 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 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 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 to b= e >>> 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=C2=A0 <=3D= =3D> 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 shall b= e >>> searched (using Type16Obj_token) to retrieve the Type16 Table handle an= d >>> populate the Type 17 Physical Memory Array Handle field. >>> >>> I think we may have to experiment a bit before we arrive at the 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 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 array= 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 registe= red >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 call the Type16 generat= or 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 SMBIOS= =20 >> table while within the generator of another Smbios table. >> And if there are layers of dependencies (or multiple dependencies) it=20 >> 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_OB= J >> =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 Registe= red >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Generate an= 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 SM= BIOS 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 a= dding 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-upstr= eam:RFC/smbios-dyntables >=20 > [SAMI] I had a look at the above branch and have the following suggestion= s: >=20 > 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. >=20 > You should be able to apply these patches on your=20 > 'edk2-upstream:RFC/smbios-dyntables' branch and enable the dispatcher in= =20 > ProcessSmbiosTables(). >=20 > e.g. In file=20 > DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c,= the SMBIOS table dispatcher can be invoked once it is initialised as shown= below. >=20 > @@ -1007,19 +1007,24 @@ ProcessSmbiosTables ( > =C2=A0=C2=A0=C2=A0=C2=A0 SmbiosTableCount > =C2=A0=C2=A0=C2=A0=C2=A0 )); >=20 > +=C2=A0 // Initialise the SMBIOS Table Dispatcher state machine. > +=C2=A0 InitSmbiosTableDispatcher (SmbiosTableInfo, SmbiosTableCount); > + > =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 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 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 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 if (EFI_ERROR (Status)) { > =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 DEBUG_ERROR, > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to install SMB= IOS 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].TableGen= eratorId, > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "ERROR: Failed to dispatch SM= BIOS 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].TableTyp= e, > =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 } >=20 > b. With the SMBIOS dispatcher patch and the handle manager, it should be= =20 > possible to update the handles for dependent tables. This should remove= =20 > the need for the handle generation and management. >=20 > c. With regards to the SMBIOS handle manager, I think it would be better= =20 > to add CM_OBJECT_ID for the SmbiosCmTokenin SMBIOS_HANDLE_MAP. >=20 > d. A new SMBIOS object namespace should be defined. >=20 > =C2=A0=C2=A0=C2=A0 e.g Namespace ID 1010b or 1100b - SMBIOS Objects, see= =20 > https://github.com/tianocore/edk2/blob/master/DynamicTablesPkg/Include/Co= nfigurationManagerObject.h#L30-L34 >=20 > =C2=A0=C2=A0 With this change, CM_ARM_MEMORY_DEVICE_INFO becomes=20 > CM_SMBIOS_MEMORY_DEVICE_INFO >=20 > =C2=A0=C2=A0=C2=A0 Similarly, EArmObjMemoryDeviceInfo becomes ESmbiosObj= MemoryDeviceInfo >=20 > 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. >=20 > f. Status appears to be returned uninitialised in=20 > DynamicTableManagerDxeInitialize(). >=20 > g. DynamicTablesPkg\Library\Smbios\Arm\SmbiosType17Lib can be moved to=20 > DynamicTablesPkg\Library\Smbios\SmbiosType17Lib. >=20 > 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 feedback.=20 > Is it possible to submit a patch for the changes with the link for the=20 > 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. 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. Best Regards Girish >=20 > I am not sure if we need an edk2-staging branch for this feature. But if= =20 > you think it would be helpful then please let me know and I will send=20 > out a request to create a new feature branch. >=20 > [/SAMI] >=20 >> Sorry for the long message, please let me know your thoughts. >> >> [/GM] >> >>> [SAMI] >>>> +=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 //=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 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] >>> >>>> +=C2=A0 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 u= se=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 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 t= he >>> 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] >>> >>>> +=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=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=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 Speed) >>> [SAMI] Maybe we need a helper function (similar to >>> UpdateSmbiosTable17Size()) for this field as well. >>>> +=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 // 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=C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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=C2=A0=C2=A0=C2= =A0=C2=A0=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=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. >>>> +=C2=A0 5,=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= // LogicalSize >>>> +=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= // 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= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *CONST =20 >>>> This, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST CM_STD_OBJ_SMBIOS_TABLE= _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 *CONST =20 >>>> SmbiosTableInfo, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST EDKII_CONFIGURATION_MAN= AGER_PROTOCOL=C2=A0=C2=A0=C2=A0=C2=A0 *CONST =20 >>>> CfgMgrProtocol, >>>> +=C2=A0 IN OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SMBIOS_STRUCT= URE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 **= *CONST =20 >>>> Table, >>>> +=C2=A0 IN=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 CONST UINTN = =20 >>>> 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 fre= ed >>>> +=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 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 Configur= ation 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 returne= d 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 the O= bject=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 me= mory. >>>> +=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 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=A0=C2=A0=C2=A0=C2=A0=C2=A0 *Firm= wareVersion; >>>> +=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 *Opti= onalStrings; >>>> +=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->Generat= orID); >>>> + >>>> +=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 Objec= t %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 (MemoryDe= vicesInfo[Index].SerialNum); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D Memory= DevicesInfo[Index].SerialNum; >>>> +=C2=A0=C2=A0=C2=A0 } else { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNumLen =3D AsciiStrLen (UnknownS= tr); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D Unknow= nStr; >>> >>> [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 (MemoryDev= icesInfo[Index].AssetTag); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D MemoryD= evicesInfo[Index].AssetTag; >>>> +=C2=A0=C2=A0=C2=A0 } else { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTagLen =3D AsciiStrLen (UnknownSt= r); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D Unknown= Str; >>>> +=C2=A0=C2=A0=C2=A0 } >>>> + >>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].DeviceLocator !=3D NU= LL) { >>>> +=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 Me= moryDevicesInfo[Index].DeviceLocator; >>>> +=C2=A0=C2=A0=C2=A0 } else { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocatorLen =3D AsciiStrLen (Unkn= ownStr); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocator=C2=A0=C2=A0=C2=A0 =3D Un= knownStr; >>>> +=C2=A0=C2=A0=C2=A0 } >>>> + >>>> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].BankLocator !=3D NULL= ) { >>>> +=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 Memo= ryDevicesInfo[Index].BankLocator; >>>> +=C2=A0=C2=A0=C2=A0 } else { >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocatorLen =3D AsciiStrLen (Unknow= nStr); >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocator=C2=A0=C2=A0=C2=A0 =3D Unkn= ownStr; >>>> +=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 (Un= knownStr); >>>> +=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 *)AllocateZe= roPool ( >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=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 BankLocatorLen + 1 +=20 >>>> 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 of= the >>> SmbiosTable, see >>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit= hub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSmb= iosDxe%2FSmbiosDxe.c%23L476&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7C= 1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0= %7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV= 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DEnTxn07ek= jA7bGUeCg2c0BaUMVW0yU5JFjXNOcZuhQA%3D&reserved=3D0 >>> and >>> https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit= hub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSmb= iosDxe%2FSmbiosDxe.c%23L516&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7C= 1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0= %7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV= 2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dd6kU6Cdyw= K4fnOdxE8CyTTM9eQHDE38FzZB7SA2FTqc%3D&reserved=3D0. >>> >>>> +=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, siz= eof=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 doe= s >>> the appropriate encoding and updation of the SMBIOS table fieds. >>> >>> [/SAMI] >>> >>>> +=C2=A0=C2=A0=C2=A0 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].ModuleManufac= turerId; >>>> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ModuleProductID =3D >>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemoryDevicesInfo[Index].ModuleProduct= Id; >>>> +=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%2Fedk= 2.groups.io%2Fg%2Fdevel%2Fmessage%2F93651&data=3D05%7C01%7Cgmahadevan%4= 0nvidia.com%7C1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9= ccc17a%7C0%7C0%7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjA= wMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sda= ta=3D4xHMP2KfNlcdeBrtH%2FIT1F249uWIoz0XZreF3FSugq8%3D&reserved=3D0 >>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + DeviceLocato= rLen + 1; >>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, BankLocatorLen + 1, = BankLocator); >>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + BankLocatorL= en + 1; >>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, SerialNumLen + 1, Se= rialNum); >>>> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + SerialNumLen= + 1; >>>> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, AssetTagLen + 1, Ass= etTag); >>>> +=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 + Firmwa= reVersionLen + 1; >>>> +=C2=A0=C2=A0=C2=A0 TableList[Index] =3D (SMBIOS_STRUCTURE *)SmbiosRec= ord; >>>> +=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 Tabl= e. >>>> + >>>> +=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 (&SmbiosType17Generato= r); >>>> +=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 Tabl= e. >>>> + >>>> +=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 (&SmbiosType17Genera= tor); >>>> +=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/SmbiosType17LibA= rm.inf b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Li= bArm.inf >>>> new file mode 100644 >>>> index 0000000000..78a80b75f0 >>>> --- /dev/null >>>> +++=20 >>>> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibA= rm.inf >>>> @@ -0,0 +1,32 @@ >>>> +## @file >>>> +# SMBIOS Type17 Table Generator >>>> +# >>>> +#=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All righ= ts=20 >>>> reserved. >>>> +#=C2=A0 Copyright (c) 2019 - 2021, Arm Limited. All rights reserved.<= BR> >>>> +# >>>> +#=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 SmbiosType17LibArm >>>> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1f063bac-f8f1-4e08= -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 SmbiosType17LibDestruct= or >>>> + >>>> +[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