From patchwork Fri Jan 12 09:25:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 762412 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2084.outbound.protection.outlook.com [40.107.223.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50B2356B9A; Fri, 12 Jan 2024 09:25:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Iaef2Im1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WSr0qTE+mGD3l68XQPc/FdFFuao1qLNptcAibk5i0xHjd8BazIWLaHOekL8BkBdx/TnsCuHIzsgZXKXK5+iecciJ5/xgAMQa/Sc4Z7EjyJfNi51So+BLgFd3kIsE/HFULTUGaiHdRmN3OVJaUjpgpjdq3DhgIs2hUA/msd/WvkV73cbYvZbird9uXrPlVI12uU3226Od4E5YH0/WjGDiIRRkBTLOpw3tCaTKCOtQkyELkdXc1kgcQvQoz+gjMINF+uGCqjLwZGCfSLwXxW9yB3qR+o3haeEBUo8gQJXdRIUtQUpXEQKqF+jQRXiz33R7csSzFSsqNNDOG9K9oMcfjg== 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=LlSxPWdyV/EtEqLn7HLp6u5EkidVnG0biRkzCBeMMkc=; b=I3W6VZytydGQLT6QlIGoenPF55mGLiZEnWM6wsVzPmQwXaK0A/2u5BA7NiN1E+0h2juLTeYo8s/l25aIPWDNW+9Dws8y0xFJwMH78LpW1Zo855XNRfp1gECMCY9gA0hHYNf1aD2RwRqvkJnpxCc+v1GQyMaSGjof+8Eu9Jhw1iK0CdOduRITqwOgZ5TQY0M95XbUUdN+uvVgCQtT0JsuimEfyDrHKHBRpoSclV2bAFU/GvVpyCFm75is/ZAjTpWzKsI1Vi3MKQJngU82xRWibfoU+/Vrnv3+h2+44d+xLn6HENVVb8LPO0bGDps3FD2rttKITwm75UXTfowv5IbHRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LlSxPWdyV/EtEqLn7HLp6u5EkidVnG0biRkzCBeMMkc=; b=Iaef2Im17u2sKqHKkUTXth6U6153w3kF4KDTeuUJwxAkzIjjq3woORAFBVhQBbLVMS0jLL9Oi9MbK/eGECTmpI+qbz6TL4sDoB7sGzCrcq2uxA08lijo0lWGhcN14Nw0TlPWf0mC7hSAofrSVv9iAPow2W+Q341dYDNTgf53gbk= Received: from DM6PR03CA0016.namprd03.prod.outlook.com (2603:10b6:5:40::29) by DM6PR12MB4203.namprd12.prod.outlook.com (2603:10b6:5:21f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 09:25:56 +0000 Received: from DS1PEPF00017091.namprd03.prod.outlook.com (2603:10b6:5:40:cafe::33) by DM6PR03CA0016.outlook.office365.com (2603:10b6:5:40::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21 via Frontend Transport; Fri, 12 Jan 2024 09:25:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017091.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 09:25:56 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:25:51 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Perry Yuan Subject: [PATCH V13 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion. Date: Fri, 12 Jan 2024 17:25:25 +0800 Message-ID: <20240112092531.789841-2-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017091:EE_|DM6PR12MB4203:EE_ X-MS-Office365-Filtering-Correlation-Id: f75cd735-1aa6-43a2-c5b6-08dc13507b13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bDODV6dgr+tgI+rOXPYLix7b2ZWEVZ8PEXqb2/v3g2KHtYyNegiVaEcEJz6zdmi+m+Sjddq62L1JekE71zRBKdblVjABAmB5n0AyVKijjlIwj0T2KK5fAS033OBG17ihX400+H5V/AuexXEMqAfikSj8dylXC+a/+idDX1zIA/ecO/nBSOtDsOKAj3ctwFvvujSVfxPP/p28mUh+ksPYQmhhw/I9zXWfo18BwHLdFzhDBkUrx7KIS24v7iWX22zh+lK+lFHx8IA6JsFmLMnmsl4XV7zjwmGaeJM4EkTbQkcnzMIc2vc9sqZ6Ts/TWC70gZ9M4i+HegN1aV0ELLvb6XzHInQ42rgWEbNVdYT50k3xHb1sakHu5FhTQ6YgzKTSJiZfFTF3ZdZ5AWOOGq7UJ9o+dDVR2Z7YmtXbRLoUNw4WUdtZIqw3H+IZmxENZU3I9E8551qxdrC+4RSAXn8JaZOs8d9htr4SXWmEy4rnlk8OzCjfjhsVQtkAoxQ6BX34utXB9ID69wZiRHEohhRrZovkMj/Tdr/rzdoR5lFhcmrtVNqm/4fuM0jfIz/91O5DWIv5Kp1xeYbgg1zZnL3sSPIesn9gOwRnNBR+/d3KvuHyN4HezBmXUVGbW+OvmgT1//Za/roh+jIUPugzPc81fYJWiM2V2FHWJIptpO7L5X2LS/LhDOTk6WkcotrfUQjWb61H8IZPuOP+O6ZORpHYfk284CuvOYtbL3TOXkfmFpwSrKgvaskFVblofOaAELKAYFiz2wQBcAffmgz9/mCWIw== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(396003)(346002)(39860400002)(376002)(230922051799003)(1800799012)(451199024)(186009)(64100799003)(82310400011)(46966006)(36840700001)(40470700004)(426003)(16526019)(336012)(86362001)(83380400001)(41300700001)(6666004)(7696005)(478600001)(2616005)(1076003)(26005)(6636002)(47076005)(4326008)(40480700001)(82740400003)(36756003)(70586007)(70206006)(8936002)(8676002)(54906003)(110136005)(316002)(81166007)(40460700003)(7416002)(2906002)(4744005)(356005)(5660300002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:25:56.2191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f75cd735-1aa6-43a2-c5b6-08dc13507b13 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017091.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4203 amd-pstate driver also uses SCHED_MC_PRIO, so decouple the requirement of CPU_SUP_INTEL from the dependencies to allow compilation in kernels without Intel CPU support. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: Meng Li Acked-by: Borislav Petkov (AMD) --- arch/x86/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 1566748f16c4..4fd69cd4241a 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1054,8 +1054,9 @@ config SCHED_MC config SCHED_MC_PRIO bool "CPU core priorities scheduler support" - depends on SCHED_MC && CPU_SUP_INTEL - select X86_INTEL_PSTATE + depends on SCHED_MC + select X86_INTEL_PSTATE if CPU_SUP_INTEL + select X86_AMD_PSTATE if CPU_SUP_AMD && ACPI select CPU_FREQ default y help From patchwork Fri Jan 12 09:25:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 763235 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AB895D8FA; Fri, 12 Jan 2024 09:26:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="MmcxIbpg" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TpZYEyMJQ+fF/BqBErpIWDHo/iEVRqDGMWai5rjohKgUDf3oZWICbTxF2ylRFbZMBf/Qfota17ZH/Or33WV8eDGFKLJxcHnxXrhCoMsf80H4vf9oBeE7fG0ousD9ITYZUixm+6yiSReJzAScT6e7DfUdHHuMdn9dq7re1iTB/g6zW9mMxLS2G+HlkCVyTghtFrqsb0qSWClHlWuIhXQycOGK8yEayD/1NLXSQYD39WP/VlUsCVuOOL5pqk4OXZsNFyrCQzW5Lv7nVO3mhaJsF+70E7OYQxwKQW3YWKciP3nPmJOFlJZcsfctzLjmFQqN97LxGn7BRwVc8aB4wkV6nA== 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=rhAG+etjlvt9pFUINrcsqVSFIZOqQVdlYf2BbLl182M=; b=hY6dHSkF90EZcpUT3g0XRyX/edJYtxIKK108xi0SwSHWB5P/wnmvH8/H/NitYXn3YI+uWrLibL0bsfMtXdJ/M9I+5hEfdpUwI/BgB+ZCNs9qC7Az9TBK2axQKVaT4YiS8V8IyaZxndvK4c7MCVXEA6HbG9dJUtZ4UXNpYy4/JNpPlkX9p+CcXYxbs0FizQ1HlEtp58JJUWaTGD1sBPDSbz4K9oy3y3KzcJMJsEHt2L4yxr5MdyiL5Ci6Lnx+O6wJX8YXUZTtaIRbVwLn0zyxT0/28PqUusYe20kwLKxap2DqTLQV+WNoOBK5e3DMrFpjuKSXFMhQINBswI7Ita+zgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rhAG+etjlvt9pFUINrcsqVSFIZOqQVdlYf2BbLl182M=; b=MmcxIbpgRjstQmzClW1JWsa6hZypx52SxSRQ3QZi5oeBOzJxMhSqkAdVl7FEpzZ8q/Mc+hEpUK9HXF6EqznsE88dEbt9GLhIdIPvnGqssxgA0ehOUXyFEOfQynsskV5HHi9dCBwEj9nkZ5ZfosuvX9lJiYgrmp/fkp8dL65Kiso= Received: from DM6PR03CA0022.namprd03.prod.outlook.com (2603:10b6:5:40::35) by MN0PR12MB6295.namprd12.prod.outlook.com (2603:10b6:208:3c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.21; Fri, 12 Jan 2024 09:26:01 +0000 Received: from DS1PEPF00017091.namprd03.prod.outlook.com (2603:10b6:5:40:cafe::a9) by DM6PR03CA0022.outlook.office365.com (2603:10b6:5:40::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19 via Frontend Transport; Fri, 12 Jan 2024 09:26:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017091.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 09:26:01 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:25:56 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Wyes Karny , Perry Yuan Subject: [PATCH V13 2/7] ACPI: CPPC: Add get the highest performance cppc control Date: Fri, 12 Jan 2024 17:25:26 +0800 Message-ID: <20240112092531.789841-3-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017091:EE_|MN0PR12MB6295:EE_ X-MS-Office365-Filtering-Correlation-Id: 99c6799b-fefd-4736-2b35-08dc13507e43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ehNQefelvG43YL2ne//PgVJG+vSRvzEwlbzT8PDWQqd4kqUtfxQ9YOtJQr5hw37+MX1qTZB0KaTPgH2qEhf34ZQsTskIUlnrdFqXN7zrpUka69vXTicPqg6DhERoO/WylMzifoIR8jdr5D/Ll5sqcOdxQ4mskmm7fQ3EH0xR/5+/OCaEHmtABnbcsSUxtYBAp4GiGa9fkLpQenn+biz/o6j667A1f7DO1deDkwMyu1O2R6vzs11baUBegdQsSxM59Lquf78Twqwqcgd/d0nBaG5FAfVH4n8F8AvVRq2iYcuM5anccyZtvT5piMac1R8HDxgq82M7iPUkr1S4xfw34Sm+IRRGfPyEOF0AUqtCVvvfUA93UsRQeu/Rv03qUOXkUmIfPHchcNxpThAnoc9M0d7pahDHJ8SBDu3cCL2WjCdWwFzH5f3ebq98Q/wLk1rwGlVk2BLa/32KCDb+0f84uKv5e450hWzbksJLf+7TwfXQJffvoYmG46uyP+86x6s3rpFS6b2djQWu6ufqSjU2UV4cj853aQcM3GYrtRl92pj1tQ5Lqu+sUO8sGUejTJJ2zL5E+s9y3lQVY4ZGer6AkvEHGw0sgXPS+9n4H2cWw4nrFCphxqdyvkphc1s3jXQZDoszdsKr+JyulO7qz+txlhld1n8zXznWzs3VE55e5ICnNSZQZUObAX+QNMwSiS7jE/KD44TT9jxs8Qo3GOzopOYfeviOv5sWfaxOLnL4V6ECPqsJZfAreS9zPM3cUi73LYkwamGz4XMN8ffyfLBR8Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(376002)(136003)(396003)(346002)(39860400002)(230922051799003)(82310400011)(186009)(64100799003)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(36860700001)(5660300002)(8676002)(36756003)(54906003)(41300700001)(70206006)(6636002)(316002)(8936002)(70586007)(2906002)(110136005)(356005)(2616005)(81166007)(4326008)(336012)(86362001)(16526019)(7416002)(47076005)(82740400003)(966005)(426003)(1076003)(7696005)(6666004)(26005)(478600001)(40460700003)(40480700001)(15583001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:01.5316 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 99c6799b-fefd-4736-2b35-08dc13507e43 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017091.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6295 Add support for getting the highest performance to the generic CPPC driver. This enables downstream drivers such as amd-pstate to discover and use these values. Please refer to Chapter 8.4.6.1.1.1. Highest Performance of ACPI Specification 6.5 for details on continuous performance control of CPPC. Also see the Link below. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Reviewed-by: Perry Yuan Acked-by: Huang Rui Signed-off-by: Meng Li Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#highest-performance --- drivers/acpi/cppc_acpi.c | 13 +++++++++++++ include/acpi/cppc_acpi.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7ff269a78c20..ad388a0e8484 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -1154,6 +1154,19 @@ int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf) return cppc_get_perf(cpunum, NOMINAL_PERF, nominal_perf); } +/** + * cppc_get_highest_perf - Get the highest performance register value. + * @cpunum: CPU from which to get highest performance. + * @highest_perf: Return address. + * + * Return: 0 for success, -EIO otherwise. + */ +int cppc_get_highest_perf(int cpunum, u64 *highest_perf) +{ + return cppc_get_perf(cpunum, HIGHEST_PERF, highest_perf); +} +EXPORT_SYMBOL_GPL(cppc_get_highest_perf); + /** * cppc_get_epp_perf - Get the epp register value. * @cpunum: CPU from which to get epp preference value. diff --git a/include/acpi/cppc_acpi.h b/include/acpi/cppc_acpi.h index 6126c977ece0..c0b69ffe7bdb 100644 --- a/include/acpi/cppc_acpi.h +++ b/include/acpi/cppc_acpi.h @@ -139,6 +139,7 @@ struct cppc_cpudata { #ifdef CONFIG_ACPI_CPPC_LIB extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf); extern int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf); +extern int cppc_get_highest_perf(int cpunum, u64 *highest_perf); extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs); extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls); extern int cppc_set_enable(int cpu, bool enable); @@ -165,6 +166,10 @@ static inline int cppc_get_nominal_perf(int cpunum, u64 *nominal_perf) { return -ENOTSUPP; } +static inline int cppc_get_highest_perf(int cpunum, u64 *highest_perf) +{ + return -ENOTSUPP; +} static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs) { return -ENOTSUPP; From patchwork Fri Jan 12 09:25:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 762411 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2050.outbound.protection.outlook.com [40.107.243.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D003A5D916; Fri, 12 Jan 2024 09:26:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="3uas+V3m" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nk01hgNrSUr41e46Lerpb2JB0Rv8Fi8zQgjVha82mnRwfa+DXslZEpBuCBScfO7eMfBXcRTVmaa4CXG9lU/GYAsi2fevVMLNMcEhnGy6/3DDf/C15ZppszWIVfxlAoynnjqCKsmf396aMh18MjPXIdaKyhV4Q6g56MXnH0KWmVfGMcYKjIquVfE65fLhSk8Bjs+9oQStpiD1UB1WOY5EedRNQCTFaK2L0nlfVWorbwxHZP0E7Fpt44nq4kxkcx+OtvAsK5v/DUCUm8w9cEtt2fPIQCnbQT3PxQBXmwHIfiP9fiIkiB0iAguGNgZpr1v19ugQfKpJO6PaRW9reXheQQ== 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=XmBnlY6CcyhnNSPEQizfeQBw6AAo8AGdk2azpcvOOtI=; b=eA9pqmwfAIOGmCDF+Y42qCTSyH6kDURTaRE4Mw6VO1LDlI6+UAvMc3E7Hf7/XuIp4sC4hrYifg/xTrNGNAstbmAvZB5i7OBZ5P9r2GXg6ggNKyFsA3iV2Nu1iVXsqRT3p6NRBmOV094p2WK3ES3LYR5I7cgmi2kKgpcS3kch3WX3jHOCDhJ9ao7DtCccs56cPiF5c6i8uObAZ5Cg5PZbp2DEAfGrYVTKZe7+D+wpPCgqYHrujIuu7oQhqOquqOSAYRhvVrDVqdsFuGa0XPZF86kD7gQSIWhW3a30t9SiSyIOoClBM//sVeVllcyRV9+ccOgNiFa+k+eJST3g6GihSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XmBnlY6CcyhnNSPEQizfeQBw6AAo8AGdk2azpcvOOtI=; b=3uas+V3m/Cz1pdguYX4tZ0XABGQs4Z+mDQqtOyiQdgWGPrMzOWc58fxUTxJr6cvmM2ZiosTbbbO51WjeFHYwl+cXCxxDpdABHcmdIKmBw8CN7lfB2BYH5DRFX4Nm0uj2xKdSSgES2Yws8ScUanq764u9KxXQ/bKV9axfeC+c34Q= Received: from DS7PR03CA0266.namprd03.prod.outlook.com (2603:10b6:5:3b3::31) by DM6PR12MB4942.namprd12.prod.outlook.com (2603:10b6:5:1be::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 09:26:06 +0000 Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:5:3b3:cafe::21) by DS7PR03CA0266.outlook.office365.com (2603:10b6:5:3b3::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21 via Frontend Transport; Fri, 12 Jan 2024 09:26:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Fri, 12 Jan 2024 09:26:06 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:26:01 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Wyes Karny Subject: [PATCH V13 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting. Date: Fri, 12 Jan 2024 17:25:27 +0800 Message-ID: <20240112092531.789841-4-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|DM6PR12MB4942:EE_ X-MS-Office365-Filtering-Correlation-Id: da08a108-9595-4cd3-2a06-08dc1350815a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tQ8m7Sz0iYtMK8IpdAgLoJaRRIYFWA2HxhZAFVJVzoVL2iACd/3Ti3Qur3TVAqPWYXG1f3L5g5maiGbDXmZv3PMMBGUZM10FxzVQw9DPEwQdc8ZgNzkUAZ11Zipdr4YwjZdP9bf5DymiMKo3jDMjVltbUJMVoGTRi270p6A5v2q1EvhA+VgJBLihqYxaANh1AN41xh2F4qwDKsM/mmpg1OPDy4JGTpb0ZrRyCMoGm+qBi6FCWk2Ya5gfK3zNrOnyMlMYeSUTGFL05ccq8NwJP4UWlSm5kix/Z1XWbYrVMFe4mzhXeyhOrz3AJeR9lLUneZyjy8ccV7bGG1uEmtvciFwIH8alAmS++m9HcUxbHtTAyp9qgCp3lV7VfxY/LrUTvFjK+P7NjHi/YdI2fMt4uTuDE+PENi6YxV7ed4p3KVudA0XMVxVkar7PKZly2IZ2ShLxEphbjAUZ0F4nj0XD/IM2CDf0XJ6oqdlTu6rvmqwbx2V4dvnuCGS4gOMGzC/XMJ1bliFB7pbEkorMorzURQXdxZyXegtF7LMjkBR+l3P7MDJYfQ23rFBWUYGKhE5OaqXJ8xSXkn8U/JjfxKb/ss84ies5p6U4Ep8PWJm+NOPTlOk+1ADFoRuE80C+kgdSSaDWXBcywZW+mbJFPSu48DUYFBQxsMOUtdjv3vNYjyt45fjR+3eWTJZqN79NGtRh0xnCDdTdUo6wUjCOKbgsYxqs4f4NobOcks63vq3bYibOqN4McywWcz2EtNeQgTzDQQkrwi5p74FgobhF+VNhZQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(396003)(136003)(39860400002)(376002)(346002)(230922051799003)(451199024)(64100799003)(1800799012)(82310400011)(186009)(40470700004)(46966006)(36840700001)(336012)(83380400001)(1076003)(16526019)(426003)(47076005)(26005)(2616005)(36860700001)(316002)(7416002)(6636002)(110136005)(54906003)(70206006)(5660300002)(4326008)(70586007)(8936002)(8676002)(6666004)(7696005)(86362001)(478600001)(41300700001)(2906002)(36756003)(356005)(82740400003)(81166007)(40460700003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:06.7311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da08a108-9595-4cd3-2a06-08dc1350815a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4942 amd-pstate driver utilizes the functions and data structures provided by the ITMT architecture to enable the scheduler to favor scheduling on cores which can be get a higher frequency with lower voltage. We call it amd-pstate preferrred core. Here sched_set_itmt_core_prio() is called to set priorities and sched_set_itmt_support() is called to enable ITMT feature. amd-pstate driver uses the highest performance value to indicate the priority of CPU. The higher value has a higher priority. The initial core rankings are set up by amd-pstate when the system boots. Add a variable hw_prefcore in cpudata structure. It will check if the processor and power firmware support preferred core feature. Add one new early parameter `disable` to allow user to disable the preferred core. Only when hardware supports preferred core and user set `enabled` in early parameter, amd pstate driver supports preferred core featue. Tested-by: Oleksandr Natalenko Reviewed-by: Huang Rui Reviewed-by: Wyes Karny Reviewed-by: Mario Limonciello Co-developed-by: Perry Yuan Signed-off-by: Perry Yuan Signed-off-by: Meng Li --- drivers/cpufreq/amd-pstate.c | 131 ++++++++++++++++++++++++++++++++--- include/linux/amd-pstate.h | 4 ++ 2 files changed, 127 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 1f6186475715..9c2790753f99 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -49,6 +50,7 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 +#define AMD_PSTATE_PREFCORE_THRESHOLD 166 /* * TODO: We need more time to fine tune processors with shared memory solution @@ -64,6 +66,7 @@ static struct cpufreq_driver amd_pstate_driver; static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; +static bool amd_pstate_prefcore = true; /* * AMD Energy Preference Performance (EPP) @@ -297,13 +300,14 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) if (ret) return ret; - /* - * TODO: Introduce AMD specific power feature. - * - * CPPC entry doesn't indicate the highest performance in some ASICs. + /* For platforms that do not support the preferred core feature, the + * highest_pef may be configured with 166 or 255, to avoid max frequency + * calculated wrongly. we take the AMD_CPPC_HIGHEST_PERF(cap1) value as + * the default max perf. */ - highest_perf = amd_get_highest_perf(); - if (highest_perf > AMD_CPPC_HIGHEST_PERF(cap1)) + if (cpudata->hw_prefcore) + highest_perf = AMD_PSTATE_PREFCORE_THRESHOLD; + else highest_perf = AMD_CPPC_HIGHEST_PERF(cap1); WRITE_ONCE(cpudata->highest_perf, highest_perf); @@ -324,8 +328,9 @@ static int cppc_init_perf(struct amd_cpudata *cpudata) if (ret) return ret; - highest_perf = amd_get_highest_perf(); - if (highest_perf > cppc_perf.highest_perf) + if (cpudata->hw_prefcore) + highest_perf = AMD_PSTATE_PREFCORE_THRESHOLD; + else highest_perf = cppc_perf.highest_perf; WRITE_ONCE(cpudata->highest_perf, highest_perf); @@ -706,6 +711,80 @@ static void amd_perf_ctl_reset(unsigned int cpu) wrmsrl_on_cpu(cpu, MSR_AMD_PERF_CTL, 0); } +/* + * Set amd-pstate preferred core enable can't be done directly from cpufreq callbacks + * due to locking, so queue the work for later. + */ +static void amd_pstste_sched_prefcore_workfn(struct work_struct *work) +{ + sched_set_itmt_support(); +} +static DECLARE_WORK(sched_prefcore_work, amd_pstste_sched_prefcore_workfn); + +/* + * Get the highest performance register value. + * @cpu: CPU from which to get highest performance. + * @highest_perf: Return address. + * + * Return: 0 for success, -EIO otherwise. + */ +static int amd_pstate_get_highest_perf(int cpu, u32 *highest_perf) +{ + int ret; + + if (boot_cpu_has(X86_FEATURE_CPPC)) { + u64 cap1; + + ret = rdmsrl_safe_on_cpu(cpu, MSR_AMD_CPPC_CAP1, &cap1); + if (ret) + return ret; + WRITE_ONCE(*highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); + } else { + u64 cppc_highest_perf; + + ret = cppc_get_highest_perf(cpu, &cppc_highest_perf); + if (ret) + return ret; + WRITE_ONCE(*highest_perf, cppc_highest_perf); + } + + return (ret); +} + +#define CPPC_MAX_PERF U8_MAX + +static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) +{ + int ret, prio; + u32 highest_perf; + + ret = amd_pstate_get_highest_perf(cpudata->cpu, &highest_perf); + if (ret) + return; + + cpudata->hw_prefcore = true; + /* check if CPPC preferred core feature is enabled*/ + if (highest_perf < CPPC_MAX_PERF) + prio = (int)highest_perf; + else { + pr_debug("AMD CPPC preferred core is unsupported!\n"); + cpudata->hw_prefcore = false; + return; + } + + if (!amd_pstate_prefcore) + return; + + /* + * The priorities can be set regardless of whether or not + * sched_set_itmt_support(true) has been called and it is valid to + * update them at any time after it has been called. + */ + sched_set_itmt_core_prio(prio, cpudata->cpu); + + schedule_work(&sched_prefcore_work); +} + static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; @@ -727,6 +806,8 @@ static int amd_pstate_cpu_init(struct cpufreq_policy *policy) cpudata->cpu = policy->cpu; + amd_pstate_init_prefcore(cpudata); + ret = amd_pstate_init_perf(cpudata); if (ret) goto free_cpudata1; @@ -877,6 +958,17 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, return sysfs_emit(buf, "%u\n", perf); } +static ssize_t show_amd_pstate_hw_prefcore(struct cpufreq_policy *policy, + char *buf) +{ + bool hw_prefcore; + struct amd_cpudata *cpudata = policy->driver_data; + + hw_prefcore = READ_ONCE(cpudata->hw_prefcore); + + return sysfs_emit(buf, "%s\n", str_enabled_disabled(hw_prefcore)); +} + static ssize_t show_energy_performance_available_preferences( struct cpufreq_policy *policy, char *buf) { @@ -1074,18 +1166,27 @@ static ssize_t status_store(struct device *a, struct device_attribute *b, return ret < 0 ? ret : count; } +static ssize_t prefcore_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sysfs_emit(buf, "%s\n", str_enabled_disabled(amd_pstate_prefcore)); +} + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); cpufreq_freq_attr_ro(amd_pstate_highest_perf); +cpufreq_freq_attr_ro(amd_pstate_hw_prefcore); cpufreq_freq_attr_rw(energy_performance_preference); cpufreq_freq_attr_ro(energy_performance_available_preferences); static DEVICE_ATTR_RW(status); +static DEVICE_ATTR_RO(prefcore); static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, &amd_pstate_lowest_nonlinear_freq, &amd_pstate_highest_perf, + &amd_pstate_hw_prefcore, NULL, }; @@ -1093,6 +1194,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { &amd_pstate_max_freq, &amd_pstate_lowest_nonlinear_freq, &amd_pstate_highest_perf, + &amd_pstate_hw_prefcore, &energy_performance_preference, &energy_performance_available_preferences, NULL, @@ -1100,6 +1202,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { static struct attribute *pstate_global_attributes[] = { &dev_attr_status.attr, + &dev_attr_prefcore.attr, NULL }; @@ -1151,6 +1254,8 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) cpudata->cpu = policy->cpu; cpudata->epp_policy = 0; + amd_pstate_init_prefcore(cpudata); + ret = amd_pstate_init_perf(cpudata); if (ret) goto free_cpudata1; @@ -1568,7 +1673,17 @@ static int __init amd_pstate_param(char *str) return amd_pstate_set_driver(mode_idx); } + +static int __init amd_prefcore_param(char *str) +{ + if (!strcmp(str, "disable")) + amd_pstate_prefcore = false; + + return 0; +} + early_param("amd_pstate", amd_pstate_param); +early_param("amd_prefcore", amd_prefcore_param); MODULE_AUTHOR("Huang Rui "); MODULE_DESCRIPTION("AMD Processor P-state Frequency Driver"); diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index 6ad02ad9c7b4..68fc1bd8d851 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -52,6 +52,9 @@ struct amd_aperf_mperf { * @prev: Last Aperf/Mperf/tsc count value read from register * @freq: current cpu frequency value * @boost_supported: check whether the Processor or SBIOS supports boost mode + * @hw_prefcore: check whether HW supports preferred core featue. + * Only when hw_prefcore and early prefcore param are true, + * AMD P-State driver supports preferred core featue. * @epp_policy: Last saved policy used to set energy-performance preference * @epp_cached: Cached CPPC energy-performance preference value * @policy: Cpufreq policy value @@ -85,6 +88,7 @@ struct amd_cpudata { u64 freq; bool boost_supported; + bool hw_prefcore; /* EPP feature related attributes*/ s16 epp_policy; From patchwork Fri Jan 12 09:25:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 763234 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2078.outbound.protection.outlook.com [40.107.101.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD2D85DF02; Fri, 12 Jan 2024 09:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="VaWReXv/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FXou3Mbuf5/GZpTYPGmzVL+NRyHGS66pVFyMgowKRw9NTgGKH1pZU011O8sWAdHAXuMQ2Uh393PjbZrnh2lT30NZg0/7nHtoldPKNxeh5k8N72FebLhbw1iFAywij8FlQJ7bGU+qauDhv6cgmWQXqYW+UgSEiKBY82min2im/+9SVQlKVPMdD7beoBgGLZwKWiJb17l17/B21jfJYW/drKf2Lacqp+EZgJvT4TeD1gNnAG6hIbmqFbYLL3/A4KW6qZYw9OS0fFrbwskRgXjytJfUOGuxb6EPXT22AqYas2Du7f0F5QcwyVpb1AiDnzW2urABw09diZkspN1ednYYcg== 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=hu+YEu2Sbk5GsR0yEizZBiZEKUntkXmdXSeViAKSt+8=; b=brFxmHJNUPb+hnYhMbMZR5vlZmkDcnAeauLCmP+mHvvRTp8Q0y/ThcIeXnTIgQV1QC/t818j1dVShdeC6IyF3CcgdYuJpE8IsYOZEYb/XrTmL6q8W5YMBHgOugiIV7e2ZQWY8zqbItQ5gy649CTN+8EwAa6w1jJGPVLXCRdj1YIe779lh9EDdssgaU221i0URICCyyMI8edzmU6o6/xUN2WhbHJCzKpKPp7yH9j3Ov+CA99WrGpjKFm2kL9FRLU2VU8YSr9CRj0rr/u7b07aWiZSj1KAhmDtT616oAp2KIwPGbK14Il1SMZ6nFwbMmdFCjrRadyxdnSux9FBIy2d6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hu+YEu2Sbk5GsR0yEizZBiZEKUntkXmdXSeViAKSt+8=; b=VaWReXv/BPR8SQ0iwXg1ZA0MYNAE8FSTwOJvPqNIzFlex3dzT3lo6PA1K16Jt4FJXi1qFxXcEvAPK2tdvNExm9e7q6CB+LwJ/5PhCgOjPrrRQE142UMAV9+1Rs8/mMLoPkhboMDY4A69uZIK5fqqZ0dG74G/89PWaD1WYP5vZqM= Received: from DM6PR07CA0091.namprd07.prod.outlook.com (2603:10b6:5:337::24) by MW3PR12MB4362.namprd12.prod.outlook.com (2603:10b6:303:5d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 09:26:12 +0000 Received: from DS1PEPF0001708E.namprd03.prod.outlook.com (2603:10b6:5:337:cafe::ce) by DM6PR07CA0091.outlook.office365.com (2603:10b6:5:337::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.19 via Frontend Transport; Fri, 12 Jan 2024 09:26:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF0001708E.mail.protection.outlook.com (10.167.17.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 09:26:11 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:26:06 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Perry Yuan Subject: [PATCH V13 4/7] cpufreq: Add a notification message that the highest perf has changed Date: Fri, 12 Jan 2024 17:25:28 +0800 Message-ID: <20240112092531.789841-5-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001708E:EE_|MW3PR12MB4362:EE_ X-MS-Office365-Filtering-Correlation-Id: cf901fd6-485e-4886-6d4b-08dc1350844d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2c7Xt0F8oRAAsEvVg8nWjqLtEW7Bl8HjKEWOBw8iiDZeQ761X0UWj2HrOqGYHusYnB1qticff00LtnngJbLn0061NHwt+23rwj9udCUBKbmNv6YkUbjZSSkFhaAh2a5EBGq7SrEwLVVuL1zr7ZlJONoY9iCWiLLMbIhxYc/uR+4jGkHcRGB9tF+nAAZ3bcp+97A5wIrs8Lhv80D8X1l2iQz2i+twPI1/3DJG6rHinYqpNAa+O/s8wWH9k74zXuldrcc5lEa1vnB3SEY4tUogPLqKTDMpYdx+FkFp7bIZ+bOeQ8X5F3HUHMX7Mtmg1Y3YEb2Gu4ykHcMmwjsZ+Kj1WNKkzSPMl4oSNPtz54ZhcRuTCGffHaM0YY2rVQ4pCkadizRJgrxm5p6x0GMg56mcs1D2uTIB27m2XaGRnW0JIHjWKKE4JtkuxWhJgd2rszvFQLqjLaU05ier/8XMvm1Xwf66Pfxt1DJW3/Nl1otS1eXyTAMJgYj92qrfvxZ7sCWasJv3OM63t1He4n+3o1KeEXPnJ108LQjeonnhpDl9Q9faCMUsFMBV0EtzJesUPy1yW5+r8YC2u6jn9SZmFNL1fTkXOObJbH1j5GT7TZXPlwYWasMzezikCnDFQ0AJWmhwevinICavka+R45o7JDTvZWgMlX/5rFeeI/VVJdF4C2O+FRSWDHeC0o75Dt9RfA+H9TuLutrrE9MlYfBAmpIxLsGXN8ceCOUQtNH5GsxavEASdz0DpkGifMP3kkM44uHMZQH66/LP/JR8gljeqKTQ64gGkQG2doR+Wl2CkBH0XMY= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(39860400002)(136003)(376002)(396003)(230922051799003)(82310400011)(1800799012)(64100799003)(451199024)(186009)(46966006)(36840700001)(40470700004)(426003)(16526019)(86362001)(83380400001)(41300700001)(7696005)(6666004)(966005)(336012)(478600001)(2616005)(26005)(1076003)(6636002)(47076005)(4326008)(82740400003)(40480700001)(36756003)(70586007)(70206006)(8676002)(8936002)(54906003)(316002)(81166007)(110136005)(40460700003)(7416002)(2906002)(356005)(5660300002)(15650500001)(36860700001)(226483002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:11.6808 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cf901fd6-485e-4886-6d4b-08dc1350844d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001708E.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4362 BIOS issues the notify 0x85 to OS that the highest performance changed. And it will affect the ranking of the preferred core. AMD-pstate driver will set the priority of cores based on the preferred core ranking. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: Meng Li Link: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#processor-device-notification-values --- drivers/acpi/processor_driver.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 4bd16b3f0781..67db60eda370 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c @@ -27,6 +27,7 @@ #define ACPI_PROCESSOR_NOTIFY_PERFORMANCE 0x80 #define ACPI_PROCESSOR_NOTIFY_POWER 0x81 #define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82 +#define ACPI_PROCESSOR_NOTIFY_HIGEST_PERF_CHANGED 0x85 MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Processor Driver"); @@ -83,6 +84,11 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) acpi_bus_generate_netlink_event(device->pnp.device_class, dev_name(&device->dev), event, 0); break; + case ACPI_PROCESSOR_NOTIFY_HIGEST_PERF_CHANGED: + cpufreq_update_limits(pr->id); + acpi_bus_generate_netlink_event(device->pnp.device_class, + dev_name(&device->dev), event, 0); + break; default: acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event); break; From patchwork Fri Jan 12 09:25:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 762410 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05C3D5DF32; Fri, 12 Jan 2024 09:26:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="Iqf1X4UO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=exytUt1xftiXhkyHV9ftWsCUGF4k6emydwSj/jvxvJRqmLO9A0PsxUrwYL4no5SSlJTw55QT4AsmNRdqcYz/ai0xiItcRPVxqr7vqhbfhm3dPmVLsErXS0Suo3m9OOOwNkDj75ltvOIDlGMgD821KalLKyw75NqqY0yTWTQoTc7sURK1k4EsTwb2YWyysMuAwSLjdACVxSrp6Z5V5RMDVEoNkSaSRFqJIL7U+koqDpfeaXxmfXYbqVyZNxG9dXQ0RQ6slkwdAXSTR0y5RYpAyvOOfAGKN26zNA4ewMtuatvIyF3E+kUn9ctEe9grFMsa/xlTC48GyPLKlpF5RATguA== 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=fX2Ta/Gv798M7peRlFChK9xqESpeKi5VXhhwayFgnPw=; b=hEjiBCuS9mBdgTGC8GTVmReKDFuNH4PfUjQOATyMYjJVeZic2Rg6ALodeYvT1CXxrACQpu3eZTaEs/AetEFJuHmO04rMJ5c1jru2vSIeQSsWJ1gNYpTua4Fe+YgA6P47We6iMW9P0sdN+FouHGmYoXLUBhJPw+Y/KoAY7Ji7O2KZmeOdJHJPWNfdlRUkoQF2tQEmjkmPAgElc+0wAfrt6Xf6cdmazE+1osZxnfHvQ5Yrqy8xF5rPL141bjk5AKh5cIlN2zxm5D5ysfo9E+ZyEv/gmmBKjGZ9l37zBc/agLGEOyQtko2joZ1SW4pRD3h7VPg60rY2150B8W98S6n5Rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fX2Ta/Gv798M7peRlFChK9xqESpeKi5VXhhwayFgnPw=; b=Iqf1X4UOCDZagrj/7NYPxuXT6jK7M1Luu9sGDZoXYN3/sk/QJA/wfcv6S/Qd+b7DdMTQYWWq3XnXD2nxcL+bPpoKIestQ0xif4tu2TUfwS4qAq/EQniR4V2M14A9jqoj9rIDwdk/cD5Nt/0fcmIyYg3m90NPnAcESHwH1GDvMDw= Received: from DM6PR03CA0035.namprd03.prod.outlook.com (2603:10b6:5:40::48) by CH3PR12MB9429.namprd12.prod.outlook.com (2603:10b6:610:1c9::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 09:26:17 +0000 Received: from DS1PEPF00017091.namprd03.prod.outlook.com (2603:10b6:5:40:cafe::63) by DM6PR03CA0035.outlook.office365.com (2603:10b6:5:40::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18 via Frontend Transport; Fri, 12 Jan 2024 09:26:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017091.mail.protection.outlook.com (10.167.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 09:26:17 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:26:11 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Wyes Karny , Perry Yuan Subject: [PATCH V13 5/7] cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically Date: Fri, 12 Jan 2024 17:25:29 +0800 Message-ID: <20240112092531.789841-6-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017091:EE_|CH3PR12MB9429:EE_ X-MS-Office365-Filtering-Correlation-Id: 5efb09fd-cc5a-4e33-4b60-08dc13508780 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xEBKJUOWoef62IBXM8x9t6OGE7ANAhkp/6Uojhf9DVsG2LYi+B9Yqe4BSY9JvSL7Lsg0xvNYfkgKYJ8ayBfHm5pS4gi3YoYXn13+vJ4cR+CZCeBmslcwJdOobeqApoU1+g8iBkrrG5n47qmpqwowHGSiCtjkCM1RpDbFidYPIn8zbmc19mfAdzvtpenBVE6ugWY3MTCAmcqHawjGwWOYiZs7/PHET5twhPYwGEtTOUT8f7v9nxTITrCquQob5h5+0SHNrIy+55t4dJCls8DaubvCA+kF/yBCg/D5BEgRdseuR8hkEhOBEaIhVtND9ukKQYa8y/Gv6OolgNRy1LnIDn2Yih2qI3uLKSJCJ6X/kwompFyIDDkYpez9seVA228ZL7qeetkUn2oPpBbBYyxSAgjm9SXhZ0LVrIsBBWdEM8GgR0aa/kV5XuO/s1OHFJtxfr2LZwCpIyORnQ/Qd1NBmaNbxJUFntVObNjRoEWmU+cBCTE2L+498T3hAKZ/7bJ6Cj3Sox7dWUBRgTjIeN2tpdK5JYPIWmWcGVWw57oA0V8K9aHvfAC1ypCNOahmcsOVVUi3v0tD3Ix4RCueqYYpynqLIP9RJNJG4DyVn3O7D5stghPFTf6sAE2GiFMUEbtFcFv2ZuHa4eeERH68ay10aswvJ/WuibdPpV/1UzR381m/8j+DLxes40BJN09JhlRNHmz4sBPHTei2cza8ZdjNOF2wvkbJ152epeCiWPUdV2vC3nyiGNluh851cuR48ItpoeggMt21Tqj4Ww870wuCWA== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(39860400002)(376002)(396003)(136003)(230922051799003)(451199024)(64100799003)(82310400011)(186009)(1800799012)(36840700001)(46966006)(40470700004)(7696005)(6666004)(478600001)(426003)(336012)(26005)(1076003)(16526019)(2616005)(6636002)(316002)(36756003)(8936002)(8676002)(70586007)(70206006)(54906003)(110136005)(356005)(81166007)(82740400003)(83380400001)(47076005)(86362001)(4326008)(36860700001)(5660300002)(15650500001)(7416002)(2906002)(41300700001)(66899024)(40480700001)(40460700003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:17.0630 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5efb09fd-cc5a-4e33-4b60-08dc13508780 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017091.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9429 Preferred core rankings can be changed dynamically by the platform based on the workload and platform conditions and accounting for thermals and aging. When this occurs, cpu priority need to be set. Tested-by: Oleksandr Natalenko Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: Meng Li --- drivers/cpufreq/amd-pstate.c | 52 ++++++++++++++++++++++++++++++++++++ include/linux/amd-pstate.h | 6 +++++ 2 files changed, 58 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9c2790753f99..3034b8ff3f8e 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -315,6 +315,7 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1)); WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1)); WRITE_ONCE(cpudata->lowest_perf, AMD_CPPC_LOWEST_PERF(cap1)); + WRITE_ONCE(cpudata->prefcore_ranking, AMD_CPPC_HIGHEST_PERF(cap1)); WRITE_ONCE(cpudata->min_limit_perf, AMD_CPPC_LOWEST_PERF(cap1)); return 0; } @@ -339,6 +340,7 @@ static int cppc_init_perf(struct amd_cpudata *cpudata) WRITE_ONCE(cpudata->lowest_nonlinear_perf, cppc_perf.lowest_nonlinear_perf); WRITE_ONCE(cpudata->lowest_perf, cppc_perf.lowest_perf); + WRITE_ONCE(cpudata->prefcore_ranking, cppc_perf.highest_perf); WRITE_ONCE(cpudata->min_limit_perf, cppc_perf.lowest_perf); if (cppc_state == AMD_PSTATE_ACTIVE) @@ -785,6 +787,40 @@ static void amd_pstate_init_prefcore(struct amd_cpudata *cpudata) schedule_work(&sched_prefcore_work); } +static void amd_pstate_update_limits(unsigned int cpu) +{ + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + struct amd_cpudata *cpudata = policy->driver_data; + u32 prev_high = 0, cur_high = 0; + int ret; + bool highest_perf_changed = false; + + mutex_lock(&amd_pstate_driver_lock); + if ((!amd_pstate_prefcore) || (!cpudata->hw_prefcore)) + goto free_cpufreq_put; + + ret = amd_pstate_get_highest_perf(cpu, &cur_high); + if (ret) + goto free_cpufreq_put; + + prev_high = READ_ONCE(cpudata->prefcore_ranking); + if (prev_high != cur_high) { + highest_perf_changed = true; + WRITE_ONCE(cpudata->prefcore_ranking, cur_high); + + if (cur_high < CPPC_MAX_PERF) + sched_set_itmt_core_prio((int)cur_high, cpu); + } + +free_cpufreq_put: + cpufreq_cpu_put(policy); + + if (!highest_perf_changed) + cpufreq_update_policy(cpu); + + mutex_unlock(&amd_pstate_driver_lock); +} + static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; @@ -958,6 +994,17 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, return sysfs_emit(buf, "%u\n", perf); } +static ssize_t show_amd_pstate_prefcore_ranking(struct cpufreq_policy *policy, + char *buf) +{ + u32 perf; + struct amd_cpudata *cpudata = policy->driver_data; + + perf = READ_ONCE(cpudata->prefcore_ranking); + + return sysfs_emit(buf, "%u\n", perf); +} + static ssize_t show_amd_pstate_hw_prefcore(struct cpufreq_policy *policy, char *buf) { @@ -1176,6 +1223,7 @@ cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); cpufreq_freq_attr_ro(amd_pstate_highest_perf); +cpufreq_freq_attr_ro(amd_pstate_prefcore_ranking); cpufreq_freq_attr_ro(amd_pstate_hw_prefcore); cpufreq_freq_attr_rw(energy_performance_preference); cpufreq_freq_attr_ro(energy_performance_available_preferences); @@ -1186,6 +1234,7 @@ static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, &amd_pstate_lowest_nonlinear_freq, &amd_pstate_highest_perf, + &amd_pstate_prefcore_ranking, &amd_pstate_hw_prefcore, NULL, }; @@ -1194,6 +1243,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { &amd_pstate_max_freq, &amd_pstate_lowest_nonlinear_freq, &amd_pstate_highest_perf, + &amd_pstate_prefcore_ranking, &amd_pstate_hw_prefcore, &energy_performance_preference, &energy_performance_available_preferences, @@ -1538,6 +1588,7 @@ static struct cpufreq_driver amd_pstate_driver = { .suspend = amd_pstate_cpu_suspend, .resume = amd_pstate_cpu_resume, .set_boost = amd_pstate_set_boost, + .update_limits = amd_pstate_update_limits, .name = "amd-pstate", .attr = amd_pstate_attr, }; @@ -1552,6 +1603,7 @@ static struct cpufreq_driver amd_pstate_epp_driver = { .online = amd_pstate_epp_cpu_online, .suspend = amd_pstate_epp_suspend, .resume = amd_pstate_epp_resume, + .update_limits = amd_pstate_update_limits, .name = "amd-pstate-epp", .attr = amd_pstate_epp_attr, }; diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index 68fc1bd8d851..d21838835abd 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -39,11 +39,16 @@ struct amd_aperf_mperf { * @cppc_req_cached: cached performance request hints * @highest_perf: the maximum performance an individual processor may reach, * assuming ideal conditions + * For platforms that do not support the preferred core feature, the + * highest_pef may be configured with 166 or 255, to avoid max frequency + * calculated wrongly. we take the fixed value as the highest_perf. * @nominal_perf: the maximum sustained performance level of the processor, * assuming ideal operating conditions * @lowest_nonlinear_perf: the lowest performance level at which nonlinear power * savings are achieved * @lowest_perf: the absolute lowest performance level of the processor + * @prefcore_ranking: the preferred core ranking, the higher value indicates a higher + * priority. * @max_freq: the frequency that mapped to highest_perf * @min_freq: the frequency that mapped to lowest_perf * @nominal_freq: the frequency that mapped to nominal_perf @@ -73,6 +78,7 @@ struct amd_cpudata { u32 nominal_perf; u32 lowest_nonlinear_perf; u32 lowest_perf; + u32 prefcore_ranking; u32 min_limit_perf; u32 max_limit_perf; u32 min_limit_freq; From patchwork Fri Jan 12 09:25:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 763233 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8223857303; Fri, 12 Jan 2024 09:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="K+5Bpiqp" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GIHW6AZ6rBCBEFRPcl6TksJb2MHD+HiciQp7RUPkSfiaflcUMHZm/xfb6WbGQ8MKT3vdCK0MCWWe72Eg5MovR32tGYQRLmbN9yOAzfPW/2s/BZSCCRdg/SpQPkQhy3unarFcA9ODnRhS3JYjhOpsYXuSBWkPd1ZwrDjxeTAN5pzcj14pyAQGeJ0Ll3MsIAEakxoseEJl7ADMEZaifc1GVltCt7E4Z511NyIiBTeEowXAM4TXoMEQEcefKkmmOohnBOanO3ONUbYrJmXO2mMT3xHez4ADi6Md4e0rQ3QebngNG5sCTfgv8CVrVz5fbIaPdFa2AuoxbvmcXgU+zZuaEA== 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=CkcLPe+OdQhX1JrIwqUungjFDn7/6QsByHrqLs7zL9M=; b=nq1gWLJHer3ST8UlUgTTHZ3U15YpuZ/OY+SMDwOqCpR/W0tOgDoMRv2K09b2CN1FgIy0r+/t/lZHSNZIRNDTD6iMIWkkKpYUasi1U9SObbVal9D8KnbhsWap7NLSLccpgy9WgjmTwCuhnNDzHcALAvr90Os+ArIyA5ehWF37sL0m6x0HWsSgjbmqQoqxA59F56JIerhXp/Y/uMXH1qLlGPFcXwf8HCpUJLD7vXCUdU5LUXen8M1QU3kIaa35XJQAVKPDOhhlsc3vB0DDTCPvgr31qOkIq2kFOCvFy5bNuVBTqHL+3xR3plA7tNP290AoC35WM6C1fUcUzn3tWHOT7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CkcLPe+OdQhX1JrIwqUungjFDn7/6QsByHrqLs7zL9M=; b=K+5Bpiqp06574XeuZN382mJZoXd25R1lGFJHi5MmeE4l6XBx23yLJ9rHswtG6dQQAkIuhKNtgCAg1IM3eWnIQ9YW8GDQSHyuHf/599QDxlOFV2/WbwgPwzqOuL7GqbBEla3/csIXOtGniys3JdpNn+QEHigVCD4OHThmXp/s+yc= Received: from DS7PR03CA0052.namprd03.prod.outlook.com (2603:10b6:5:3b5::27) by DM6PR12MB4404.namprd12.prod.outlook.com (2603:10b6:5:2a7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Fri, 12 Jan 2024 09:26:29 +0000 Received: from DS1PEPF00017090.namprd03.prod.outlook.com (2603:10b6:5:3b5:cafe::3) by DS7PR03CA0052.outlook.office365.com (2603:10b6:5:3b5::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21 via Frontend Transport; Fri, 12 Jan 2024 09:26:29 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017090.mail.protection.outlook.com (10.167.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.14 via Frontend Transport; Fri, 12 Jan 2024 09:26:29 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:26:16 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Wyes Karny , Perry Yuan Subject: [PATCH V13 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core Date: Fri, 12 Jan 2024 17:25:30 +0800 Message-ID: <20240112092531.789841-7-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017090:EE_|DM6PR12MB4404:EE_ X-MS-Office365-Filtering-Correlation-Id: d3a67854-2250-4fff-f73a-08dc13508f13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AjCip25QjwrcglpJonTg1upMSnEUudi6VZTkJPn5kw1i3NIFMYemMnztssAzUCwRtPNWlu4xHSI6pSu14Rua0BV30Mh683nfGLtTzQLIhxhsq2Bg5oRhbJoxNcMpfiLcs5bHJXbCK04xYsbkzYpAV3qFHumjQMkGrTjDD5zIRXLwEbZSvluczKhywIFiGtj714U1/8XPH/A/UxGdj2eEOGAHeTENKXg0ylRXeUJdzuAFhg9ZcXm7Vk2xrOrBLcxzF+RyMuAMxG2T5NKBMHtyLBpdsZ0LxPEWlCsCtvbXUrs2eCjSVESjA7J8aSri6LpeorI0tqZRwXosCwyDbALB2XXTCf7Q+4WqjkOoE/HwKlAWahFhPONa0nzi5HTyOUUPOpKE1+w2rFnj6bZ4p3CcfBY5KXOIthZyfbmQNJV4b5uk/jIJEVgOgVFBl5p2phQ/fu2YDxPawlqDiOK4Mt6PodPlMbBPWUtpwsXFZGP7w2Nx2+utDHemawvoDUo9lOseHisbbd5M50Q+Q+nfAHnM319HRlSdyGPDhxXH9hj6dc+07lZg94ZlvlwhWEgjC//2weGfB1HaNNHGLnKCfK8rcMUcxcNAEnQpzhCCQwQJ8HNYPF28Bc5hRbGzYad6LEsBttZL0YMNUk0wue2pGASn5duNcISBvwZ9cpNc2zEUJlGArUbNlbIW0fRNUVz66zviT7wfQXDIrZiHy6KdtAcXxikIy+G8tdtHWlvacC03u7k/JfeyG011YsHhnwP5reI+rti2eJT+8lt7TDE8IkNZ0w== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(136003)(376002)(39860400002)(396003)(230922051799003)(451199024)(1800799012)(186009)(82310400011)(64100799003)(46966006)(36840700001)(40470700004)(26005)(1076003)(2616005)(426003)(16526019)(336012)(6666004)(7696005)(478600001)(36860700001)(83380400001)(47076005)(5660300002)(7416002)(2906002)(41300700001)(4326008)(70586007)(70206006)(8676002)(8936002)(6636002)(110136005)(54906003)(316002)(356005)(81166007)(86362001)(82740400003)(36756003)(40460700003)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:29.7435 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3a67854-2250-4fff-f73a-08dc13508f13 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017090.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4404 Introduce amd-pstate preferred core. check preferred core state set by the kernel parameter: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Tested-by: Oleksandr Natalenko Reviewed-by: Wyes Karny Reviewed-by: Mario Limonciello Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Signed-off-by: Meng Li --- Documentation/admin-guide/pm/amd-pstate.rst | 59 ++++++++++++++++++++- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1cf40f69278c..0b832ff529db 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -300,8 +300,8 @@ platforms. The AMD P-States mechanism is the more performance and energy efficiency frequency management method on AMD processors. -AMD Pstate Driver Operation Modes -================================= +``amd-pstate`` Driver Operation Modes +====================================== ``amd_pstate`` CPPC has 3 operation modes: autonomous (active) mode, non-autonomous (passive) mode and guided autonomous (guided) mode. @@ -353,6 +353,48 @@ is activated. In this mode, driver requests minimum and maximum performance level and the platform autonomously selects a performance level in this range and appropriate to the current workload. +``amd-pstate`` Preferred Core +================================= + +The core frequency is subjected to the process variation in semiconductors. +Not all cores are able to reach the maximum frequency respecting the +infrastructure limits. Consequently, AMD has redefined the concept of +maximum frequency of a part. This means that a fraction of cores can reach +maximum frequency. To find the best process scheduling policy for a given +scenario, OS needs to know the core ordering informed by the platform through +highest performance capability register of the CPPC interface. + +``amd-pstate`` preferred core enables the scheduler to prefer scheduling on +cores that can achieve a higher frequency with lower voltage. The preferred +core rankings can dynamically change based on the workload, platform conditions, +thermals and ageing. + +The priority metric will be initialized by the ``amd-pstate`` driver. The ``amd-pstate`` +driver will also determine whether or not ``amd-pstate`` preferred core is +supported by the platform. + +``amd-pstate`` driver will provide an initial core ordering when the system boots. +The platform uses the CPPC interfaces to communicate the core ranking to the +operating system and scheduler to make sure that OS is choosing the cores +with highest performance firstly for scheduling the process. When ``amd-pstate`` +driver receives a message with the highest performance change, it will +update the core ranking and set the cpu's priority. + +``amd-pstate`` Preferred Core Switch +================================= +Kernel Parameters +----------------- + +``amd-pstate`` peferred core`` has two states: enable and disable. +Enable/disable states can be chosen by different kernel parameters. +Default enable ``amd-pstate`` preferred core. + +``amd_prefcore=disable`` + +For systems that support ``amd-pstate`` preferred core, the core rankings will +always be advertised by the platform. But OS can choose to ignore that via the +kernel parameter ``amd_prefcore=disable``. + User Space Interface in ``sysfs`` - General =========================================== @@ -385,6 +427,19 @@ control its functionality at the system level. They are located in the to the operation mode represented by that string - or to be unregistered in the "disable" case. +``prefcore`` + Preferred core state of the driver: "enabled" or "disabled". + + "enabled" + Enable the ``amd-pstate`` preferred core. + + "disabled" + Disable the ``amd-pstate`` preferred core + + + This attribute is read-only to check the state of preferred core set + by the kernel parameter. + ``cpupower`` tool support for ``amd-pstate`` =============================================== From patchwork Fri Jan 12 09:25:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li \(Jassmine\)" X-Patchwork-Id: 762409 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2052.outbound.protection.outlook.com [40.107.100.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CEDA5EE81; Fri, 12 Jan 2024 09:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="YB8QzDj0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bZa02nFLyeW/DgT2I71fYqdKXlEJzsNLJd4mgugeazRZ3zVZOjnXD1kTeogjiw6EQDCE7XRghqT9os4zJm55om7CYE+L6po6Fc3gs6cNGjlMaWYkvyjrEPOsJmIPIlg6mqbiWhlF8kmP0eGV77xvgtXDBbjna8wi9mefk1oRnVA6BOYHiORkMLdsZRkA1lsObnad+pxuaq9hcGhYh1lqTHRU1RGSXGpl+lAItGfO9rZyIUNse9TToGuv81BFD3pi5E0Nm7kU6m6WtjNjmWPS3Jm36lRx/1tk2yqQkKgDb9r09iCgRzMD/3ZVbQY7Uno/13zIH0yE8/Y1rhcfQi00oA== 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=85oIARnE+wv1JlIuF15E0Tk1ufYqSyfbk9En7YmPpPE=; b=ZKmPn1+JOvMKeey5pl8ss88kS92W+rF5iUBJyeJesFqbm2QK85jPz9U98qwHfdHxMld9V+fG4yJLRcCn9zTZ6mXNPMFuBJhr3VmNbP4lTLNOwlmOY+dicZLnGnhb4N0OJVRbS86gW90OQUB9A5aLodtjJCCEoDnEknhggfPirMg4XzkgjqJINUKGLSDT5QsGpIv6xGV6KRDJEnL1eWh2ZTCaVcjf3aPh/opljORiXmGoxgLIxWO+PIRRwt8bTrkJn5cFvMh6JiMzeHAtYE4x1jAp09QUaMMkrpiBvd+FxmCqfF6otTTaKNzu9GCmVxa3YTlE4kv0NywBNTKhDAxg5w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=85oIARnE+wv1JlIuF15E0Tk1ufYqSyfbk9En7YmPpPE=; b=YB8QzDj0/AGT1lTV9eF/VzdB4DTg7kkmklLGtdogbQeYMYeeBWKZC9jhjS981+DIEZ8MLkO7Fu3tEUgoTeIqq3tSIOgYxjc7yMBHnNiAxdwbrBWeKRG33f67Dzc/1Q+ppPEldL4nwHfzkq63SdG2DFjZ2OKygwvIIW5ejmL5s98= Received: from DS7PR03CA0268.namprd03.prod.outlook.com (2603:10b6:5:3b3::33) by SA1PR12MB9245.namprd12.prod.outlook.com (2603:10b6:806:3a7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.17; Fri, 12 Jan 2024 09:26:35 +0000 Received: from DS1PEPF00017095.namprd03.prod.outlook.com (2603:10b6:5:3b3:cafe::3b) by DS7PR03CA0268.outlook.office365.com (2603:10b6:5:3b3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21 via Frontend Transport; Fri, 12 Jan 2024 09:26:35 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS1PEPF00017095.mail.protection.outlook.com (10.167.17.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7181.13 via Frontend Transport; Fri, 12 Jan 2024 09:26:35 +0000 Received: from jasmine-meng.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 12 Jan 2024 03:26:29 -0600 From: Meng Li To: "Rafael J . Wysocki" , Borislav Petkov , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , "Oleksandr Natalenko" , Meng Li , Wyes Karny , Perry Yuan Subject: [PATCH V13 7/7] Documentation: introduce amd-pstate preferrd core mode kernel command line options Date: Fri, 12 Jan 2024 17:25:31 +0800 Message-ID: <20240112092531.789841-8-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240112092531.789841-1-li.meng@amd.com> References: <20240112092531.789841-1-li.meng@amd.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF00017095:EE_|SA1PR12MB9245:EE_ X-MS-Office365-Filtering-Correlation-Id: 68211a65-65ac-4446-7a38-08dc13509235 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xjTiLomlWVjAOmLvPIrjAEtxebmc8yS19FSntbZAUGFN7TH5TvNeMH4rc3pnUeMD8hdaX3Poko0cU/3NMfmycWxP4yMRqVyNabl1KdAXmojXvWvLBpXhvKx88EQPWvvpoL2wbJUXBTJIZ3k/2lbyIQ7BcnpJ1+tBA/nQCVxmosX0fvtn6cHDbp+sp46gxVLh2Z5x9NBgKFIhUeXVVesTm+EsUXUGveDoc6YLSD402V+Rj8Ttx7CMJvArSUFHMeYJz4Kt5+1YcCrYs0m13Vcennz3X1ZTOuvH8P3wCzYRlQa3qtFVpbdKzv6yPzi7fmU9NgYjfppPtHAUgw7/+S0QdUr7xx4Zq7kpdnrBl56gA4dnB4II8bR1VPIFilFdZXbRrz7lwMmspuN/8QlwvcOrRl8TtVyHJRlduWRVLwfU4l033MgJGhF5BVFq1JtUqYxVnxvGbeIVs3khuds9pLXuLYRWTBYbqV33p+TKC6iqjQRxKDN6EawwVi/UjcuEAQgR+BAH5ID5XQnRYCaaIq5onJKSBGy04VvfrKvjgxzfNeY1b0EbmReadexMvYEWZh9iv2i76D5RSg9bivZ0c/fLdlsM07LazsxhjR3p6sHXZH/Y6TkESvb++FOaCt3NyCgmje/HjWOLjPT6kbQSImLEY1OzhOBNX82ISlu107974OE5mNs1VDooSJExD80/3MrL2g4jV4kulLB9DTOL5tszvYeKQURXa2UxmOcfF/IFmNXYVaTVzDAzpneXPbs1+y2Dt5Dt/IEoJSitvwj+7E89iMWc9LuA1jDjGfkAjCa3KvrnK2sDmS85wrILgys3iO7T X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(39860400002)(136003)(376002)(346002)(396003)(230922051799003)(451199024)(1800799012)(82310400011)(64100799003)(186009)(46966006)(40470700004)(36840700001)(7416002)(26005)(5660300002)(2616005)(47076005)(2906002)(1076003)(356005)(4326008)(316002)(6666004)(83380400001)(81166007)(110136005)(82740400003)(36860700001)(8676002)(8936002)(54906003)(6636002)(16526019)(41300700001)(478600001)(70586007)(336012)(7696005)(70206006)(426003)(86362001)(36756003)(40460700003)(40480700001)(36900700001)(14943795004); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2024 09:26:35.0119 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68211a65-65ac-4446-7a38-08dc13509235 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF00017095.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB9245 amd-pstate driver support enable/disable preferred core. Default enabled on platforms supporting amd-pstate preferred core. Disable amd-pstate preferred core with "amd_prefcore=disable" added to the kernel command line. Signed-off-by: Meng Li Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Reviewed-by: Huang Rui Reviewed-by: Perry Yuan Tested-by: Oleksandr Natalenko --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 65731b060e3f..cbfa63a87e4a 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -363,6 +363,11 @@ selects a performance level in this range and appropriate to the current workload. + amd_prefcore= + [X86] + disable + Disable amd-pstate preferred core. + amijoy.map= [HW,JOY] Amiga joystick support Map of devices attached to JOY0DAT and JOY1DAT Format: ,