From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 3FDE97803DA for ; Fri, 2 Feb 2024 19:20:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sHDcLYyjdZO0JclRmcSvS4bcZO/YUoPVFlmIPT2tYmU=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706901616; v=1; b=D07zL/fm2p6BmPvA68WeELLNEFWOI5YNNsDaqL2UMflZmFoT4xjvi0lKuMarkYX4pmJ1HBBc h9M3l0LCVA8ZlP2mrM+goYpiubEMXTyD4pwqoMdNn+uG1EaLKOIxFEJFXcSLaQ8GthzZYyc3Ugd IxGlF1hg8iBlmCrHWHWMqV9k= X-Received: by 127.0.0.2 with SMTP id AOKwYY7687511xhF6tAkuAUl; Fri, 02 Feb 2024 11:20:16 -0800 X-Received: from NAM02-BN1-obe.outbound.protection.outlook.com (NAM02-BN1-obe.outbound.protection.outlook.com [40.107.212.44]) by mx.groups.io with SMTP id smtpd.web11.1167.1706901616099016554 for ; Fri, 02 Feb 2024 11:20:16 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DzIV/V2Yp5wKZgH1g3p6lr2Q3vilxIYmILKB/jwKU2S6IW6cvlKOh9dMruGduJpBV4E4pm4eoAVeEytswikWlFrWFe4ILyZhf3qCpssoiPU7fR8qizCZ1d9WJaMZlCockFosuYFWjJpGPCbW5R3bs1m4HXTu0Q03lpl545dTAGt6eO38/xvo14ETt44jquv3Ttu5jyz9SQvzhT60nyrPVi9KR4I87i+uiYR9u6lnBSUUmZFnUS4lHdlZNGn6U9+SSUbuwHa98Jh+NAhQhhjCufdRRaY8VRH88jbm0F4k69GV6BYClzDDXSAv/23u7rxZ5WXs20At7ZwQ5ouoifl/XQ== 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=cD+HQp2Fzf6kkC6d1ZdNjOGU9TxktrEICcXAQ6hIFAI=; b=VR0CtMP6MufaF/MmPT2DtFq3DSDeTGZwOQ6sdYh4P444U/edHxlYfApaG+GQpUY3/hnZA2VALGCdlUHl40EWCCvYXrTzjPPI3bihySA1hwkgZJImXkdn/pQukvr3+MXTkZODONNmuGMY4q+Au/7J7lc0xgdiy4DH4b9QTKTRhJSV6ByzhobgUgxZk0MQJrzoyzgsPrL4reG01hWWYIVhjTmapBrJxGdY/EbVOwGppH5ZilcQTNGGi+4joFZMLQJb2flXLv2PUJAsOZMOJlwqb/Hq/+Rer/kaDefiFoP8z8eN6dOHN6x/oFhqUoRUvAiytMovR3XlDxuMR8PF2cCe5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) 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 (0) X-Received: from DS7P222CA0021.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::20) by SA3PR12MB7860.namprd12.prod.outlook.com (2603:10b6:806:307::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Fri, 2 Feb 2024 19:20:11 +0000 X-Received: from DS2PEPF00003439.namprd02.prod.outlook.com (2603:10b6:8:2e:cafe::53) by DS7P222CA0021.outlook.office365.com (2603:10b6:8:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.30 via Frontend Transport; Fri, 2 Feb 2024 19:20:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C X-Received: from mail.nvidia.com (216.228.117.161) by DS2PEPF00003439.mail.protection.outlook.com (10.167.18.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Fri, 2 Feb 2024 19:20:11 +0000 X-Received: from rnnvmail205.nvidia.com (10.129.68.10) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 2 Feb 2024 11:20:00 -0800 X-Received: from rnnvmail202.nvidia.com (10.129.68.7) by rnnvmail205.nvidia.com (10.129.68.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 2 Feb 2024 11:20:00 -0800 X-Received: from localhost.localdomain (10.127.8.11) by mail.nvidia.com (10.129.68.7) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Fri, 2 Feb 2024 11:19:59 -0800 From: "Jeshua Smith via groups.io" To: CC: , , , , Jeshua Smith Subject: [edk2-devel] [PATCH] DynamicTablesPkg/SSDT: Require Package node in hierarchy Date: Fri, 2 Feb 2024 11:19:57 -0800 Message-ID: MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003439:EE_|SA3PR12MB7860:EE_ X-MS-Office365-Filtering-Correlation-Id: da6b82a4-da90-4611-e861-08dc2423f9b2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: DuyUo71rZeXYEQ1muv+vcs6sq7vHrXTjO4LvYkJOZp0ftb7zWclvH8dlj9KrWNFIzKyo+72QxDWfQ2n0HzO4PNqctNV8qVIQt84RrymDaUEZtsD958dEbkIHzjNKd7kLtljkO2dnXVa9vxq1P4wrZSjVgEDJnrosu2VPwfVANB468OwiZMl3tH8+Dd/dRpVp3GFa4raOhpJ2VjajkLCBhlg6vqE4AeqQ0H5S602Y5BZcIyYD10HkwbOgA6pw71roJj1MlLW77/VIHhwfP3k7+Koumx2GgGxDl6PPOr2plLLr9KRtB72gAOPJ/M/Hp2ptLnadJRmXwo/4MOzc6+SnWaCMvdydJRUNrjQGtQG6skNXu1B0lQEeJ8qdaH52amL269ym7oJVGpvcM1Bxmy9HjwFtMosV7tO7/0oRpBJJhAbzN7HOMjUYWpvJRpQIsYERpMPYig1Z7Uzzv2/N7l0agZJCswbLigtY7pyCzLSjTFtHKt0vg3Rd5LzKGfbJQGpf96949hpE0f6IyWTB5fJSGUu8vv2pAWL6Omc0xkNhi/u/7U44ujMnBH0LIHxs7MxUl0JhU7dRlwn5GmdMPoxHux7Dp4j+Ewk90uw9OA2PPkO/a1PU53Bt8k6EHxn/fMqFgwsddz1W+xFUxL/IjpPi+gmt5FfZxAFVo89jNl6JvIrxm03IQvz0ZC/094hpkg0AjMKSfA5tZ8/WvNj4gFPpJ5Bwj9rFYmAh8ixSmxZFK01vSq4J85cSXCKjtxv3Is2w X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 19:20:11.0068 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da6b82a4-da90-4611-e861-08dc2423f9b2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.161];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003439.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7860 Precedence: Bulk 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,jeshuas@nvidia.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 73z3rm6RfqrtzeOVfbLHLemgx7686176AA= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="D07zL/fm"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io The code was incorrectly assuming that root nodes had to be physical package nodes and vice versa. This is not always true, so update the check to simply require exactly one package node somewhere in the hierarchy. Signed-off-by: Jeshua Smith --- Note: This is a complete replacement for [PATCH] DynamicTablesPkg/SSDT: Rem= ove incorrect root node check .../SsdtCpuTopologyGenerator.c | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c index 9e3efb49e6..e400ac4ae5 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c @@ -1083,23 +1083,24 @@ CheckProcNode ( UINT32 NodeFlags, BOOLEAN IsLeaf, CM_OBJECT_TOKEN NodeToken, - CM_OBJECT_TOKEN ParentNodeToken + CM_OBJECT_TOKEN ParentNodeToken, + BOOLEAN PackageNodeSeen ) { BOOLEAN InvalidFlags; BOOLEAN HasPhysicalPackageBit; - BOOLEAN IsTopLevelNode; =20 HasPhysicalPackageBit =3D (NodeFlags & EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICA= L) =3D=3D EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL; - IsTopLevelNode =3D (ParentNodeToken =3D=3D CM_NULL_TOKEN); =20 - // A top-level node is a Physical Package and conversely. - InvalidFlags =3D HasPhysicalPackageBit ^ IsTopLevelNode; + // Only one Physical Package flag is allowed in the hierarchy + InvalidFlags =3D HasPhysicalPackageBit && PackageNodeSeen; =20 // Check Leaf specific flags. if (IsLeaf) { InvalidFlags |=3D ((NodeFlags & PPTT_LEAF_MASK) !=3D PPTT_LEAF_MASK); + // Must have Physical Package flag somewhere in the hierarchy + InvalidFlags |=3D !(HasPhysicalPackageBit || PackageNodeSeen); } else { InvalidFlags |=3D ((NodeFlags & PPTT_LEAF_MASK) !=3D 0); } @@ -1143,7 +1144,8 @@ CreateAmlCpuTopologyTree ( IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CM_OBJECT_TOKEN NodeToken, IN AML_NODE_HANDLE ParentNode, - IN OUT UINT32 *ProcContainerIn= dex + IN OUT UINT32 *ProcContainerIn= dex, + IN BOOLEAN PackageNodeSeen ) { EFI_STATUS Status; @@ -1153,6 +1155,7 @@ CreateAmlCpuTopologyTree ( AML_OBJECT_NODE_HANDLE ProcContainerNode; UINT32 Uid; UINT16 Name; + BOOLEAN HasPhysicalPackageBit; =20 ASSERT (Generator !=3D NULL); ASSERT (Generator->ProcNodeList !=3D NULL); @@ -1175,7 +1178,8 @@ CreateAmlCpuTopologyTree ( Generator->ProcNodeList[Index].Flags, TRUE, Generator->ProcNodeList[Index].Token, - NodeToken + NodeToken, + PackageNodeSeen ); if (EFI_ERROR (Status)) { ASSERT (0); @@ -1208,7 +1212,8 @@ CreateAmlCpuTopologyTree ( Generator->ProcNodeList[Index].Flags, FALSE, Generator->ProcNodeList[Index].Token, - NodeToken + NodeToken, + PackageNodeSeen ); if (EFI_ERROR (Status)) { ASSERT (0); @@ -1249,13 +1254,17 @@ CreateAmlCpuTopologyTree ( ProcContainerName++; } =20 + HasPhysicalPackageBit =3D (Generator->ProcNodeList[Index].Flags & = EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL) =3D=3D + EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL; + // Recursively continue creating an AML tree. Status =3D CreateAmlCpuTopologyTree ( Generator, CfgMgrProtocol, Generator->ProcNodeList[Index].Token, ProcContainerNode, - ProcContainerIndex + ProcContainerIndex, + (PackageNodeSeen || HasPhysicalPackageBit) ); if (EFI_ERROR (Status)) { ASSERT (0); @@ -1311,7 +1320,8 @@ CreateTopologyFromProcHierarchy ( CfgMgrProtocol, CM_NULL_TOKEN, ScopeNode, - &ProcContainerIndex + &ProcContainerIndex, + FALSE ); if (EFI_ERROR (Status)) { ASSERT (0); --=20 2.34.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 (#115067): https://edk2.groups.io/g/devel/message/115067 Mute This Topic: https://groups.io/mt/104126146/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-