From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.84]) by mx.groups.io with SMTP id smtpd.web11.17362.1664923444840720290 for ; Tue, 04 Oct 2022 15:44:05 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@nvidia.com header.s=selector2 header.b=D5wsRXFV; 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.92.84, mailfrom: gmahadevan@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ArF1eoGCPUUTzvbh6Vb8zzelPc9oM2UPblPNn2u9U9VmRV25mN423UPNb1v38DJVriosJ/9XAK4sP2wJ8wS+4l2V8AsR3R8mvYj2Y1G2MFQntDmkLeYk5SwhVh+ElmFPbQbZvNx58UiTOgLi3F1GPPI29LpRf9e+fH41tUG8faYmVlO2SNpJVaesUZZSLuTnLHe7KiXx0pLPeq/kL/gOQYbbVvn26gfQ1ILEJ9YP1K57qyuWsh355RR6KJVAK+tNk5+JnBviUYBSXdI1xXP9n7QsUYSFTat+63u8BFhpwklvSSiLe/HixGMNkWYlGH70xWszGCWcN6bw4WxEbnHNLQ== 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=JgtSlLN5rytZsZMfgqgMUetdjxE0/oKQvtilxp0DE1M=; b=W5+K1T+8h4MVBz96Ykx4WURBK5kKOa0rXZ9eRWYJKBNpHJMrcbUYM1RnYf7HZyvfNZf0aUq+fvrERsyzG8gOzaBaDStGc/yevqM8LmmpQQRpPKOEdj5DngsDb3HknHdGo73GxmioGLm6IVLMQKasctZNi2SFsPj9qAHXn2GLg+qEIHWYXoMe3PTqV2Edexz2dAHtN1H5peda94EJLMnOs/nel1PiskX23YXdk75u3C+O+1Jz1PPnw9EPUzGmUB0hEpt7FWiA3TQ0wj+zMhzD7QQW4s08V05FUtXX8412yc03AY0aT6Vd6ce27iDIQKMT0TrUlmsiEb3tu7HSv8dXvQ== 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=JgtSlLN5rytZsZMfgqgMUetdjxE0/oKQvtilxp0DE1M=; b=D5wsRXFVyaRXo8/9tZY6ACmUqCrZl0uWF1KH11uPLqBRzNiKd5gNqjEDHTH8fvTJPMli582xCsWrqfI07g6umstK/h6TxTQp5jzwCJsJ1MSDvnDaEGtZQEZZQGX2RgiQZ5zpHYfgX9CjZUCojvN7tD9rMUYrwHIWGmLBfPJZT2ljLrKGL0fdMKFnajtAlhemBEqYNdW2RrJ0vIjjitrbZ54AZFweX+O1omkSt6JPkD/lyjlKCWBpfJm4wGfHHAPN2kgj7E7mLva9W9if6c3WQgHd9GpQmTuMvaI2pJVofaSacAkBp+aMK5v82n5S16fRdY7oP+pH+0SMAe8lFCkptQ== 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 CY5PR12MB6648.namprd12.prod.outlook.com (2603:10b6:930:42::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.31; Tue, 4 Oct 2022 22:44:01 +0000 Received: from CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::b00c:10c1:3a2e:5b98]) by CY5PR12MB6297.namprd12.prod.outlook.com ([fe80::b00c:10c1:3a2e:5b98%6]) with mapi id 15.20.5676.028; Tue, 4 Oct 2022 22:44:01 +0000 Message-ID: <2204e785-d05a-a47d-2da6-a9b6b8e608a0@nvidia.com> Date: Tue, 4 Oct 2022 16:43:57 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 2/2] DynamicTablesPkg: Add Smbios Type17 Table generator To: Sami Mujawar , devel@edk2.groups.io, Alexei Fedorov 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> From: "Girish Mahadevan" In-Reply-To: X-ClientProxiedBy: SJ0PR05CA0058.namprd05.prod.outlook.com (2603:10b6:a03:33f::33) 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_|CY5PR12MB6648:EE_ X-MS-Office365-Filtering-Correlation-Id: 84888863-8bdf-4464-216d-08daa659ee86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pF5Zvcq4t9MgY8f3qGSYMpV/72EU2oOblkCrNzRm504Wf4zLYWLdx7uDJuYYih4p5/G3GqY8Cqpmll8cuDeA64Q1k/Z6FkrOhy3bxJjZ5pi6EA1/d13OyWsNimKcRRbDa+I7yg7LzLpV/GtRKOXKzqKadGE3p9t+RqHG9GHwV/qPgsJjGFxRIKpDX7gWwZpjXvjGJPy/ecT7hg3QQTzomE2jO7nopID3ZAtHIOSoS/iYOH45NaYSMofSiau9BEur/381vNWvuCsAx+sm4kkW1sx2Z5ITgYYB2jMnLc1Y+BlOrdovDiEDzON0GG+le4OygEcJI5XRjxpiBb3XRE9jiPTR3VhMvW5Gn2DQTTwbBj3O/HSkONv7jkhihIwD51kLpWsA8DoGntigIHnCEtzBln399UVp8hKvIgpny8juzzaSOiNdDDI3pXmliUUIE1TReQMY7tF5RaB3EWVCyScF2xdWKn2PoVI0QLJDo1t5h8WTf2eNb7X4FzcEh6AVe4xGwmFYhBvYUlmChU0D3R1qHPGQYOjFilaE5zqMv9PbBfMcXuNZQAVNDgR9mfCJxkmsL5d8D8TPvqGgNufzkqrjBURiQb6LZQbIZ9cT/oJObicOoUAUg/npqa2H7lW92wLNru1DNoGeIo7WYsGguRSa1oeV9lIh5V19mQWr3mISSYf4syIVRcl9tdRy2cL4kFQl4vDnt900KGBlJyG6Mw+TUepCn9m1zSA5l8zx+O8RgvOO9h3kGmMQ3HAzRaZj8H2hBfvD6XQ3MiYnWnanc4dUPR09/NDIKCQMV3emBJg8jYfFjthI1khTnqgOsUlTCJx83GFbLqGua/ulVtGuRfyFfCKiE2dDGAdJ+P4zA0ek4Hpo7v1y96r15zBmdMBQnWaZ 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:(13230022)(4636009)(376002)(346002)(366004)(396003)(136003)(39860400002)(451199015)(19627235002)(45080400002)(966005)(2906002)(41300700001)(83380400001)(66946007)(31696002)(66556008)(6486002)(66476007)(86362001)(110136005)(8676002)(2616005)(4326008)(54906003)(316002)(30864003)(5660300002)(8936002)(6506007)(6666004)(6512007)(53546011)(26005)(478600001)(38100700002)(36756003)(186003)(31686004)(21314003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5W8knN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=?us-ascii?Q?Za8KxRFSd3DwHyymUyXTE83fd9gM+Qi/B/EWX3MPe9zp58b9PYGGAigavG0n?= =?us-ascii?Q?5F29PCLZrJgmM9EiRu9ohfPtYqRv7mYUpzhKdnttuf1BmT8YxGEmELwbW72w?= =?us-ascii?Q?wh6OJvpeZC0U82205g6/+ejBRZT0d3d5x9F8cM3zv+QdA7P6h5uoe9rQv97C?= =?us-ascii?Q?z9BmpQDctFIThaYrZgFXygM9MsG1aJ4MwKo0y96O9Z+k7h6CSs/22sO40+rp?= =?us-ascii?Q?khr/ZL7y6oLyxqRGazZ/+fww+m5p5BwviuEq0jIxNI6Gkx0v9EiUhTG38KDH?= =?us-ascii?Q?ThnK7kARACbrcxF3Dw/yh5yguTEGSZyL7dnFTsD/ghr1t8qG8ojQD+GWAJil?= =?us-ascii?Q?MClvPmsw2TN7bZs/2c9INV/bXhPtfFspXBv6pZzTQNjhBHnnsQOzs0zXcxK8?= =?us-ascii?Q?clnf6+SttrI3uFQiFSvHOFl/mrt5ZdPpPBrkAxIPibBs5UF5X1AdHl5O3QGW?= =?us-ascii?Q?byJ6jWJkHJ8n7NIfmjm+ckfMFKLoLNUGcK4yPJ5ygmuIBZKOpisf919v+qvG?= =?us-ascii?Q?nDe2rqaYk6IVIYJ2mJSZm9H5fak+2Q54QoktVRczHLIcmrcUCK0qtM0kPOPQ?= =?us-ascii?Q?gYCWP/73uo8WllSns+3QybBk4vGjFX9dGEys4IYfZnY5iO3mxGmIAajx46Pt?= =?us-ascii?Q?fwGLLjHBf422A+m2xzDxRpHWFHMG5JiQ007cYhODpPW1tzK5c1pR1ivzvoYk?= =?us-ascii?Q?pg=3D=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84888863-8bdf-4464-216d-08daa659ee86 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6297.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2022 22:44:01.2601 (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: 8Hj/7jZLleLmypIfKse7JDFVjR6WIPvPGCoKY6Oeo2hYU9gIInnoHK33tJcIqvcvKO34H9byuUl31WiV+snudg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6648 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 >=20 >=20 > Hi Girish, >=20 > Thank you for this patch and for the effort for bringing forward dynamic > SMBIOS generation. >=20 > Please find my feedback inline marked [SAMI]. >=20 > Regards, >=20 > Sami Mujawar >=20 > 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 +++= +++++++++++++++ >> =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/SmbiosType17Generato= r.c >> =C2=A0 create mode 100644=20 >> DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibArm.i= nf >> >> 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 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 this= =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 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 device o= n 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 located= . >> +=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/SmbiosType17Genera= tor.c b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Gen= erator.c >> new file mode 100644 >> index 0000000000..5683ca570f >> --- /dev/null >> +++=20 >> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17Genera= tor.c >> @@ -0,0 +1,338 @@ >> +/** @file >> +=C2=A0 SMBIOS Type17 Table Generator. >> + >> +=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights= =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. 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 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 >=20 > [SAMI] Do you have any thoughts on how the MemoryArrayHandle can be setup= ? >=20 > The same applies for the following MemoryErrorInformationHandle field. >=20 > I think we need some sort of a HandleManager in DynamicTablesFramework > that can keep track of the mappings between SMBIOS Objects and Table > Handles. >=20 > e.g. Smbios - HandleManager >=20 > +-------------------------------+-------------------------------+ >=20 > =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 | >=20 > +-------------------------------+-------------------------------+ >=20 > =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 | >=20 > +-------------------------------+-------------------------------+ >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ... >=20 > - The Type17Object i.e. CM_ARM_MEMORY_DEVICE_INFO can then hold a token > for the Type16Object. >=20 > =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 be > installed. >=20 > - 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. >=20 > - 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 be > searched (using Type16Obj_token) to retrieve the Type16 Table handle and > populate the Type 17 Physical Memory Array Handle field. >=20 > 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. >=20 [GM] I agree with the idea of having a map of CM_OBJECT_TOKENs to SMBIOS=20 handles. I've added this to the DynamicTableFactoryProtocol. However when it comes to actually figuring out and adding the reference=20 SMBIOS handle We've come up with a slightly different approach. If I understood what you were saying above is: If we happen to parse a Type17 table if that Type17 table has a token to a Physical memory array CM_OBJ if there is an existing Smbios Handle (look up this handle using the CM_OBJECT_TOKEN) then use this handle. else if there is a generator for Type16 registered call the Type16 generator 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 SMBIOS=20 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 if that Type17 table has a token to a Physical memory array CM_OBJ if there is an existing Smbios Handle (look up this handle using the CM_OBJECT_TOKEN ) then use this handle. else if there is a generator for Type16 Registered Generate an SMBIOS handle [since SmbiosDxe maintains the handle DB privately I had to pick a handle and check if it clashes with existing records] Add this SMBIOS handle to the map. else // No generator present Proceed without adding any reference Before Adding any SMBIOS table, we check if there is an existing SMBIOS=20 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-upstream= :RFC/smbios-dyntables 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 // 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 >=20 > [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: >=20 > 4.8.4 Total Width is not 0FFFFh (Unknown) if the memory device is > installed. (Size is not 0.) >=20 > 4.8.5 Data Width is not 0FFFFh (Unknown). >=20 > Can you explain how this field is used, please? >=20 > [/SAMI] >=20 >> +=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 use = Extended=20 >> Size) >=20 > [SAMI] I think this field should be set based on the Size. >=20 > 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." >=20 > 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. >=20 > e.g. UpdateSmbiosTable17Size (SMBIOS_TABLE_TYPE17 *SmbiosRecord, UINTN > Size) { >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (Size > 32GB-1MB) { >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Smbio= sRecord->Size =3D EncodeSize (xxx); >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else { >=20 > =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); >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } >=20 > =C2=A0=C2=A0=C2=A0 } >=20 > [/SAMI] >=20 >> +=C2=A0 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=A0=C2=A0=C2=A0=C2=A0= // FormFactor >> +=C2=A0 0xFF,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 // Devic= eSet >> +=C2=A0 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 // Device Locator >> +=C2=A0 2,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 // Bank Locator >> +=C2=A0 MemoryTypeSdram,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 // MemoryType >> +=C2=A0 {=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=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 Extend= ed 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=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guredMemoryClockSpeed > [SAMI] Should this be provided through CM_ARM_MEMORY_DEVICE_INFO? >> +=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 // MinimumVoltage >> +=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 // 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 // MemoryTechn= ology > [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=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= // FirmwareVersion >> +=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= // ModuleManufacturerId >> +=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= // ModuleProductId >> +=C2=A0 0,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0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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= // CacheSize >> +=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= // 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= // 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=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_TABLE_I= NFO=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_MANAG= ER_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_STRUCTUR= E=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =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 freed >> +=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 in= formation. >> +=C2=A0 @param [in]=C2=A0 CfgMgrProtocol=C2=A0 Pointer to the Configurat= ion 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 returned = by the 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 size=20 >> 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 memo= ry. >> +=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_SMBIOS_T= ABLE_INFO=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *CONS= T =20 >> SmbiosTableInfo, >> +=C2=A0 IN=C2=A0 CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL=C2=A0=C2=A0 = *CONST =20 >> CfgMgrProtocol, >> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SMBIOS_STRUCTURE=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=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, >> +=C2=A0 OUT=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=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=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+=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 *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 *S= mbiosRecord; >> + >> +=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->Generator= ID); >> + >> +=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 Object = %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 (MemoryDevi= cesInfo[Index].SerialNum); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D MemoryDe= vicesInfo[Index].SerialNum; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNumLen =3D AsciiStrLen (UnknownStr= ); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SerialNum=C2=A0=C2=A0=C2=A0 =3D UnknownS= tr; >=20 > [SAMI] If the serial number is not provided, then should the string > field be set to 0? >=20 > See Section 6.1.3, SMBIOS Spec Version 3.6.0 which states >=20 > "If a string field references no string, a null (0) is placed in that > string field." >=20 > [/SAMI] >=20 >> +=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 (MemoryDevic= esInfo[Index].AssetTag); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D MemoryDev= icesInfo[Index].AssetTag; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTagLen =3D AsciiStrLen (UnknownStr)= ; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 AssetTag=C2=A0=C2=A0=C2=A0 =3D UnknownSt= r; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].DeviceLocator !=3D NULL= ) { >> +=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 Memo= ryDevicesInfo[Index].DeviceLocator; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocatorLen =3D AsciiStrLen (Unknow= nStr); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 DeviceLocator=C2=A0=C2=A0=C2=A0 =3D Unkn= ownStr; >> +=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 Memory= DevicesInfo[Index].BankLocator; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocatorLen =3D AsciiStrLen (UnknownS= tr); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 BankLocator=C2=A0=C2=A0=C2=A0 =3D Unknow= nStr; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 if (MemoryDevicesInfo[Index].FirmwareVersion !=3D NU= LL) { >> +=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 Me= moryDevicesInfo[Index].FirmwareVersion; >> +=C2=A0=C2=A0=C2=A0 } else { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersionLen =3D AsciiStrLen (Unkn= ownStr); >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 FirmwareVersion=C2=A0=C2=A0=C2=A0 =3D Un= knownStr; >> +=C2=A0=C2=A0=C2=A0 } >> + >> +=C2=A0=C2=A0=C2=A0 SmbiosRecord =3D (SMBIOS_TABLE_TYPE17 *)AllocateZero= Pool ( >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=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=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 t= he > SmbiosTable, see > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithu= b.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSmbio= sDxe%2FSmbiosDxe.c%23L476&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7C11= 69a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7= C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l= uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3DEnTxn07ekjA= 7bGUeCg2c0BaUMVW0yU5JFjXNOcZuhQA%3D&reserved=3D0 > and > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgithu= b.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FMdeModulePkg%2FUniversal%2FSmbio= sDxe%2FSmbiosDxe.c%23L516&data=3D05%7C01%7Cgmahadevan%40nvidia.com%7C11= 69a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7= C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l= uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3Dd6kU6CdywK4= fnOdxE8CyTTM9eQHDE38FzZB7SA2FTqc%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, sizeo= f=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 MemoryDevicesInfo[Index].Size; >=20 > [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. >=20 > I think it will be useful to create UpdateSmbiosTable17Size() which does > the appropriate encoding and updation of the SMBIOS table fieds. >=20 > [/SAMI] >=20 >> +=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].ModuleManufactu= rerId; >> +=C2=A0=C2=A0=C2=A0 SmbiosRecord->ModuleProductID =3D >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 MemoryDevicesInfo[Index].ModuleProductId= ; >> +=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[In= dex].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, = 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%2Fedk2.= groups.io%2Fg%2Fdevel%2Fmessage%2F93651&data=3D05%7C01%7Cgmahadevan%40n= vidia.com%7C1169a52a2ad140a8d79308da94cf2762%7C43083d15727340c1b7db39efd9cc= c17a%7C0%7C0%7C637985914717380634%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM= DAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata= =3D4xHMP2KfNlcdeBrtH%2FIT1F249uWIoz0XZreF3FSugq8%3D&reserved=3D0 >> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + DeviceLocatorL= en + 1; >> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, BankLocatorLen + 1, Ba= nkLocator); >> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + BankLocatorLen= + 1; >> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, SerialNumLen + 1, Seri= alNum); >> +=C2=A0=C2=A0=C2=A0 OptionalStrings =3D OptionalStrings + SerialNumLen += 1; >> +=C2=A0=C2=A0=C2=A0 AsciiSPrint (OptionalStrings, AssetTagLen + 1, Asset= Tag); >> +=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 + Firmware= VersionLen + 1; >> +=C2=A0=C2=A0=C2=A0 TableList[Index] =3D (SMBIOS_STRUCTURE *)SmbiosRecor= d; >> +=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 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 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 Ta= ble 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 Im= ageHandle, >> +=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 (&SmbiosType17Generator)= ; >> +=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 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 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 Im= ageHandle, >> +=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 (&SmbiosType17Generato= r); >> +=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/SmbiosType17LibArm= .inf b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibA= rm.inf >> new file mode 100644 >> index 0000000000..78a80b75f0 >> --- /dev/null >> +++=20 >> b/DynamicTablesPkg/Library/Smbios/Arm/SmbiosType17Lib/SmbiosType17LibArm= .inf >> @@ -0,0 +1,32 @@ >> +## @file >> +# SMBIOS Type17 Table Generator >> +# >> +#=C2=A0 Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights= =20 >> 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 SmbiosType17LibArm >> +=C2=A0 FILE_GUID=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =3D 1f063bac-f8f1-4e08-8= ffd-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 SmbiosType17LibDestructor >> + >> +[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