From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (NAM04-DM6-obe.outbound.protection.outlook.com [40.107.102.83]) by mx.groups.io with SMTP id smtpd.web12.5062.1663624896659048645 for ; Mon, 19 Sep 2022 15:01:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nvidia.com header.s=selector2 header.b=p1PYNoO/; 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.102.83, mailfrom: jbrasen@nvidia.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OvDCKUPY98eXdxO9TFsr8i8Tr2Xq8y+Tx4PZFPlmh0fSVp414iQUqjxfDNJY4YJMKGKywJD6pX7XEOuf40T2rAdTawfmsDBbQ0juiYcxqTIr1MLGTZOYBAhMccm4jhY/rbbo5nEHYOq6vcebj3BS1tg6MAJxz6aN0Q22/hc5/LNASNaFhHMX7+wk7GYsYdvKi45IE99Up5a2TlrTUy1kHyydW5YDkCHzySWjIwwRQ9imFzt2Qt07JNeFA80UJQ/taozJMV5DKicGsARah3giTpm0K1e2JlFZUaSAq/O8Y6hBR8CcDzFSEW8WJjW5OUqonzWv9cyfSVcLK3GidyFrYw== 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=o29N+fsz4FJVamCJ5J0XJneZ5mWurTTSj6LNAFuc2AY=; b=RiGt1vw/b1BGK+CoyGNdskCzijHxsi+mAdHzVpmRcY6zWW8G0gIooBGK9D1UdDz5J34wAUx6kvhv+PLmBs7+NrPt86CHTVmU+QpXZxOP574DJ7K5CpHoMKS4Tw7ZjmV4HE6GmVrOA6vqB+kG33fJcMZioaNicYqBvuzwlUH0r8+dIz+qD59BQ+MYf2HEb9qKjrt4A2x2jRSSyrjBLCJ31eKfIA+eng098CDpIzSjYtIrEp3dZBUrQGsTTrttCA6kMeXClBukYxTWEQE6a9uwaLCPAfE9nbaJIW3mqGI/p2D4Plx0MTwBo7pbOtPi6NfO3OLLSldlqhb3+0sryNRTdQ== 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 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=o29N+fsz4FJVamCJ5J0XJneZ5mWurTTSj6LNAFuc2AY=; b=p1PYNoO/tadmspHRsZqTR19Pj2KNqFDHeTKIQoq6aZyOS+50tcLABCP7u4nP1KhxLOpvAUVK51/V0DLk8s7Qdr1z6jVU8xYWRzGwy4Jsz90dCgbVw4cuu3fqNkQeBfm4YweBDJZHC/dvmGxUoX8/qq2gzMfVxz0vafKHpguJJ/vSMmOXDQKQxDxrfpfRJCRTEfnvs/rQ6JULPq/ppAsAjjk4sUy1NioP3TNI4C19aS8BGnK9oMVI6OPjFSfDbXTLdMc55gkE2p1AQD4A97TiTkN0gJ395WaBFNh4m0+wW+RKBPoQF+X7wpe8Hkx17tNrVW9CoOUBLoriU1HReR4z8Q== Received: from BN9PR03CA0405.namprd03.prod.outlook.com (2603:10b6:408:111::20) by SA1PR12MB7151.namprd12.prod.outlook.com (2603:10b6:806:2b1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.19; Mon, 19 Sep 2022 22:01:33 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::78) by BN9PR03CA0405.outlook.office365.com (2603:10b6:408:111::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21 via Frontend Transport; Mon, 19 Sep 2022 22:01:33 +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 Received: from mail.nvidia.com (216.228.117.161) by BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Mon, 19 Sep 2022 22:01:33 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) 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.26; Mon, 19 Sep 2022 15:01:19 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 15:01:19 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 19 Sep 2022 15:01:18 -0700 Received: from f153882e4be8.nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.29 via Frontend Transport; Mon, 19 Sep 2022 15:01:18 -0700 From: "Jeff Brasen" To: CC: , , , , , Jeff Brasen Subject: [PATCH v4 3/3] DynamicTablesPkg: SSDT CPU _CPC generator Date: Mon, 19 Sep 2022 16:01:11 -0600 Message-ID: <7bd8126e9f99e06fe0dc647e00e1a955856db018.1663624166.git.jbrasen@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 X-NVConfidentiality: public Return-Path: jbrasen@nvidia.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT039:EE_|SA1PR12MB7151:EE_ X-MS-Office365-Filtering-Correlation-Id: bd37e3be-4973-410d-2c66-08da9a8a83d8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mtzBxaENVAIFx8+RDmNnSG0ySd/S/6YuZ3l9/1PcppusFVgQ6hzpHqh39GO87E6qXkVM3xAK+OKMCT0O6hayQhesE4gtUw/v2qaP3vXo9W9WXO4xOo4k/7aDcIVhWfmCGjo3PRIh8r3UVLzs8eaHMt1ABnbw4evPvzcxZjRJxJpU8lC/oan7tTuSbupBb3z/+lhccEZPtCydZYN8WjJtmZskm4T/ukBfJk05V2d8fxbpc+rHuJG6+G5wz9/kXPWGq/eeJEcSYPshxX1ca6s4Dv6KAUf+zoG7GUAODrr1k/bYgOxSngT/0I9TJUdT4UHz0wVZKahfWjU3RvmWDSJOz/xHwWs+7aFH9MkavbQ6WH4N/q3k/EaFwjy806CmksB0NuG2Eh/VnjMh4q9nAdjJtPrEmt4VbP5ZlhIyxMplzXv11hNF0XVNR3i9dLLuMFNAThKFSbxuu2ek2nv+Fw3Wcz21KTAYCN42gPkTfezcp084mmKbkS6LJ72dYINEvdEZW/VWvR9aMXa+9l3njJTvYscqQ2jNDiOZO8tGTgGgauJHqg7F2w2gPmHXy/P1+zxU9BQGCRvRrRmKmuFGnruRaacOKDDiPsEyn7tVV+TQMOuGQfz3iN93FV/sTxQ3LeiZ1HFE6BvR11IyKHK9/9rkm32uSHn8PsWjOkYWCdc02xS6qPZyPEeRyTUyiXkCLm8iRpYmTBQB8rpgZQ2lH1wMlR6nI8tWu/kFnJU3/VYJhHh05wwzzh12MayTu7MF/Hj9H5Gr5HYnhgHvTNbgQBjocw== X-Forefront-Antispam-Report: CIP:216.228.117.161;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge2.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(39860400002)(346002)(396003)(451199015)(40470700004)(46966006)(36840700001)(6666004)(107886003)(7696005)(36756003)(26005)(40460700003)(82740400003)(316002)(41300700001)(6916009)(54906003)(82310400005)(70586007)(4326008)(70206006)(40480700001)(36860700001)(8676002)(86362001)(7636003)(83380400001)(47076005)(426003)(2616005)(186003)(478600001)(356005)(2906002)(336012)(5660300002)(8936002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2022 22:01:33.2305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd37e3be-4973-410d-2c66-08da9a8a83d8 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7151 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Add code to use a token attached to GICC to generate _CPC object on cpus.=0D =0D Signed-off-by: Jeff Brasen =0D ---=0D .../SsdtCpuTopologyGenerator.c | 133 +++++++++++++++++-=0D 1 file changed, 127 insertions(+), 6 deletions(-)=0D =0D diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/Ss= dtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTop= ologyLibArm/SsdtCpuTopologyGenerator.c=0D index 8561f48e1f..22422aef75 100644=0D --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c=0D +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTo= pologyGenerator.c=0D @@ -76,6 +76,16 @@ GET_OBJECT_LIST (=0D CM_ARM_LPI_INFO=0D );=0D =0D +/**=0D + This macro expands to a function that retrieves the CPC=0D + information from the Configuration Manager.=0D +*/=0D +GET_OBJECT_LIST (=0D + EObjNameSpaceArm,=0D + EArmObjCpcInfo,=0D + CM_ARM_CPC_INFO=0D + );=0D +=0D /** Initialize the TokenTable.=0D =0D One entry should be allocated for each CM_ARM_PROC_HIERARCHY_INFO=0D @@ -229,6 +239,93 @@ WriteAslName (=0D return EFI_SUCCESS;=0D }=0D =0D +/** Create and add an _CPC Node to Cpu Node.=0D +=0D + For instance, transform an AML node from:=0D + Device (C002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ACPI0007")=0D + }=0D +=0D + To:=0D + Device (C002)=0D + {=0D + Name (_UID, 2)=0D + Name (_HID, "ACPI0007")=0D + Name(_CPC, Package()=0D + {=0D + NumEntries, // Integer=0D + Revision, // Integer=0D + HighestPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + NominalPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + LowestNonlinearPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + LowestPerformance, // Integer or Buffer (Res= ource Descriptor)=0D + GuaranteedPerformanceRegister, // Buffer (Resource Descr= iptor)=0D + DesiredPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + MinimumPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + MaximumPerformanceRegister , // Buffer (Resource Descr= iptor)=0D + PerformanceReductionToleranceRegister, // Buffer (Resource Descr= iptor)=0D + TimeWindowRegister, // Buffer (Resource Descr= iptor)=0D + CounterWraparoundTime, // Integer or Buffer (Res= ource Descriptor)=0D + ReferencePerformanceCounterRegister, // Buffer (Resource Descr= iptor)=0D + DeliveredPerformanceCounterRegister, // Buffer (Resource Descr= iptor)=0D + PerformanceLimitedRegister, // Buffer (Resource Descr= iptor)=0D + CPPCEnableRegister // Buffer (Resource Descr= iptor)=0D + AutonomousSelectionEnable, // Integer or Buffer (Res= ource Descriptor)=0D + AutonomousActivityWindowRegister, // Buffer (Resource Descr= iptor)=0D + EnergyPerformancePreferenceRegister, // Buffer (Resource Descr= iptor)=0D + ReferencePerformance // Integer or Buffer (Res= ource Descriptor)=0D + LowestFrequency, // Integer or Buffer (Res= ource Descriptor)=0D + NominalFrequency // Integer or Buffer (Res= ource Descriptor)=0D + })=0D + }=0D +=0D + @param [in] Generator The SSDT Cpu Topology generator.=0D + @param [in] CfgMgrProtocol Pointer to the Configuration Manager= =0D + Protocol Interface.=0D + @param [in] ProcHierarchyNodeInfo CM_ARM_PROC_HIERARCHY_INFO describin= g=0D + the Cpu.=0D + @param [in] Node CPU Node to which the _CPC node is=0D + attached.=0D +=0D + @retval EFI_SUCCESS The function completed successfully.=0D + @retval EFI_INVALID_PARAMETER Invalid parameter.=0D + @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.=0D +**/=0D +STATIC=0D +EFI_STATUS=0D +EFIAPI=0D +CreateAmlCpcNode (=0D + IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,=0D + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,= =0D + IN CM_ARM_GICC_INFO *GicCInfo,=0D + IN AML_OBJECT_NODE_HANDLE *Node=0D + )=0D +{=0D + EFI_STATUS Status;=0D + CM_ARM_CPC_INFO *CpcInfo;=0D +=0D + Status =3D GetEArmObjCpcInfo (=0D + CfgMgrProtocol,=0D + GicCInfo->CpcToken,=0D + &CpcInfo,=0D + NULL=0D + );=0D + if (EFI_ERROR (Status)) {=0D + ASSERT (0);=0D + return Status;=0D + }=0D +=0D + Status =3D AmlCreateCpcNode (=0D + CpcInfo,=0D + Node,=0D + NULL=0D + );=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D +}=0D +=0D /** Create and add an _LPI method to Cpu/Cluster Node.=0D =0D For instance, transform an AML node from:=0D @@ -581,7 +678,20 @@ CreateAmlCpuFromProcHierarchy (=0D // CM_ARM_PROC_HIERARCHY_INFO, create an _LPI method returning them.=0D if (ProcHierarchyNodeInfo->LpiToken !=3D CM_NULL_TOKEN) {=0D Status =3D CreateAmlLpiMethod (Generator, ProcHierarchyNodeInfo, CpuNo= de);=0D - ASSERT_EFI_ERROR (Status);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D + }=0D +=0D + // If a CPC info is associated with the=0D + // GicCinfo, create an _CPC method returning them.=0D + if (GicCInfo->CpcToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, GicCInfo, CpuN= ode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + return Status;=0D + }=0D }=0D =0D return Status;=0D @@ -934,10 +1044,11 @@ CreateTopologyFromGicC (=0D IN AML_OBJECT_NODE_HANDLE ScopeNode=0D )=0D {=0D - EFI_STATUS Status;=0D - CM_ARM_GICC_INFO *GicCInfo;=0D - UINT32 GicCInfoCount;=0D - UINT32 Index;=0D + EFI_STATUS Status;=0D + CM_ARM_GICC_INFO *GicCInfo;=0D + UINT32 GicCInfoCount;=0D + UINT32 Index;=0D + AML_OBJECT_NODE_HANDLE CpuNode;=0D =0D ASSERT (Generator !=3D NULL);=0D ASSERT (CfgMgrProtocol !=3D NULL);=0D @@ -961,12 +1072,22 @@ CreateTopologyFromGicC (=0D ScopeNode,=0D &GicCInfo[Index],=0D Index,=0D - NULL=0D + &CpuNode=0D );=0D if (EFI_ERROR (Status)) {=0D ASSERT (0);=0D break;=0D }=0D +=0D + // If a CPC info is associated with the=0D + // GicCinfo, create an _CPC method returning them.=0D + if (GicCInfo->CpcToken !=3D CM_NULL_TOKEN) {=0D + Status =3D CreateAmlCpcNode (Generator, CfgMgrProtocol, &GicCInfo[In= dex], CpuNode);=0D + if (EFI_ERROR (Status)) {=0D + ASSERT_EFI_ERROR (Status);=0D + break;=0D + }=0D + }=0D } // for=0D =0D return Status;=0D -- =0D 2.25.1=0D =0D