From patchwork Tue Sep 5 01:51:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374747 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1474CA1006 for ; Tue, 5 Sep 2023 16:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236982AbjIEQHj (ORCPT ); Tue, 5 Sep 2023 12:07:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245098AbjIEBv7 (ORCPT ); Mon, 4 Sep 2023 21:51:59 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2084.outbound.protection.outlook.com [40.107.243.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 031AFCC6; Mon, 4 Sep 2023 18:51:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TcMOxI2wtT2peNARo880iecfLKwYOe5aIYf7EiG/BqXikSpCssIsRP3WjBIxYBPnmzYD8dOjPu4Z0/dt9EcrkrmdxKwbj9LFzdR+qt5QMCIUgi/JHOzLLHi72nnxNTS8PQ+jgQmdX9DqM29fH0MuAoTcKrsbpyy93ae5pxn+reYRPuOeFbVdpVpCO4za6FvOgGMq2fsUMCWRDl2MfH5vmnuIYRa+Iz0Otf04mdmFkcy0L6twVEL1NR7t2OQYKiJW5yOYQqx2gdJb011+DWi6YIIwsjgBbW+nmxkqCRbTt49mzAEW7vb0yI5rVbKHFLcn/KgzaY/Y56AmeoB1IIheYw== 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=zXcj0zXoBF7oX59mcc+xBH+1Y6SfXN3CExtZsfEoyao=; b=D8cnPhCOKMkDHyf0djGjfzPXKd5prAx2UoRPTjZH6O18WATWxobw2V0LyW6Z4xKYCzLWQuwARJupy/KGB5OrG9bGgtTN+4gDJZmTeBZvWLpreiiuJdNeUqNeZ/m4MrlLslRWMHCfvQbn1AUkxgIgMhg7Nsl0AqV2B35wukw7irTVOn4/lqU5rEnJVfEaRSj21jlh1P0upW0toP+TRGHFhv2keixNsOOszTK9Deox2pjJKJlOCJcjwlzIjKeoG98S8qEhoneku2xqbCF5QL5AIfYQrLocG9uuB65jrHZ5qAUme8pvdyXMaHCF0osltg4yGVEqJlhoD7Dp7iCmZD7Zsg== 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 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=zXcj0zXoBF7oX59mcc+xBH+1Y6SfXN3CExtZsfEoyao=; b=5AHOJ/C8TdmHAanRRgb50SNp/DQXLU2jAaKSE4V+RruO7P4exjPW0AxIMUBb0sjsfQYKJsxwAuhpC8h75aEO/GUN4f4dQujKSpYqd/u9M3E2U48AjL5oam25Mx87Y7/Dw0aIWsnc3yD/iSUSU7AwbAfr/B0ZFn9BOw6pjS7naV4= Received: from CY5PR22CA0104.namprd22.prod.outlook.com (2603:10b6:930:65::23) by SA1PR12MB8920.namprd12.prod.outlook.com (2603:10b6:806:38e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.27; Tue, 5 Sep 2023 01:51:53 +0000 Received: from CY4PEPF0000EDD4.namprd03.prod.outlook.com (2603:10b6:930:65:cafe::7f) by CY5PR22CA0104.outlook.office365.com (2603:10b6:930:65::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:51:52 +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 CY4PEPF0000EDD4.mail.protection.outlook.com (10.167.241.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:51:52 +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.27; Mon, 4 Sep 2023 20:51:47 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li Subject: [PATCH V5 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion. Date: Tue, 5 Sep 2023 09:51:10 +0800 Message-ID: <20230905015116.2268926-2-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD4:EE_|SA1PR12MB8920:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ed5a466-f882-4d28-9fba-08dbadb2ad5d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KTou4DNBhntR5WcuTC+lzzZfUcVSSZMO9eWSO6YIPnp0+YhpDuA717FUl4BZD/shS2pivnsZIw54upHEGICNmtp93IBPMys9Efpwk2Lv+QbkoV6fgy08t+15JtDEcD2E0yJWpc3o3LTsWTqaqukIlhcGOfzQqbro909BwtKfas8rZZmOJnDJQgSOr5ugKQfX+V7KpW5HfznEzGm+R/fK5d1H4VDP7o3xAs44kY5PVJNMjWFg4greX/wn46Ltxx7kzWy2roQuHxV+3CHIC5OE8Wm7IO1f2JsADBorqvGn2GyjtzHJcsQGtQIzvJKbzA1zsiL4IGVAyZrEn9CZRfkuDng/rH1FacyzrkkEMHgSWxAXArVGm8ABgF1AusM/MDdUwMwCP4BlHnmUy140EVJ64w9rk9/WQMh3fXKFG59TEsMdVHefe4bNSBfPxMAr0+BFTy3J1pQO1m0eVIY+gvQRaxqGS6JTsBtsg/IpL6/xB89eC4XmTs+EGeXHrdI12cSo1BeqiXzSnhCwppINZnqD1rMCC49IbRh62KDSvNNoZu8v4OSqekO43p79Bet8JFY1oGH+xWzghPs1KVbD8UbVM7dgSzlSW0uvvwwYC33NDiqrxWZeuraia0ODMKnqlvAFsKPbfUdXNlF251JMkVmJxmQWt2IqEEkLgcroP74s5zl/SfxlDjMc8Hu3Is5dYZ4oQZ3Bsc78xB/CJ4UeCKUYWx8Jwj5UMxgWHLMUQvfiOCKl+Mlnf3LlhMQIEcYoZT9LTPStm0puYqlCN0eQeAq8XA== 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)(376002)(39860400002)(396003)(136003)(82310400011)(186009)(451199024)(1800799009)(46966006)(40470700004)(36840700001)(356005)(7696005)(6666004)(83380400001)(478600001)(4744005)(336012)(426003)(26005)(16526019)(6636002)(70206006)(41300700001)(1076003)(316002)(54906003)(70586007)(8936002)(110136005)(2906002)(4326008)(5660300002)(8676002)(2616005)(36756003)(40480700001)(47076005)(36860700001)(86362001)(40460700003)(82740400003)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:51:52.5716 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0ed5a466-f882-4d28-9fba-08dbadb2ad5d 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: CY4PEPF0000EDD4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8920 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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. Signed-off-by: Meng Li Reviewed-by: Mario Limonciello Acked-by: Huang Rui --- arch/x86/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8d9e4b362572..887421b5ee8f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -1052,8 +1052,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 select CPU_FREQ default y help From patchwork Tue Sep 5 01:51:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374619 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4A76CA1005 for ; Tue, 5 Sep 2023 16:07:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239004AbjIEQHQ (ORCPT ); Tue, 5 Sep 2023 12:07:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245106AbjIEBwG (ORCPT ); Mon, 4 Sep 2023 21:52:06 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2087.outbound.protection.outlook.com [40.107.93.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C0F2CC6; Mon, 4 Sep 2023 18:52:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iTrjf0oqiMFjZpZ6c+jnsJagu1o/fY7Iy7JutLeQlq/Hyb+8xNeJWtGFbkM6iWiN2+ZYWm2/vquLqtzlww4uUXce/2sSr8oo0WuEjL5EExK8ww1OoGjWCF6nidSuBiQgXRh2BrYZnzuiPg6IEA5HwKimghBbKFgT6/o9ifri8G0vnOMrHefvgJ0ZA1ivjQchgyWkZ7BZtMVbf1Ag2fAmOdDBvHqeKvrnidZje5puVeDtMyvaB2w1fhER1J4B4XQsrpgEHpMBUA6ZBofxdkvucJ4KaPZNf3987jBKMMKGLB3A5YGXfHIIbGjesoPj7ZyWd6GLeelaY41tEuwAPmlRSA== 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=Ws2yf4YYsM18t4BNSIPeY2jo1PNGYVhD5jWIe4u2ENI=; b=jjwXHO8IuKcs7xnPNHAojVEJhXrJ9yyN3avhGRwl+/p8Q8CWrc+y+dm8e8jfJ1zRw0KR+ubYyX+nyLOE3ZaAu2tl9O8nt/DNvrjfScfkRMfI/vilynKjp3yFUtny0slLagkYk3EyFVKZJn4FPcZWh8d4zhIOEuRgzyu9Vr4mU0fvXWOVCsaA18Cpx+LnI2r0VcB76VXsa4HEB+uI+Bo2aJWIIlQc9w+Q+z1m6rZ4KYaKnqv09aFbtIAr2v1EjcnbxlKXcVdTMVLgibJlJHsuTeJLuEDN7Ze8TFQoIWiNT7R5T9YYB+2LBaezW8bCCVzmeGviO5LwzTWOA2deIKjSHw== 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 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=Ws2yf4YYsM18t4BNSIPeY2jo1PNGYVhD5jWIe4u2ENI=; b=Eh3uai1HrJCHy90FgJH0LuabRvYhIl8Mlgi1sT0bHAzpKB+/5Aja6w0CpTnhZ3Jw/W/BubRu71nW5TIcjHFrtFg9CUJV+8ZH9E4Y5tbRkxH3jsnwfHY+RcTpE73bWURXaOo7SQ2Cm2M3etkQhiJ3uzDzEj5hW1d0mnnrelRtkx8= Received: from DS7PR03CA0187.namprd03.prod.outlook.com (2603:10b6:5:3b6::12) by DM4PR12MB8558.namprd12.prod.outlook.com (2603:10b6:8:187::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.30; Tue, 5 Sep 2023 01:51:57 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:5:3b6:cafe::9) by DS7PR03CA0187.outlook.office365.com (2603:10b6:5:3b6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:51:57 +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 CY4PEPF0000EDD3.mail.protection.outlook.com (10.167.241.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:51:57 +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.27; Mon, 4 Sep 2023 20:51:52 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li , Wyes Karny Subject: [PATCH V5 2/7] acpi: cppc: Add get the highest performance cppc control Date: Tue, 5 Sep 2023 09:51:11 +0800 Message-ID: <20230905015116.2268926-3-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD3:EE_|DM4PR12MB8558:EE_ X-MS-Office365-Filtering-Correlation-Id: 5d6848bc-7f2c-4300-c552-08dbadb2b031 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JcYr3VaIOjM1Zi7R6CUufjJGsJ5TZ85JqXXMxfoWBYv/Xh+hqjzaFuMCyC8ZDZsTJWX48wJw1gnQASbSe2JCIauln3VLnyEDhhd0XtwB3KryHa4DoOBSPTWlJTCkYwA5lgg5ZDU0bzf4PVtZ4om2vzg7wPqx/vkfRHiaXS6IUkwqU7Xjegbd5IZNJB3uoeiGt/tb+U0xVT/s3Hpa80sfHMF5KnYVyimuOm0zHiv0mFXesNm9+qrjRcF1qvgwni/C2K2xhWy9esRGpXtar1PwzaceI8SUn9OespmEzdE52VwFvfWXnUZrBa9JEjOIlgfn1AXYypV7YN9GjQ+WPoKYBfZMkK3Xp0vHe3J+BOOil72PAaEHXPx3bSC/YMQcvGj9/sfSeox8YnzN3r1YO+w/4Y3o7ri/BDZR2pPBGPnxdyOz7SIpX4bELAQJKzL4h4vx24oYKzEFgryCqq9K3dMuUS2jwMTb/s1FR1+/KSFrAMMWWUfz7Vl2dHwp169EHdqexH5CNsgjyzau70n2LN+BKDcqKPZ196Nzp7NRek8i96gFGb/Egn1C5K3tXEmoeC4izMcrDIV1xW0cz5a6QuqW65Kv5jTij84aZvetljPlyKtR2DV6LlcyZQ3g1cSLuJLyRzlXg1TdhoYpskk2hSmOfo6k737nKYESaurXNiNab7OUhu+CXHEP+2qg3jF7irISp7nhqxDGMcEWJLRNVDQA1k9DQpXmNkoVLXoRoBIj5Q0VFyEYw4lh5eYJhJvCJFW4aXZKZdwYnfmpUXIGh7xHpUr92hDMar94JXVU3PMTq0g= 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)(39860400002)(376002)(136003)(346002)(1800799009)(451199024)(186009)(82310400011)(46966006)(36840700001)(40470700004)(70206006)(316002)(6636002)(36756003)(110136005)(54906003)(86362001)(70586007)(2906002)(40480700001)(8936002)(5660300002)(8676002)(4326008)(40460700003)(41300700001)(1076003)(36860700001)(336012)(2616005)(426003)(16526019)(47076005)(26005)(966005)(478600001)(81166007)(356005)(82740400003)(7696005)(6666004)(15583001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:51:57.3799 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5d6848bc-7f2c-4300-c552-08dbadb2b031 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: CY4PEPF0000EDD3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB8558 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 the ACPI_Spec for details on continuous performance control of CPPC. Signed-off-by: Meng Li Reviewed-by: Mario Limonciello Reviewed-by: Wyes Karny Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#cpc-continuous-performance-control Acked-by: Huang Rui --- 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 Tue Sep 5 01:51:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374624 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C873CA1002 for ; Tue, 5 Sep 2023 16:07:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239138AbjIEQHY (ORCPT ); Tue, 5 Sep 2023 12:07:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245114AbjIEBwJ (ORCPT ); Mon, 4 Sep 2023 21:52:09 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2074.outbound.protection.outlook.com [40.107.93.74]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8C7BCC5; Mon, 4 Sep 2023 18:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iQ8i0uYqRpXnnSXLfwpbtGFKAaz2RnQ0QBQqk2BBPzdxkx71igLIJ3mtyfvildwCoTtLzF1qNwXyx8LHDubB0Hk9kC2eE0lU5dQSLG52q7VbZLZM258BDoLpPULiZokHQuw9IEwZ7LzoKgF8dEzQ/QQ/yT7xJREySGgQmHx3t3v41KqTd5yqWwPlX7fEb3SELddiFnbD0kdavZb3g1S6jaxn9zS1CCIbdpL1TmjYrR0Ubx0+Tg1CgcrN/3z6tRfFl/x1Q7me7hEGdvLA+JDMDzRqgML/53rZQYwgcH83c75+uZQLfKFTC3QqmPA4ZJVwWZ2PGxqzHagBIcBoDznjmA== 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=OZojjejNblWxrqDVndVRwNnvgOFQu0K0POyqKUNezu8=; b=cj8ENw2Tvww3vv873N4h8PnCM7PUv3B0mOwRPUH0ovyPsNNgobGzmZ6DUlWcR8UCMLN+jEOASWTlG6zTCw7H29BsEJyli/Ur+4SSATt1+A6M17D80UajOlu+5sRgS0F3uLcJiLdDttkJEiGe2Li7MiRhQT/y3TBzJ3agzSdKRPjLw/ovCRsLW7diO5OyhWtjl+2kMUdepqHZPaZ6ddjd7wB9CpbixtFz+fUUSh6Pyloq/+xggjJ4v7Rynoblk0xgM9VTHcqzar/iAqbiHetUsRDPC1l2y7N2JQZRjftscWN9fJOy+29i9ON6WQbOZY12FBZf+X/nVLugr0ebG22epw== 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 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=OZojjejNblWxrqDVndVRwNnvgOFQu0K0POyqKUNezu8=; b=JoVl0IcLWejJjoJayDo4tIVoUYxZQT+UYfXo0YKMM2m4jcEGfsDSSaRQDoG4P7VpwHZ16AHa1V3d/13HM/FwLrvHYt8kjvI9vIWFCATCLpOUWGnKmmk0o6JqvfSA4G7q52Fy82QM4IUkh5xMiASaTrNVN6VNzyqLTiOkvTt5410= Received: from CY8PR02CA0003.namprd02.prod.outlook.com (2603:10b6:930:4d::10) by SA1PR12MB6920.namprd12.prod.outlook.com (2603:10b6:806:258::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Tue, 5 Sep 2023 01:52:02 +0000 Received: from CY4PEPF0000EDD7.namprd03.prod.outlook.com (2603:10b6:930:4d:cafe::eb) by CY8PR02CA0003.outlook.office365.com (2603:10b6:930:4d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:52:02 +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 CY4PEPF0000EDD7.mail.protection.outlook.com (10.167.241.211) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:52:02 +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.27; Mon, 4 Sep 2023 20:51:57 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li Subject: [PATCH V5 3/7] cpufreq: amd-pstate: Enable amd-pstate preferred core supporting. Date: Tue, 5 Sep 2023 09:51:12 +0800 Message-ID: <20230905015116.2268926-4-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD7:EE_|SA1PR12MB6920:EE_ X-MS-Office365-Filtering-Correlation-Id: 6858568d-bd99-4f85-1966-08dbadb2b332 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1FV8OmDTOy0OxgSC/M4fSv7rT7J3gBeGwfmp31Yah4CwfHXZ0ZmrKdNLvGEkDmjanZNkp81JIOoW1uRixF1rnEYvnp7aZjZA203CM38w8PUMrg3yDJNObF2h74ClyHDUFs8xifKWBHgHAivKZJs/j5d9CK8SMv2+Z00+VJprFa1kmW2PReccF6rR9EoA/ueEVyQJhj7c2XqQMTZR9PsVEpuptWxNIgwkKFuWtuUVn1b1bUboX85M+nuTbDnEC04JLcEM4f/4LOEc6Zahlg2BqE5H2/gUCXZBogTDKQTBIcixWrl/Hyn/5q8Oz8pfCwR+a266yI5n2d1UfZFRmvy+FjrB/0Z3lTe2TI5F4xlfHEZEEj/V2o2a2Ai8gnAAH2lgcuwIi5zyNIaTNdUP0hdS0F4zEGWO3QRZJnMU5P6ZrYk8KWBRXHOyOIr9/oR7YXS4mJM2CYU4Hjrxi7YZOigPCXgQAFleuK22Yamrd/ZE+z3TQBhw8PWPXUHnd10CRLS1mRyopzKLl/AKBxmDsMOkkyOBk+AFWI+1pHo4kKlpl6qTTyRUg6iBtPdi8OeMmCZ8DbVQolVjMlOjt6Q74/0iStveoBlVfnv70vDLnZkopr93hhfV9Tea1faJCgdnWBxCMxR1gpUXDtkuHy5il16D4tZ2jF3Fud4HNo08gQoBrAPyw76uHszR/k6bN1dodKXg3f3I1ssOpHZKy2UVpx0cO3yunWOYz0ysr+/NxFnCC8IUIh9n0n3iqnXqDMKePwW8NkjFzEOJaF9V3+paPQOfFQ== 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)(39860400002)(136003)(346002)(376002)(1800799009)(82310400011)(186009)(451199024)(36840700001)(46966006)(40470700004)(36860700001)(40460700003)(47076005)(2906002)(36756003)(86362001)(81166007)(356005)(82740400003)(40480700001)(1076003)(4326008)(6666004)(8936002)(8676002)(2616005)(26005)(5660300002)(16526019)(110136005)(7696005)(70206006)(41300700001)(316002)(70586007)(54906003)(6636002)(426003)(336012)(83380400001)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:52:02.4152 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6858568d-bd99-4f85-1966-08dbadb2b332 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: CY4PEPF0000EDD7.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6920 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 device attribute for hardware preferred core. It will check if the processor and power firmware support preferred core feature. Add device attribute for preferred core. Only when hardware supports preferred core and user set `enabled` in early parameter, it can be set to enabled. Add one new early parameter `disable` to allow user to disable the preferred core. Signed-off-by: Perry Yuan Co-developed-by: Perry Yuan Signed-off-by: Meng Li Co-developed-by: Meng Li Reviewed-by: Mario Limonciello Reviewed-by: Mario Limonciello Signed-off-by: Perry Yuan Signed-off-by: Meng Li --- drivers/cpufreq/amd-pstate.c | 131 ++++++++++++++++++++++++++++++----- 1 file changed, 115 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9a1e194d5cf8..454eb6e789e7 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,8 @@ #define AMD_PSTATE_TRANSITION_LATENCY 20000 #define AMD_PSTATE_TRANSITION_DELAY 1000 +#define AMD_PSTATE_PREFCORE_THRESHOLD 166 +#define AMD_PSTATE_MAX_CPPC_PERF 255 /* * TODO: We need more time to fine tune processors with shared memory solution @@ -65,6 +68,12 @@ static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; +/*HW preferred Core featue is supported*/ +static bool hw_prefcore = true; + +/*Preferred Core featue is supported*/ +static bool prefcore = true; + /* * AMD Energy Preference Performance (EPP) * The EPP is used in the CCLK DPM controller to drive @@ -290,23 +299,21 @@ static inline int amd_pstate_enable(bool enable) static int pstate_init_perf(struct amd_cpudata *cpudata) { u64 cap1; - u32 highest_perf; int ret = rdmsrl_safe_on_cpu(cpudata->cpu, MSR_AMD_CPPC_CAP1, &cap1); 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)) - highest_perf = AMD_CPPC_HIGHEST_PERF(cap1); - - WRITE_ONCE(cpudata->highest_perf, highest_perf); + if (prefcore) + WRITE_ONCE(cpudata->highest_perf, AMD_PSTATE_PREFCORE_THRESHOLD); + else + WRITE_ONCE(cpudata->highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); WRITE_ONCE(cpudata->nominal_perf, AMD_CPPC_NOMINAL_PERF(cap1)); WRITE_ONCE(cpudata->lowest_nonlinear_perf, AMD_CPPC_LOWNONLIN_PERF(cap1)); @@ -318,17 +325,15 @@ static int pstate_init_perf(struct amd_cpudata *cpudata) static int cppc_init_perf(struct amd_cpudata *cpudata) { struct cppc_perf_caps cppc_perf; - u32 highest_perf; int ret = cppc_get_perf_caps(cpudata->cpu, &cppc_perf); if (ret) return ret; - highest_perf = amd_get_highest_perf(); - if (highest_perf > cppc_perf.highest_perf) - highest_perf = cppc_perf.highest_perf; - - WRITE_ONCE(cpudata->highest_perf, highest_perf); + if (prefcore) + WRITE_ONCE(cpudata->highest_perf, AMD_PSTATE_PREFCORE_THRESHOLD); + else + WRITE_ONCE(cpudata->highest_perf, cppc_perf.highest_perf); WRITE_ONCE(cpudata->nominal_perf, cppc_perf.nominal_perf); WRITE_ONCE(cpudata->lowest_nonlinear_perf, @@ -676,6 +681,73 @@ 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, u64 *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 { + ret = cppc_get_highest_perf(cpu, highest_perf); + } + + return (ret); +} + +static void amd_pstate_init_prefcore(void) +{ + int cpu, ret; + u64 highest_perf; + + if (!prefcore) + return; + + for_each_online_cpu(cpu) { + ret = amd_pstate_get_highest_perf(cpu, &highest_perf); + if (ret) + break; + + sched_set_itmt_core_prio(highest_perf, cpu); + + /* check if CPPC preferred core feature is enabled*/ + if (highest_perf == AMD_PSTATE_MAX_CPPC_PERF) { + hw_prefcore = false; + prefcore = false; + return; + } + } + + /* + * This code can be run during CPU online under the + * CPU hotplug locks, so sched_set_amd_prefcore_support() + * cannot be called from here. Queue up a work item + * to invoke it. + */ + 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; @@ -1037,6 +1109,18 @@ static ssize_t status_store(struct device *a, struct device_attribute *b, return ret < 0 ? ret : count; } +static ssize_t hw_prefcore_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sysfs_emit(buf, "%s\n", hw_prefcore ? "supported" : "unsupported"); +} + +static ssize_t prefcore_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + return sysfs_emit(buf, "%s\n", prefcore ? "enabled" : "disabled"); +} + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); @@ -1044,6 +1128,8 @@ cpufreq_freq_attr_ro(amd_pstate_highest_perf); cpufreq_freq_attr_rw(energy_performance_preference); cpufreq_freq_attr_ro(energy_performance_available_preferences); static DEVICE_ATTR_RW(status); +static DEVICE_ATTR_RO(hw_prefcore); +static DEVICE_ATTR_RO(prefcore); static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, @@ -1063,6 +1149,7 @@ static struct freq_attr *amd_pstate_epp_attr[] = { static struct attribute *pstate_global_attributes[] = { &dev_attr_status.attr, + &dev_attr_prefcore.attr, NULL }; @@ -1506,6 +1593,8 @@ static int __init amd_pstate_init(void) } } + amd_pstate_init_prefcore(); + return ret; global_attr_free: @@ -1527,7 +1616,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")) + 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"); From patchwork Tue Sep 5 01:51:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31200CA1001 for ; Tue, 5 Sep 2023 16:07:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238955AbjIEQHO (ORCPT ); Tue, 5 Sep 2023 12:07:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245137AbjIEBwN (ORCPT ); Mon, 4 Sep 2023 21:52:13 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2058.outbound.protection.outlook.com [40.107.223.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA552CC5; Mon, 4 Sep 2023 18:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MAFwX0oGDYa3jaEko7nhw3KV9TfZYM1abZd66OYO0wQeEHq9WBCYVsmbqcx8zJqR/O6blT2sl6RfSpia1aCHJ4GBaG0qry0Xmt+5IoSiq12kfrIAw2AOfptj52vP7eZMdv/BzQlU9fWyOYKacHPDtlowY30sQTkw27ePrDymtJsQJjIAJ162MuPWnwxWDPASL91foCwm7ghlWTaGFYfB+x9JVeCbKujq4UQlNXaat1Hn8ht4npDwtctwRY6CgceaYnvqKY3p4pbw6D1CiDvaRh9IWZlFH1KpZK5VJaXOx2a1AICaHccxGjfrXtITDqSeNWriPXBwSpfTQqpXxzxuoQ== 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=+rYYjru5MFpQdUVUJLzWNg5oNLj/dmhUp4r6eeXJ58Q=; b=Aml8ij9saqWuxC1ZW/P3eKzoe7rnrmA1W3145c1VNHquMGEUOblgaciB361TcS4y4426lw//yf5A5pFy7ogMdvFo0THEKWsBrlzOMI5s1T1CbMLZqHI37ezKlrjPtaMHSEyivRtVoE80QPtmm6YCP45XzFix7JWJ7IaWA/j14xJ1HJXOv88m8y9e5K7qpmaqz5V3SMKIiDEP5UPUmOkXTnzWBafRXkF6T/vzAe/oz+A8emBoYrA7oZdWFRpHxbDNuvnXApyMAyEKi+IDkoUN+B26Gof2/0hkHIHrL5UXiJ7PaJZx5MZBowO/XW06Eq+xbZfuD3bsASEK5ToBVIhmWg== 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 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=+rYYjru5MFpQdUVUJLzWNg5oNLj/dmhUp4r6eeXJ58Q=; b=tm1weuOfdxnfdfLtdw0hIcB9rY7r8jDdRhjkhu4Y0qRI7Lxd4wP3YQ6TwpcpoobmC5NtWJ2XcjTXuj2MRsQmp/aKj+wQU+REeGYPvkBaC+pZqpxZ9Nfa00/5xJ+feug7XZ6mK8Oghs9Pt4Ptso9zvjgltuwOdZ6mS548N/TDM4I= Received: from CY5PR18CA0059.namprd18.prod.outlook.com (2603:10b6:930:13::22) by BN9PR12MB5292.namprd12.prod.outlook.com (2603:10b6:408:105::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Tue, 5 Sep 2023 01:52:07 +0000 Received: from CY4PEPF0000EDD1.namprd03.prod.outlook.com (2603:10b6:930:13:cafe::cd) by CY5PR18CA0059.outlook.office365.com (2603:10b6:930:13::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:52: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 CY4PEPF0000EDD1.mail.protection.outlook.com (10.167.241.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:52: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.27; Mon, 4 Sep 2023 20:52:01 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li Subject: [PATCH V5 4/7] cpufreq: Add a notification message that the highest perf has changed Date: Tue, 5 Sep 2023 09:51:13 +0800 Message-ID: <20230905015116.2268926-5-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD1:EE_|BN9PR12MB5292:EE_ X-MS-Office365-Filtering-Correlation-Id: 60923eb7-b5ce-4e4c-d7bb-08dbadb2b5b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X+gKFbH4gmmeGJUbB35E/2195MHfBk1XBEZE/4+MuIKhrjFdyhO5h7SPjzkFGbJRB8TF4tQ6YLsGFx8DCpUU8A8XByrCraulDeRMG3+c2ibct/Gys9gFNCqNqA+gloakR34vofTUxaflsIV+qF6Fu2bOna9hpIkzd3yX0mXNYh21aDAqec9b+r4uQ40WBQVKgVrFlCV9lZwY+mA2F1utUufnMTisrCuUvHArBVpeGhoPQya4KaECSket84ikxzVvK+C8vQLXEBtNJRWrfT4JN6bBfKR9rEsMVf6XZRBywaavPVoRysnI1Xc6EqhWsaLg7W6td43EctBpfXhoGUzlWG9wxDmlzYTEbtoFJcdEVFPf6EE9SHc+TqSO9erHUnB0V0xEUhm3EUgC+iQIv9Jnv2YjFzLrjI3aHHyeXAaAos3dT5/lf4y7UPYH07ZWlZ3/xwkHfxfsEpGNW4yNihxRK0r+pVSxPqkNSA6UvmAmIWallMvif7EPDXo9xNCVhdNxfAKr1nwpiQpNvlax/pHaokAPwC2/VvWdA6K73FglKZd6PO6uVSn9yxyXxUf5X+OfxkstW3q7uRDEFYK+EhT2NBnqn02ru9of11//kdm055nCwPDvdq9pN3fKcXFkg9LOWezO0xRbSZQaqvM4ToWorAwYrSjZYA9iJqq7uL6dArsBkR0YKSld4I3xOUs+KSvDUlcijwWPVrKymeLyQFp3k7odhk/KmWmESC7/IHq33yTwM//3EWF54V47I8Tvi3L4idvO4TluHKO1PVMypTLi66Ad8dAOfPSAudP44/6PFIQ= 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)(346002)(376002)(136003)(396003)(186009)(82310400011)(1800799009)(451199024)(40470700004)(36840700001)(46966006)(47076005)(36860700001)(40460700003)(15650500001)(2906002)(36756003)(86362001)(81166007)(356005)(82740400003)(40480700001)(41300700001)(7696005)(316002)(6636002)(54906003)(110136005)(70586007)(70206006)(4326008)(8676002)(2616005)(1076003)(8936002)(478600001)(966005)(6666004)(336012)(426003)(16526019)(5660300002)(26005)(83380400001)(226483002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:52:06.6118 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60923eb7-b5ce-4e4c-d7bb-08dbadb2b5b4 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: CY4PEPF0000EDD1.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5292 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org ACPI 6.5 section 8.4.6.1.1.1 specifies that Notify event 0x85 can be emmitted to cause the the OSPM to re-evaluate the highest performance register. Add support for this event. Signed-off-by: Meng Li Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#cpc-continuous-performance-control --- drivers/acpi/processor_driver.c | 6 ++++++ drivers/cpufreq/cpufreq.c | 13 +++++++++++++ include/linux/cpufreq.h | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 4bd16b3f0781..29b2fb68a35d 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_highest_perf(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; diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 60ed89000e82..4ada787ff105 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2718,6 +2718,19 @@ void cpufreq_update_limits(unsigned int cpu) } EXPORT_SYMBOL_GPL(cpufreq_update_limits); +/** + * cpufreq_update_highest_perf - Update highest performance for a given CPU. + * @cpu: CPU to update the highest performance for. + * + * Invoke the driver's ->update_highest_perf callback if present + */ +void cpufreq_update_highest_perf(unsigned int cpu) +{ + if (cpufreq_driver->update_highest_perf) + cpufreq_driver->update_highest_perf(cpu); +} +EXPORT_SYMBOL_GPL(cpufreq_update_highest_perf); + /********************************************************************* * BOOST * *********************************************************************/ diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 71d186d6933a..1cc1241fb698 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -235,6 +235,7 @@ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); void refresh_frequency_limits(struct cpufreq_policy *policy); void cpufreq_update_policy(unsigned int cpu); void cpufreq_update_limits(unsigned int cpu); +void cpufreq_update_highest_perf(unsigned int cpu); bool have_governor_per_policy(void); bool cpufreq_supports_freq_invariance(void); struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy); @@ -263,6 +264,7 @@ static inline bool cpufreq_supports_freq_invariance(void) return false; } static inline void disable_cpufreq(void) { } +static inline void cpufreq_update_highest_perf(unsigned int cpu) { } #endif #ifdef CONFIG_CPU_FREQ_STAT @@ -380,6 +382,9 @@ struct cpufreq_driver { /* Called to update policy limits on firmware notifications. */ void (*update_limits)(unsigned int cpu); + /* Called to update highest performance on firmware notifications. */ + void (*update_highest_perf)(unsigned int cpu); + /* optional */ int (*bios_limit)(int cpu, unsigned int *limit); From patchwork Tue Sep 5 01:51:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 041E7CA0FFA for ; Tue, 5 Sep 2023 16:07:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239207AbjIEQH2 (ORCPT ); Tue, 5 Sep 2023 12:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245141AbjIEBwT (ORCPT ); Mon, 4 Sep 2023 21:52:19 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2050.outbound.protection.outlook.com [40.107.220.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99B0DCC5; Mon, 4 Sep 2023 18:52:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NzQ9pqWC/Ha+2crKL6xWxsgS8UnEJUUgQVmquSGdpiosUXUpSe9mglHT7S5hsLJlllLuJsynZS+ZUfHanRLFqCvD/rbzT3gXqiFKkgRvwVxsvJLanLidE7cbc1Y/+GzjV8iV/c9oFZ+cXhRjktJvo0+MwcYi1C9xFpjfqfVwj/dIA5qWneFQskBJtAkwqrxpHfEcSyE9W1NuCsDwaMPVMquoQRa8/dlerbNz3duxFIycfyfoyN+R1trEgzGwB+3e0ctjddmhEXyu+z9zkGrKbTgAQURQJVG0c4NRI0fHP2oyqTQ62VNzb+fjCnDKNqlz4IM0mHQlxmEI9HMLgGfRig== 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=6THLQIllZhI0VKQqhm+jmtQdk2+/pQOXoMZ2tUvz/Po=; b=k60m8Bu/p8UjQRQ2uA6X0vvJg911+qv/fFcqyfgSkBL7dQFJKTrZP3yEzBJpO7+eFrTa68z2AKQE/jdZra0iZp70AIBxBp5kg5i6XtqGJ9lHfhAKGPnO2IfYhnRsrzkETubCpNz5mWPi7yQzdeIB4TUs4Kd8XMmy6kqUScNfUkMIslBOhK1RedzntZ7OBBq+mQKtn2949WwPsOWHNT7xJQNHjIZD5J77mfcXNR/bTmWtONkQ2Ismn4+UQ3Fp+SdjFuPzF+2LNih9PH9xrU23cFNmYmF1/LQwMQGSTMQdqcQSmuSL4ml7oSSrZSls9d9cxUT7fBpqwaK58aEft6kzDw== 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 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=6THLQIllZhI0VKQqhm+jmtQdk2+/pQOXoMZ2tUvz/Po=; b=oz2gzQF1B0vzXFd9QKT2OpldT1J9bYlShuLHQHWS8AOvtY4RnWK2z8EkDnptBpX9UD/nxSQFg4KIWoanaXbQ1QaEswqJ2sQQMJG+RcTUVq5Fk2GnVyLuLsguoWQGyGiNZp88q+KZq+nngJCUQBDgxbYz4rAVE/oBr7ZHigOc5hk= Received: from CY5PR17CA0002.namprd17.prod.outlook.com (2603:10b6:930:17::22) by MN2PR12MB4422.namprd12.prod.outlook.com (2603:10b6:208:265::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.32; Tue, 5 Sep 2023 01:52:12 +0000 Received: from CY4PEPF0000EDD5.namprd03.prod.outlook.com (2603:10b6:930:17:cafe::7) by CY5PR17CA0002.outlook.office365.com (2603:10b6:930:17::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:52: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 CY4PEPF0000EDD5.mail.protection.outlook.com (10.167.241.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:52: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.27; Mon, 4 Sep 2023 20:52:06 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li , Wyes Karny Subject: [PATCH V5 5/7] cpufreq: amd-pstate: Update amd-pstate preferred core ranking dynamically Date: Tue, 5 Sep 2023 09:51:14 +0800 Message-ID: <20230905015116.2268926-6-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD5:EE_|MN2PR12MB4422:EE_ X-MS-Office365-Filtering-Correlation-Id: 7d026350-e1d3-466d-9cea-08dbadb2b88d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2aZ6EoHnegQSFQJxZWXMfFHaG2nOdLVwlp2NsBB+oVytVhEJPtpfVZCvP+nv3zv9DTo+aizTDElHqrEdEw68n826bxx8EnfHkmNYBOtVb8E073RiB+Wd+avSQl9kEyTY20/7CKm5Z6SZPe7xv3n3sJzStJq0dddinSipdKF2Ptv1hp3sRoLv3AgnHjXW9i62xjyOsUClvMOvGbygbxLbqqYPmTG86qpAEcVvIWqgAU7WWEG9EoTKZsC6Zzaxf6xFCO06F8AeofUIHlZfliVeiSTJJ7X5xlhdBnar2nfB5kXt1scCO6JMCyUfyyfhJiMlhL90UhsdLBnb2abLdGCNIcLexvdHXFWuu7zs9SiVofOD5DE67vo7SDdF86zY3ZZ/C/9xVkx4p7wJzylKLQc1B4+/b5wI4kF49ZhjPZhWQJA+O05Suzn5ItZrJ9jE0335I+5MryZNNBOqWvlIReJpvnIkmkVIjOnkt1B0eTIs9JnxHQkO9AZUwIiuD4FZ0fa5/0nh6jXKVIQ490tWDfLpjHBscyxG89sUKIOlfHKvjNzI21HHrpVO7+R+8rfCJzGvBADMVc0A0MZ8REH/Lh68wcQ3/CP3zbMw6zTV/Kzn8ac8ea7wMyi+WITsAHkQQOUTFwzuXFeq6iBQwCEW7tbMcDFKK2pWbgtdtEcSWYmddITH2Bccre2r2Bpjp7+eFJFEDQEY2FDW6CQWmvsPRVcseGiwNWT7BoeU9EUB+zyBATNH+HqPRyET+SqsP9MeCH3BWihZeF0F/bfgxD9ZPBlieQ== 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)(396003)(39860400002)(136003)(346002)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(40460700003)(41300700001)(66899024)(7696005)(6666004)(356005)(82740400003)(81166007)(478600001)(83380400001)(2616005)(26005)(336012)(16526019)(1076003)(36860700001)(47076005)(426003)(15650500001)(40480700001)(70206006)(36756003)(2906002)(110136005)(316002)(54906003)(6636002)(70586007)(86362001)(5660300002)(8936002)(8676002)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:52:11.4192 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7d026350-e1d3-466d-9cea-08dbadb2b88d 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: CY4PEPF0000EDD5.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4422 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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. Signed-off-by: Meng Li Reviewed-by: Wyes Karny --- drivers/cpufreq/amd-pstate.c | 36 ++++++++++++++++++++++++++++++++++-- include/linux/amd-pstate.h | 11 +++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 454eb6e789e7..8c19e1d50d29 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -318,6 +318,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->cppc_highest_perf, AMD_CPPC_HIGHEST_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->cppc_highest_perf, cppc_perf.highest_perf); if (cppc_state == AMD_PSTATE_ACTIVE) return 0; @@ -545,7 +547,7 @@ static void amd_pstate_adjust_perf(unsigned int cpu, if (target_perf < capacity) des_perf = DIV_ROUND_UP(cap_perf * target_perf, capacity); - min_perf = READ_ONCE(cpudata->highest_perf); + min_perf = READ_ONCE(cpudata->lowest_perf); if (_min_perf < capacity) min_perf = DIV_ROUND_UP(cap_perf * _min_perf, capacity); @@ -748,6 +750,34 @@ static void amd_pstate_init_prefcore(void) schedule_work(&sched_prefcore_work); } +static void amd_pstate_update_highest_perf(unsigned int cpu) +{ + struct cpufreq_policy *policy; + struct amd_cpudata *cpudata; + u32 prev_high = 0, cur_high = 0; + u64 highest_perf; + int ret; + + if (!prefcore) + return; + + ret = amd_pstate_get_highest_perf(cpu, &highest_perf); + if (ret) + return; + + policy = cpufreq_cpu_get(cpu); + cpudata = policy->driver_data; + cur_high = highest_perf; + prev_high = READ_ONCE(cpudata->cppc_highest_perf); + + if (prev_high != cur_high) { + WRITE_ONCE(cpudata->cppc_highest_perf, cur_high); + sched_set_itmt_core_prio(cur_high, cpu); + } + + cpufreq_cpu_put(policy); +} + static int amd_pstate_cpu_init(struct cpufreq_policy *policy) { int min_freq, max_freq, nominal_freq, lowest_nonlinear_freq, ret; @@ -912,7 +942,7 @@ static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, u32 perf; struct amd_cpudata *cpudata = policy->driver_data; - perf = READ_ONCE(cpudata->highest_perf); + perf = READ_ONCE(cpudata->cppc_highest_perf); return sysfs_emit(buf, "%u\n", perf); } @@ -1479,6 +1509,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_highest_perf = amd_pstate_update_highest_perf, .name = "amd-pstate", .attr = amd_pstate_attr, }; @@ -1493,6 +1524,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_highest_perf = amd_pstate_update_highest_perf, .name = "amd-pstate-epp", .attr = amd_pstate_epp_attr, }; diff --git a/include/linux/amd-pstate.h b/include/linux/amd-pstate.h index 446394f84606..2159fd5693fe 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -31,6 +31,11 @@ struct amd_aperf_mperf { u64 mperf; u64 tsc; }; + /* 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. + */ /** * struct amd_cpudata - private CPU data for AMD P-State @@ -39,11 +44,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 + * @cppc_highest_perf: the maximum performance an individual processor may reach, + * assuming ideal conditions * @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 @@ -70,6 +80,7 @@ struct amd_cpudata { u32 nominal_perf; u32 lowest_nonlinear_perf; u32 lowest_perf; + u32 cppc_highest_perf; u32 max_freq; u32 min_freq; From patchwork Tue Sep 5 01:51:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374748 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAAC3CA1004 for ; Tue, 5 Sep 2023 16:17:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239265AbjIEQHn (ORCPT ); Tue, 5 Sep 2023 12:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245143AbjIEBwW (ORCPT ); Mon, 4 Sep 2023 21:52:22 -0400 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2088.outbound.protection.outlook.com [40.107.95.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B26FCC5; Mon, 4 Sep 2023 18:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hJKo02BrP69mJRtID9DDw7BD6vPeZNDyWSy7v+C9WaACkZO3O60VbF3nhNyb83cqinQEmYmMbwgBBUTPCqYeuY6ARRZHNayrUAvXRkze3nqOXcaGELL0CHMrLyLc472uOIw5f3Iw81XPrp+UghQm6MNauYaV5dcAlYZPLG8YEwiNziTskAPJd8Yko2mwamUVcD1p4pCF9VjlTXpsX4Sn1GWUav4w4vTWeE2qcxf9XGsSSL9igVqHe4e4hb3/0Xh7TuHVGBtBEPdy26DovBVEC2Sht/QcaT/oZE5o4fuh/IciawXDr9t4GrKD8CoOoBN4kNx0K1wmBVrlPvuB/YjoWg== 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=QafCinqhB4JcZBw/TmFTAco1fQuxkYe9Bs1oA3tu0UQ=; b=m0kZixesAmV5bmH/vBa4b5L9FdGiNHFrejZSYoiXMc6SwfSgdNwb/6lIMFcvjzfXNJPj0sZ3kTCkDKFWZrROor7LVT7QKWtWp8nay9BurWuOoNhO8Gto0RQ1NcSX1UiX7HAWvXQlTPxZ5ziXI02vyXYKetxooa5h4yDJ8fqZg5nR6rsl0GZZdBHScvYsOSVB5dD3ONtmLqInp03ke3B5CG1qRe8v8WGLblgkR0czP7sOzdpyul1sbBAO6k4/IwNm1AUjG3+7xHk5ojaab2Wsl3ntwpoLd/WNzjJE0bN4PozC3Vjgjja/Uyxb9AnzQIoLHKf68xgKb2JOac6nxbHcbQ== 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 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=QafCinqhB4JcZBw/TmFTAco1fQuxkYe9Bs1oA3tu0UQ=; b=BNYc6Znqa/1lFkeiJidyQ7H1NhhDcXeOFRxnEdnBuF17yUOHXlBwlNwtKeId82Oi0VU8whSoOMl7itWi4fC/rOb0otgK0mm92jdkJa9yDtEUWlYf55WUyeNbR8v8/nWZk5lAt8E8CpXbyaOr3bVlU59eNU25+gCDv/1doiojS8k= Received: from CY5PR15CA0203.namprd15.prod.outlook.com (2603:10b6:930:82::25) by PH7PR12MB6737.namprd12.prod.outlook.com (2603:10b6:510:1a8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.32; Tue, 5 Sep 2023 01:52:16 +0000 Received: from CY4PEPF0000EDD0.namprd03.prod.outlook.com (2603:10b6:930:82:cafe::9f) by CY5PR15CA0203.outlook.office365.com (2603:10b6:930:82::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:52:15 +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 CY4PEPF0000EDD0.mail.protection.outlook.com (10.167.241.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:52:15 +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.27; Mon, 4 Sep 2023 20:52:11 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li Subject: [PATCH V5 6/7] Documentation: amd-pstate: introduce amd-pstate preferred core Date: Tue, 5 Sep 2023 09:51:15 +0800 Message-ID: <20230905015116.2268926-7-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD0:EE_|PH7PR12MB6737:EE_ X-MS-Office365-Filtering-Correlation-Id: 82820a86-8221-4716-50e1-08dbadb2bb2e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DbEYQLH2qyRXrJfbVmBE7z8/Plj2c/0gYUlLojx7aBZCvaz813ttoH+7seB8SWt0UGBHzW2BDntxW2XsY/YSFr/5dsOoah8Urujby447xAay2PmZkhXFyE6Ld/4tRRLgmZjZzm2vqmjEZrtd9dgfLIpiGHIt+hJSSceULDy5F0peoGgCXjly1O2hJgpei2N5xEOsHeIdgcnDG7RquHDKHf+sI+ixriMc8TMeN9pQ/bms/VjYTwmd7d0VWzEegFZ61HCKRywgHTfP3Soo6plnkr3sixKldeNYMXNBbockhEFZhPxBmiTsAbqMNB349DH58fR72kVGB2L8sqZtl+h/mO5IqGzpKgzYcAHIgHoNcIFXzEg6swVXvpgtIyjULQowpRGPhAUJVVYgMUDSi1CdPaAc58f42fj8Ji2kqi2XCVvAI5AX8Pp/vJo3cMhTZdvTGFXC2UrcmZPUkQSO9hufVKLbjZ58MGDSkDyyaNd2o3bUEquDIu+TKSn3nxzRFFdAmPZ4CG88SidY3VvvSR5wUFUYU4dGAR1K1GbkLmuKsZHsR5QTv9Z0TxyKJCp9/mqT1WgCpTJxE09fGIcEk/eQ69+7hyEdriQzOv9guFkKbQvkKY3nN9st5UDhl6/m1hudHBI78L3EsBjxmnVdR84Few3uPYl2LYqWT/1pj0KBHjBtcuFBY1Tk3ARUgpr16Vw7aR8shh67ikA6eiVoRNmHoS+mMFgIvDmkjO58W3X+8XQDQ8ha5iIPWK2RSGae/rV0d+jaJ1JDEVkC/KlsllipSw== 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)(39860400002)(346002)(396003)(376002)(1800799009)(186009)(82310400011)(451199024)(40470700004)(46966006)(36840700001)(478600001)(110136005)(26005)(2616005)(70206006)(70586007)(16526019)(1076003)(426003)(54906003)(336012)(7696005)(316002)(2906002)(8676002)(4326008)(6636002)(8936002)(5660300002)(86362001)(356005)(36756003)(81166007)(82740400003)(47076005)(41300700001)(40460700003)(83380400001)(36860700001)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:52:15.8122 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82820a86-8221-4716-50e1-08dbadb2bb2e 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: CY4PEPF0000EDD0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6737 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org Introduce amd-pstate preferred core. check hardware preferred core state: $ cat /sys/devices/system/cpu/amd-pstate/hw_prefcore check preferred core state: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Signed-off-by: Meng Li --- Documentation/admin-guide/pm/amd-pstate.rst | 68 ++++++++++++++++++++- 1 file changed, 67 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1cf40f69278c..204f5d49d47d 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -300,7 +300,7 @@ 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, @@ -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,30 @@ 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. +``hw_prefcore`` + Preferred core state of hardware: "supported" or "unsupported". + + "supported" + The processor and power firmware support preferred core. + + "unsupported" + The processor and power firmware don't support preferred core. + + + This attribute is read-only to check the state of hardware preferred core. + +``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. + ``cpupower`` tool support for ``amd-pstate`` =============================================== From patchwork Tue Sep 5 01:51:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Meng, Li (Jassmine)" X-Patchwork-Id: 13374620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 615E7CA100A for ; Tue, 5 Sep 2023 16:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239018AbjIEQHR (ORCPT ); Tue, 5 Sep 2023 12:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245149AbjIEBw1 (ORCPT ); Mon, 4 Sep 2023 21:52:27 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CC48CC5; Mon, 4 Sep 2023 18:52:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LOJqaabI1TNuI3jIbpNxVXwWT/iVdJtPzkkL8A2F+hMIu0E08sPF68s7srdpyQAgIscURrs7aHE23olnYTVBJ8GJcx/jfMhEcr00zUZx+upmTooetaEBCJFHjNGJ+6jLAm2SlmiBmXn7WgMgLEBgRPEeqZUAhLjrn7WayDVJfI2+z06qpaiSizIAxo6empN2prm1SKDLL5OCt6JuJJ6jZTHcLLVYwc+wtifxICsEP2wtaDpdxkkLtI5N7vV1myKhD+Hwgw/PUl7JMSIACh55EofrQ9NgUeDs8ysCF0JhFlTkC4zT2H/kaKXmojxlnmcPtyfC/It9KOjs6A9pDlGerw== 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=k806WqW+2azCUUAWHat1FO47DTtuctO5wUBOpKQwBFE=; b=iWOY66CMqZ2wHQnDcN6GuvCBKiTyJ1LKt1rYS5W5QYxtEPegqjlDv8m3cgKGCgHSSHK5Mv3vdFPkfqZKTgWxeda2ppn1UdCDBbw1N47lG+/t6Nwi8BAjQUk0ctifcuW42BFd4KZodBMfKmadW5HWhnfHYCoxYsS8zRVHrMBIXY1JWYVfMYCkQkTeFhysNIsbVGqieQfOy0CgpmHFxxJYhpXngRt8X6x8tmp+ghd/pO9/W/O3dNTRjpLxcPN0uc6l77LoSRtgdcNlPFSt+Yg7h2Y/UJEicp9GvhkD6OTtVeS8GBy6zOO6j5AcNc/4q1JlKei6OGdVo7fhPMH/teCIjg== 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 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=k806WqW+2azCUUAWHat1FO47DTtuctO5wUBOpKQwBFE=; b=PsDIogYJYtZ3pVT53lkmBqLZ2wQ6Kt2IXn5s2eBewNcmweCC6WSTRIWkrb+T33hfbDKXC0JSE0499Ooxlf6fP3suigl4J26iPj/ibyLCBdS564QnlqFs4AfEktyJY3CogPjjrxOHp96VB88euPJQN5LCZL6TMZJeA+9zX4Evl7A= Received: from DS7PR03CA0182.namprd03.prod.outlook.com (2603:10b6:5:3b6::7) by MN0PR12MB6149.namprd12.prod.outlook.com (2603:10b6:208:3c7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.30; Tue, 5 Sep 2023 01:52:20 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:5:3b6:cafe::e1) by DS7PR03CA0182.outlook.office365.com (2603:10b6:5:3b6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 01:52:20 +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 CY4PEPF0000EDD3.mail.protection.outlook.com (10.167.241.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6768.25 via Frontend Transport; Tue, 5 Sep 2023 01:52:20 +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.27; Mon, 4 Sep 2023 20:52:15 -0500 From: Meng Li To: "Rafael J . Wysocki" , Huang Rui CC: , , , , Shuah Khan , , "Nathan Fontenot" , Deepak Sharma , Alex Deucher , Mario Limonciello , Shimmer Huang , "Perry Yuan" , Xiaojian Du , Viresh Kumar , Borislav Petkov , Meng Li , Wyes Karny Subject: [PATCH V5 7/7] Documentation: introduce amd-pstate preferrd core mode kernel command line options Date: Tue, 5 Sep 2023 09:51:16 +0800 Message-ID: <20230905015116.2268926-8-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230905015116.2268926-1-li.meng@amd.com> References: <20230905015116.2268926-1-li.meng@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] 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: CY4PEPF0000EDD3:EE_|MN0PR12MB6149:EE_ X-MS-Office365-Filtering-Correlation-Id: c2be2836-8fdc-442d-ce9e-08dbadb2be0f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YiyulUUoQ7RHhNG7+ugLgXuNHeKPOt3OyOSEI52gBPv8vdifE4UsVlKgHa+Vaund+FSQTijxRVm6rvPKS1U5vo96kVXVjP/4nyYdd2Bl98djbo7+4bUxjXwDfsDB688gPVFeBvH99GvdzkZANX0aZ1ez5pqudwgPALDmxPQAqemkz2V8A0c/RDTd0NBRsLWFAu5E7JozTpbXiR82eHFFolYDCIhYAqgNp+Yqc/OvofbZGYE7DaMsLBmUP6yjTI/8fcesycE8eCt/pFlnp5ZtF47YhmE/1aXEEVNVvnsLR/EUxlF2rKn9DDbKkbrhvSvCaDO1zBfSi9u6vtbXqJIQZpJtYGIXTICBM1/9Eeutg9rSGcxEqSFYvA1sDkZ2vpcfkBTYwdDbSFs78L8hMlX1OllRBflfNVWZlFFRQmg5xThkf2b0FawdjXzHWZVVHv5lQlRIjp+ZZKici/a78q//FBdPjgSOm9E9CxdkPtN/uLB7cUjBGxPBiMYwyL3FnS0fFDXZ5aGyZxxkZ9i5YKtbnOuQKUiwuBsO837Kw7ewfKRCeqHDzzw6ioDaGvysXwu4H5yghJKiA5oJj4fLYi6EwSFKMPbMC5olPUp/+lqY8iCDD7Bjjj3gsBck453t4yx27KP2QrDxCR+aMoIPgI6zRlOajMmieqFGhdiZMPuqUOVXaH38YJ1ADAtyjQTNoRqctYSBxV1OqonjTVtAC0WM7r3WWdMUu0e73AtRtxI5fI/vI4kH0Ogyi3r5sN5cxFssu7e/3lUI6zTflrepqBEoPLE/y9UyM2PEwjlZVnzmNdWA3aVB+Qa/WWIBWjV7U7GJ 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)(39860400002)(346002)(376002)(136003)(186009)(451199024)(1800799009)(82310400011)(36840700001)(46966006)(40470700004)(54906003)(86362001)(316002)(110136005)(6636002)(2906002)(36756003)(70206006)(70586007)(40480700001)(8936002)(5660300002)(8676002)(4326008)(41300700001)(40460700003)(36860700001)(2616005)(426003)(83380400001)(16526019)(336012)(1076003)(47076005)(26005)(478600001)(81166007)(356005)(82740400003)(7696005)(36900700001)(14943795004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 01:52:20.6454 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c2be2836-8fdc-442d-ce9e-08dbadb2be0f 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: CY4PEPF0000EDD3.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6149 Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org 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 --- 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 0c38a8af95ce..3145782b3c00 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: ,