From nobody Sat May 4 00:16:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+96036+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 166783664044869.67022201661916; Mon, 7 Nov 2022 07:57:20 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id VXH2YY1788612xiQgFNHvPz9; Mon, 07 Nov 2022 07:57:19 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.54]) by mx.groups.io with SMTP id smtpd.web10.374.1667836639102292325 for ; Mon, 07 Nov 2022 07:57:19 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M8btc+OGtXjNpD6rbSgjWI/7WdkhGT7dp86TWVxjrbYElmh+viNIirLWOixdTMvH0vD1hzWUPwzsWZwTQy7I3lkq+cULdVkoRzWgLAMMgHnyOJ6Hy/f7rYQ0IPj9O45pqzVS70twsbw/fRcwkkIKdSS/wH1tt5LrbgujnNDnwf/pRKu2HVyeDuAHD6M3lYoy45evYTqzf/OyApu456ABjvNJm+7HkB3kV1K1bLpQTjfIxyHmw2HnjWHfkZt4XazTfARb292SwxokC2LYqGTkcqqIGHp/u0hD2jYxg1054MVunP8gOhQeY8vi3rfZ1Adhpo4oPBBq/oZ7c7OIC2rQbA== 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=EeZZfZpIkKUDlle0NhyZLOxh2GYd7XQ82cTLj9+vw9A=; b=MA/TrwD89RBx68Gl4ctwqXotJV9kjk+vve4L691QaAfTUj3cZPRxhwFZUznBaHi0KqSoOW8Cf2/qO/qbp5PSNs0apVwiLiUwMxAkAhu9HzxD8Hi+9jiJx7XlwnarDi8dc2vzmXmT9SpymRx5I2WNjGwNbT4EHPjKHoSq7R8p+L10IkzwhBz5DQwwLnqAXxPlKiYsIVQcpr6iRYIboI6z5nCTeEP73lTh9r/Ml8MiFKZoKWapTNMXyO86T/pgkkeUApGWRbd0SfV73iDtCTcTn+oEmNH5aWY2mLe28p6lNmRI8UOBm/CExEczWIMhE9nNUGhbXUCiwCf/ouhbtu4AdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none X-Received: from DM6PR21CA0005.namprd21.prod.outlook.com (2603:10b6:5:174::15) by BL0PR12MB5507.namprd12.prod.outlook.com (2603:10b6:208:1c4::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.26; Mon, 7 Nov 2022 15:57:16 +0000 X-Received: from DM6NAM11FT049.eop-nam11.prod.protection.outlook.com (2603:10b6:5:174:cafe::d6) by DM6PR21CA0005.outlook.office365.com (2603:10b6:5:174::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.2 via Frontend Transport; Mon, 7 Nov 2022 15:57:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+96036+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.118.233) by DM6NAM11FT049.mail.protection.outlook.com (10.13.172.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.20 via Frontend Transport; Mon, 7 Nov 2022 15:57:16 +0000 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 7 Nov 2022 07:57:14 -0800 X-Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail203.nvidia.com (10.126.190.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 7 Nov 2022 07:57:13 -0800 X-Received: from f9050a1d9579.nvidia.com (10.127.8.9) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 7 Nov 2022 07:57:12 -0800 From: "Jeff Brasen via groups.io" To: CC: , , , , , Jeff Brasen Subject: [edk2-devel] [PATCH] DynamicTablesPkg: Allow for specified CPU names Date: Mon, 7 Nov 2022 08:57:11 -0700 Message-ID: <0fd42dc1fd90f28521a3a1e47934fa7d45bcec6b.1667836523.git.jbrasen@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT049:EE_|BL0PR12MB5507:EE_ X-MS-Office365-Filtering-Correlation-Id: f8448092-a9f6-484c-2b69-08dac0d8be25 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: wQBvNZgOXXrxIQ18sxXMo+xIPwndmjI8H3JXbjTiXJ0Dx8jgFq5dYyF0Jz2oDmTc23KDZD52J1hCeEh8fSrSJgOgp5AYTK3HOfWcpO/Au/FgJuOpihBSTyBNl9tU2VG/FNs/ahj59rDqm0e0kRTs3r0s5O78zdV23hMja1vns+OYAheuFCWV9SE2vjOYP1ow1k+KeDaP4Mmo5eijzIpgRb/JyIR1X4Y8+MUqCMg9/qbWf4Nipo0RpokvHlML1EgiHZKRWClYEe79tJO5nuOMPo1pFXO7TvR1BVJlBSJZh5HkJx+wttmMmgwYzsG95wRA23MPA5N1Ldl8Mrvan2gN3nBs4WTPO/eQYSo2mu24IO/Ix7E0g1J44OfA6HV7yyyagq0C/cHht1JfyXdJeES+zTPgbNCMzfaXq38o+cUQiH5hT0bx5hSg6TK1jPwD6qfUn135IE06NNmhYcTicqTiqtYO6xfYv+dBLIs+Pol7HwCpLxCNxKyQl8Ppyg9BrOv/JTa4e2FhJEyowHCPEBSmu8rDw0rjmzob1e3vNsI+dN1a9P+9tzlHXW00GAWzxHM/w7a2fn9hTw5VYCHNWTngsa0BKe0w72jJnl9sHFcbUWx5E8UMeFz4CdarYoZ0Xb1NRffu9N/q1QhGdLaUy+9vQgk1l7QvrKKMQ5jR6SqGBxm4xvw/6fKJ6tLMmCqjVfkNj+pTspzYK39jhPcZav4slj5k/MJdKAxSI3oBNYDuyonr1SOYpC6QQ21ZBfGyk9YoFW4auzUOVOWCAC+Ni1oCPg== X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Nov 2022 15:57:16.0360 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f8448092-a9f6-484c-2b69-08dac0d8be25 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT049.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR12MB5507 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,jbrasen@nvidia.com X-Gm-Message-State: NDFiGJo1WTXTd2GBOKmepJMUx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1667836639; bh=oHSWEsPuxhLJ2cFJyZKlgITmlnOfxyu8rJuMf8W9zHk=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=tKxS37v3vxnjpMN8uLSRW1loCbh1D73h5RFgNi3GXD9gnZAxvgyYv24BYsrHIAL+EIi TDnoCBzvGn5h1Izcd8BbeXo2B8NjmFawzzsxmAQ86wqiC+GzSZjDoHRIrgkv3NkKCtvzw 4WFDfAKzyqcxkDeG1MqBUovdcdUHJLHksw8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1667836641013100001 Content-Type: text/plain; charset="utf-8" Allow object to specify the name of processor and processor container nodes and the UID of processor containers. This allows these to be more accurately referenced from other tables. For example for the _PSL method or the UID in the APMT table. The UID and Name for processor container may be different as if the intention is to set names as the corresponding affinity level the UID may need to be different if there are multiple levels of containers. Signed-off-by: Jeff Brasen Reviewed-by: Sami Mujawar --- .../Include/ArmNameSpaceObjects.h | 11 +++++ .../SsdtCpuTopologyGenerator.c | 40 ++++++++++++++----- .../ConfigurationManagerObjectParser.c | 3 ++ 3 files changed, 43 insertions(+), 11 deletions(-) diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h b/DynamicTables= Pkg/Include/ArmNameSpaceObjects.h index 6aafd41a2e..19098609de 100644 --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h @@ -768,6 +768,17 @@ typedef struct CmArmProcHierarchyInfo { /// Token identifying a CM_ARM_OBJ_REF structure, itself referencing /// CM_ARM_LPI_INFO objects. CM_OBJECT_TOKEN LpiToken; + /// Set to TRUE if UID should override index for name and _UID + /// for processor container nodes and name of processors. + /// This should be consistently set for containers or processors to avoid + /// duplicate values + BOOLEAN OverrideNameUidEnabled; + /// If OverrideNameUidEnabled is TRUE then this value will be used for n= ame of + /// processors and processor containers. + UINT16 OverrideName; + /// If OverrideNameUidEnabled is TRUE then this value will be used for + /// the UID of processor containers. + UINT32 OverrideUid; } CM_ARM_PROC_HIERARCHY_INFO; =20 /** A structure that describes the Cache Type Structure (Type 1) in PPTT diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c index d06c7615fb..92fa904103 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c @@ -553,7 +553,7 @@ GenerateLpiStates ( @param [in] Generator The SSDT Cpu Topology generator. @param [in] ParentNode Parent node to attach the Cpu node to. @param [in] GicCInfo CM_ARM_GICC_INFO object used to create the nod= e. - @param [in] CpuIndex Index used to generate the node name. + @param [in] CpuName Value used to generate the node name. @param [out] CpuNodePtr If not NULL, return the created Cpu node. =20 @retval EFI_SUCCESS Success. @@ -567,7 +567,7 @@ CreateAmlCpu ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN AML_NODE_HANDLE ParentNode, IN CM_ARM_GICC_INFO *GicCInfo, - IN UINT32 CpuIndex, + IN UINT32 CpuName, OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL ) { @@ -579,7 +579,7 @@ CreateAmlCpu ( ASSERT (ParentNode !=3D NULL); ASSERT (GicCInfo !=3D NULL); =20 - Status =3D WriteAslName ('C', CpuIndex, AslName); + Status =3D WriteAslName ('C', CpuName, AslName); if (EFI_ERROR (Status)) { ASSERT (0); return Status; @@ -628,7 +628,7 @@ CreateAmlCpu ( @param [in] CfgMgrProtocol Pointer to the Configuration Manager Protocol Interface. @param [in] ParentNode Parent node to attach the Cpu node t= o. - @param [in] CpuIndex Index used to generate the node name. + @param [in] CpuName Value used to generate the node name. @param [in] ProcHierarchyNodeInfo CM_ARM_PROC_HIERARCHY_INFO describing the Cpu. =20 @@ -643,7 +643,7 @@ CreateAmlCpuFromProcHierarchy ( IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_NODE_HANDLE ParentNode, - IN UINT32 CpuIndex, + IN UINT32 CpuName, IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNo= deInfo ) { @@ -668,7 +668,7 @@ CreateAmlCpuFromProcHierarchy ( return Status; } =20 - Status =3D CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuIndex, &Cpu= Node); + Status =3D CreateAmlCpu (Generator, ParentNode, GicCInfo, CpuName, &CpuN= ode); if (EFI_ERROR (Status)) { ASSERT (0); return Status; @@ -735,7 +735,8 @@ CreateAmlProcessorContainer ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_NODE_HANDLE ParentNode, IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNo= deInfo, - IN UINT32 ProcContainerInd= ex, + IN UINT16 ProcContainerNam= e, + IN UINT32 ProcContainerUid, OUT AML_OBJECT_NODE_HANDLE *ProcContainerNo= dePtr ) { @@ -749,7 +750,7 @@ CreateAmlProcessorContainer ( ASSERT (ProcHierarchyNodeInfo !=3D NULL); ASSERT (ProcContainerNodePtr !=3D NULL); =20 - Status =3D WriteAslName ('C', ProcContainerIndex, AslNameProcContainer); + Status =3D WriteAslName ('C', ProcContainerName, AslNameProcContainer); if (EFI_ERROR (Status)) { ASSERT (0); return Status; @@ -765,7 +766,7 @@ CreateAmlProcessorContainer ( // and EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID is set for non-Cpus. Status =3D AmlCodeGenNameInteger ( "_UID", - ProcContainerIndex, + ProcContainerUid, ProcContainerNode, NULL ); @@ -838,6 +839,8 @@ CreateAmlCpuTopologyTree ( UINT32 Index; UINT32 CpuIndex; AML_OBJECT_NODE_HANDLE ProcContainerNode; + UINT32 Uid; + UINT16 Name; =20 ASSERT (Generator !=3D NULL); ASSERT (Generator->ProcNodeList !=3D NULL); @@ -868,11 +871,17 @@ CreateAmlCpuTopologyTree ( return EFI_INVALID_PARAMETER; } =20 + if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) { + Name =3D Generator->ProcNodeList[Index].OverrideName; + } else { + Name =3D CpuIndex; + } + Status =3D CreateAmlCpuFromProcHierarchy ( Generator, CfgMgrProtocol, ParentNode, - CpuIndex, + Name, &Generator->ProcNodeList[Index] ); if (EFI_ERROR (Status)) { @@ -897,12 +906,21 @@ CreateAmlCpuTopologyTree ( return EFI_INVALID_PARAMETER; } =20 + if (Generator->ProcNodeList[Index].OverrideNameUidEnabled) { + Name =3D Generator->ProcNodeList[Index].OverrideName; + Uid =3D Generator->ProcNodeList[Index].OverrideUid; + } else { + Name =3D *ProcContainerIndex; + Uid =3D *ProcContainerIndex; + } + Status =3D CreateAmlProcessorContainer ( Generator, CfgMgrProtocol, ParentNode, &Generator->ProcNodeList[Index], - *ProcContainerIndex, + Name, + Uid, &ProcContainerNode ); if (EFI_ERROR (Status)) { diff --git a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationMa= nagerObjectParser.c b/DynamicTablesPkg/Library/Common/TableHelperLib/Config= urationManagerObjectParser.c index 5a01ed0fb8..5e4b88e8cc 100644 --- a/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c +++ b/DynamicTablesPkg/Library/Common/TableHelperLib/ConfigurationManagerOb= jectParser.c @@ -305,6 +305,9 @@ STATIC CONST CM_OBJ_PARSER CmArmProcHierarchyInfoParse= r[] =3D { { "NoOfPrivateResources", 4, "0x%x", NULL }, { "PrivateResourcesArrayToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, { "LpiToken", sizeof (CM_OBJECT_TOKEN), "0x%p", NULL }, + { "OverrideNameUidEnabled", 1, "%d", NULL }, + { "OverrideName", 2, "0x%x", NULL }, + { "OverrideUid", 4, "0x%x", NULL } }; =20 /** A parser for EArmObjCacheInfo. --=20 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#96036): https://edk2.groups.io/g/devel/message/96036 Mute This Topic: https://groups.io/mt/94869322/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-