From patchwork Thu Aug 24 02:12:43 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: 13363388 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 277D9C7EE43 for ; Thu, 24 Aug 2023 02:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239259AbjHXCOO (ORCPT ); Wed, 23 Aug 2023 22:14:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239254AbjHXCNx (ORCPT ); Wed, 23 Aug 2023 22:13:53 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB76D10DB; Wed, 23 Aug 2023 19:13:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iBJidy/t2OXeEpOl1Ri0jF4SYSLco49TaFE6VkjFopen+5vBHWhlP06zBj+/BLdVTgcjYZikIj0zuOOqZ6FMP8pWT1zgcHCd0G4CJ5bA0TUM35KYzgvkbO5QkdwLPpgAPj87kQ7aRTU5iGm+YRxM8Ik9g9mDR/lc+2T1aTsTZjJgAo1xM/oHnhSeuQd32c5mBvKgZ+RamfnTy8gQYvYlwA+NtdI5l943sVrhESe063vo92rQoHcor5NVjVzMfCJ/y/dU3cO6gcANGHFJkVIzcNHk43C2ETjy2WgoChXBIKEvdIYdULb4Z767VejUUaw7KaURxVxM3Ogrbf9LOuEiqw== 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=uGu8fRjxA/5ga0dJbpFWiyY+95bFnMwxw4KO7X008ZM=; b=VOMLlgxupa8loKp9FJLTE4DHcnyhmKxKK2lnc5Y6d3J8p9kZRK4LHygU7+qxDaisR4yQDpgw8l+CfoX9Tp4qQMKI3hRmlZ9cG+vN5SBBtlpKPr9evWU72JvtOynKVu1JHeD8i/2XoQiEt1GkKTzT8I+n57WsBInzaftxBClBkSrgZueEqctAzIdt3P6IR6noS8VqWNQO7vlQWSsG38ipbsutnUPkGp7l5OQd53oWrwY3Akm+bYWsjfohtSW/GHu0WjKBQTZUSxT3FvlpzvOW6B9iQOMfrERFgHY0d1C31gAfZ6wDZJfFm+hZwr6P90TDZMjDPG4ULsm7z11FPBOjvQ== 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=uGu8fRjxA/5ga0dJbpFWiyY+95bFnMwxw4KO7X008ZM=; b=GA1J8QAzzaqF0bPxoKbEaJDTeTL649wM7xf+W3OIXMZ3QO6FPLQvY6hI5VhyKeN08M6Pe/5N6ND11wqOcPPaG/aOtQ3OpRfU+PUvfid7nnyahAtng+UtvZ2h+/GxU26lUEEg12Kh4zmQKiZLPTeAhsjivPBGuPgV1yGKgB4eQgA= Received: from DM6PR08CA0031.namprd08.prod.outlook.com (2603:10b6:5:80::44) by SA1PR12MB7247.namprd12.prod.outlook.com (2603:10b6:806:2bb::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Thu, 24 Aug 2023 02:13:49 +0000 Received: from CY4PEPF0000EDD5.namprd03.prod.outlook.com (2603:10b6:5:80:cafe::93) by DM6PR08CA0031.outlook.office365.com (2603:10b6:5:80::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27 via Frontend Transport; Thu, 24 Aug 2023 02:13:49 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:13:48 +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; Wed, 23 Aug 2023 21:13:43 -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 V3 1/7] x86: Drop CPU_SUP_INTEL from SCHED_MC_PRIO for the expansion. Date: Thu, 24 Aug 2023 10:12:43 +0800 Message-ID: <20230824021249.271946-2-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|SA1PR12MB7247:EE_ X-MS-Office365-Filtering-Correlation-Id: 58b8782d-910e-4e77-13f9-08dba447c0dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fJWIx0VSXcywbjBEcLHf5gMmF5QKCdg+Jjo9WYt4paoYpIWnrLvINMFdF8foxQYI7VOYI9/gNdcUQbaXy2mU0fBR2IfRXzu3AeNDTqijqhvJJIYSmOQTrYT0l2YRexd3gL7Ucsu1uv6LE5IsvI+UgYK08S0zi+SLSDrvvQnhgemoo3AWfwaH6+Z78/uYrRAzizvwh/WkMr3bKa83fYuGi+9P1tvagB/K5yogdO149Rvtcr2WeX1nKJfXqKWp5oU06GPaJMjIkHSbe0M/MTSidHv3le41nrsWAMhls4BI8nq8H4qJ6eeRPdpANt1WE/UV/TgkS0Sz8jlQUNEbmSqpzk/3Q1seA+bEJGlyL3bAUvPxDqvhMk+EsWrFc7EMT3eQtSfinOArO2vLiuFuH4hhegInwpKNriNkDp8RMGq8WyL1Z3fvQyHII8deCx4edvUwPeCfsnlrulol4U/mKTNiL5G+6YVbPyjbMZ25CebeJuES1/D6JNWFZphXvAnTTx0SvkWdIHM5wDW8TIEdOGwVAf+Z8C1gjj5kfKM9pYYndW5UftUmiDdnGAexgldvUuf+KQTeRgIgjoTHwKg+pzQUe2nvl8Mkw6SO9w2tk+06U0/GBeR9d+mBrA/vtRafKODl2Tev8NeYmkt7vErzCWf+Pwwx21rXKFMJM34MVqp5uIorv0xH8jlKyQqw2fxyJSmpbxKJca7doss1sABm4M44FTFpzd5B8419M+TV/fd/1Sbbh8Cn2ClZrUAdt52HpKn0hpKPgtHN/A9adRrsMyjaCg== 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)(376002)(346002)(39860400002)(186009)(451199024)(82310400011)(1800799009)(36840700001)(40470700004)(46966006)(40460700003)(41300700001)(7696005)(36756003)(26005)(16526019)(83380400001)(2906002)(5660300002)(1076003)(2616005)(4744005)(86362001)(336012)(426003)(82740400003)(356005)(81166007)(36860700001)(47076005)(40480700001)(8676002)(8936002)(4326008)(70586007)(70206006)(54906003)(110136005)(316002)(6636002)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:13:48.7466 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 58b8782d-910e-4e77-13f9-08dba447c0dd 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: SA1PR12MB7247 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 --- arch/x86/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index e36261b4ea14..16df141bd8a2 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 Thu Aug 24 02:12:44 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: 13363390 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 E2BFDEE49B5 for ; Thu, 24 Aug 2023 02:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239269AbjHXCOQ (ORCPT ); Wed, 23 Aug 2023 22:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54632 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239300AbjHXCOE (ORCPT ); Wed, 23 Aug 2023 22:14:04 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2068.outbound.protection.outlook.com [40.107.100.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F216F10FD; Wed, 23 Aug 2023 19:13:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XwL+PeBKhtjqiGwOlcPEYd6oj79TdV5kw1/MFpyFcwyhomYKcMp07contbh75PJAPCcp5+V8N1CIzu2JCX8Lw2RuYSebd/ujFvAhAX9vRFtxXIfi9K1UMTeemEo59DUS76MK9SU605HvO1+hti5d2JO9Vc8LAbVxrqclg9FZCJi9Z3wuTC3vGhHe4msHOhcFMNVaywNK4jsU8/Jb2EC6c4dWQ0fL4ysCeFBY/RzjN18R2mUuwCHHWhXYNcHO458eZnbhb2/n6wAVPvDLFDzB0AbyrGipCxsL51maD2p+79F8hnIwpdQlckuppTipvdQBqKtDEneRODirqauabHUOLQ== 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=DFDn6jp+E1OfjmJLdn866JLVFhZZ4KpifA7cfk25OJ4=; b=aaHoEklm3qGfKluvIfA6ypSCZf59Na8T0wxyhLS3G+hp+06L0FujNiD3BmTwrj50ESi8wkJRHwiHkm1T6Sm6nWh1AmiTRrbGHdwXLBijC4Sydc3qj9Amv8oKhoIXyTLFV9sP9VoTFIiKWZcnZOQCylhFFx7PXjNutpTGlGQuUAKfwByJlnSkVRN1F2Fjbd4foPm/mr2ddPCMoXp7NiPHfRe6Fhc9sw+Ny87nNnhZNw+w0wmQqvIPtxUh6VMF5lus9vdu1f/+dJkSbsHv2titxXJPLS0sbAZu7RAD0W7UaPIbLQZ39F78qyVRANtVJeNyiM2lid8elEtNZ7TYyt8Dmg== 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=DFDn6jp+E1OfjmJLdn866JLVFhZZ4KpifA7cfk25OJ4=; b=yLksfGVsw7eqrfRynInXbQdaf5Bz+HCR5c53aIYynvOJyux9UPRBmdxU4o/piIGPeYONsLLeYd2cX8Z3ULSzrQCCdBF/HfrtqfTDaoNcY+3dWGRGZkALSHUGlR8E4x931VZncsQWJSEpbPnd6RxTgRzXGLfb3O1Ebl54BvccBSE= Received: from CY5PR13CA0031.namprd13.prod.outlook.com (2603:10b6:930:11::16) by CH3PR12MB9026.namprd12.prod.outlook.com (2603:10b6:610:125::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 02:13:56 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:930:11:cafe::4e) by CY5PR13CA0031.outlook.office365.com (2603:10b6:930:11::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Thu, 24 Aug 2023 02:13:55 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:13:55 +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; Wed, 23 Aug 2023 21:13:48 -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 V3 2/7] acpi: cppc: Add get the highest performance cppc control Date: Thu, 24 Aug 2023 10:12:44 +0800 Message-ID: <20230824021249.271946-3-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|CH3PR12MB9026:EE_ X-MS-Office365-Filtering-Correlation-Id: c792e3c4-69ed-4631-85a0-08dba447c4f1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ugwDC4Az0jpoDO5JrWyZt1NnjJ2wilX57IV0svMQFI92CiUbijkdAZ6pFW3Z4HN31WL/FniLzod12dxsQAPJbTDCB69GLl26yffj+N9ZFTkIuo4ciSgRSj/kOSnmid7mywTlB+igTpXPmmwEqZAJIOfN+/+jFn0PP/TEZxmRMPHTdvs0R16OfgTbob0hE+VObWUMx4d2NMFn2q3YYUryegikn717NKYKae7C4d7gkAxosqfk+Vdswn10AK+c6S5eJz7Y5S6yhOuS/Cpgi96Dnc9klcr3pPB8FnO0OJcNro02Vhvf8DzTHI2a6Sb/NVtEukOevDEG4neSL2nSDwOD2jtr4+KO73vlhYIwcZ6qBvVg1mxOAJvj9f+CyTL/F983KWeQFW0dcyB2WocxyTq7ysiXuG6G38dO5T3BpEumTG9pufw4+HYJc+1dxdR1PAVmwiBZRM9VcV/3ALb9ystCmgnvoBoZFOyS4KHWBHQYNgpitjsnwAsU9oHmYcZ8eAzhkfnCSK7HVL7EuLLCmNu8I4BxNenIFI4rFCNEgNiwod29qY6eql4QEzHSIzZxXCe6kjWy2YdeJVzj16H0B1NqKTIpvG0vFzui9gpH0XnDXK57nSKvDMEWgXNm7Jx3DH0RiQA1CDVNUdhaAekewqPhaP+YBXoCov7TVVSaYkScpTiMkgeWY9iLByjwHQen0Mzv4V+k95smtwnvErGKdaDwkeNI2hIEiCvNqQVOJY7VR4/k6lUP+clrOLlzkDUt1FbgWhQQrbKo7bQ3VTZpx8dUGQuy2/X3Yxnsr/wsOFf8tuE= 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)(346002)(136003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(1076003)(40460700003)(2616005)(5660300002)(4326008)(8676002)(8936002)(336012)(47076005)(426003)(36756003)(36860700001)(26005)(16526019)(40480700001)(82740400003)(356005)(6666004)(81166007)(70206006)(70586007)(54906003)(6636002)(316002)(110136005)(478600001)(966005)(41300700001)(2906002)(7696005)(86362001)(15583001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:13:55.5290 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c792e3c4-69ed-4631-85a0-08dba447c4f1 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: CH3PR12MB9026 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Link: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html?highlight=cppc#cpc-continuous-performance-control Reviewed-by: Wyes Karny Reviewed-by: Wyes Karny --- 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 Thu Aug 24 02:12:45 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: 13363389 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 7CB0CEE49B0 for ; Thu, 24 Aug 2023 02:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239277AbjHXCOs (ORCPT ); Wed, 23 Aug 2023 22:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239320AbjHXCOd (ORCPT ); Wed, 23 Aug 2023 22:14:33 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D55F10C7; Wed, 23 Aug 2023 19:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FDMAJf32wb/1HSs8rueZVqr7OqrMHifusbIOuBDWPvhUSQcF2qJRBDFld7FwzrcJUjEYsjc8fldnW3IhGDBW/Gu/11yXI7InfnosZyg1GKmfvi75A6HBuQveHBd/VcNdeualH00jY4zo1g+i5u6UIudqbAT/EvbC3pOINoCGZTX6mxCggSy765ceViGNFewyHmyT+lkxHbLKOgffGC/wp1Kmhdm4vnIPIcmEXXQg89lztUizEs92w1/LxHbPqLfPd///MzEGYdL1iZ9UKYdn8grecCX3kwFdrq3ZQhcomv2SA6ofd0vC/uaEZhV5g7pNe/13yZSrk9bmqrU9h+MjHA== 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=v09ZriuxTJzPZXCqmv5YJ34GxBxcpLyXQadhuYDbtzg=; b=bbPcXhm5w7aq6VAyhEUaYLXogqr6lsHG+nUdQ+Sjb0wswO8qroIYj7bxjfACmO6PFCSjj8YfdMTpM79CGjcUlWB/F1+E7/aYnL/qziOZ8S9UlF4qsH92AmOkhuxL4yNrtMLmd39CYbKYXJq4cIqKVgfkNzc9DWK5pvdX0qtDVJHmclxDhm4HgRhZpJk2F1bM8oIxUoAzQsi83mcUxUk1cXfK8knomKw8J0zzI6R4FEOVD8KfvN4XMJ0Nb4oO6U7TQvvSFqLMHPJvqW7zsSjZIQOx5WRPy1g6LoF7wrleCP5OUUCwKdhLl2wJoHPIKAwljUQHUNvz27EwBAZsP/I4fQ== 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=v09ZriuxTJzPZXCqmv5YJ34GxBxcpLyXQadhuYDbtzg=; b=vxzIEH8a++bd175zfkXGDNYHzy4R5w4hUTGXDc42wbB3y28QxhTcG9BeuWg+fd7gquZCkvyzwcrHjzXliXF5wWyrcf40ftN2Tog7UZFAmyKt3eUbwEdfO/g+WJ+TnFCJnoXvtENY0e1ekX4Qk0aF/M/TA1+7rrgiJXD5sTWI9jk= Received: from CY5PR13CA0052.namprd13.prod.outlook.com (2603:10b6:930:11::34) by DM4PR12MB7502.namprd12.prod.outlook.com (2603:10b6:8:112::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Thu, 24 Aug 2023 02:14:26 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:930:11:cafe::57) by CY5PR13CA0052.outlook.office365.com (2603:10b6:930:11::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.14 via Frontend Transport; Thu, 24 Aug 2023 02:14:21 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:14: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; Wed, 23 Aug 2023 21:13:54 -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 V3 3/7] cpufreq: amd-pstate: Enable AMD Pstate Preferred Core Supporting. Date: Thu, 24 Aug 2023 10:12:45 +0800 Message-ID: <20230824021249.271946-4-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|DM4PR12MB7502:EE_ X-MS-Office365-Filtering-Correlation-Id: 5acb31b5-19a7-4dfc-e291-08dba447d407 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y5I+GnCdE7q61K43eGYYhJqTudtEC5fVYqwfXS2LqPRctuQSHyzKuygHptah2ZcREFbQiHWgEt3UUoq3EgSGtEOHCZdaQDAjFuYRsJXxp8/gXxBBbSEuwNsAYr8pqt8SMylfrigkS4Z00IfKQjQ9gzlW2tcie69Dok/FtA+iPddHkQheUTRaojvunX1iqqbGTfulphD+RVstr5KPAKLj6H9EzAhFLeTPFC49BxzzAmTRuQvgP6esdhhGoxhd2AfIHkE/J1NLiNKZW6c/dwKuQojdorgSMhb8hyCuqEHwsOs0QazRFxuJRmJyfF9bRHa7SoaY/gQDPTFPWfgWfln+dqezqFRNSwr7ICiru8G05XJbiwUNRkpoUNvdD8tBSVv3uPxc4A/3rwXOoVRX/60V2EMqEaUs2ExczJWnK6uoBa9eJLbOwPVdZVu1kXRniy0GoA1MJlGqIXKXndtnw3TARZyloqxlpgHLyhsXNWxE7dVLfrXLUNAmby18AoVXgOXL2HYryRpbQOO8TwFCGH2Fd1gJDNTpRYCt6+HjfXY34TDIT0Sr5lMKcyh7g1Ju8LThbAS23A+4Is4dOi4TZTNWZW3iHq4eb9zDZehpERawr97l0qCVrltzIkJah+cmpMuZFNQk0TXLNJk8tM0zG7j82vAskqguXdzudGQqx5MABvuJir62HxuF94jDjjKWZ6h1TKHERNXJ6/CZr4U+N7aYKQS816qAUivPFPcb+I5AduETqmkJBIdSWIeb0twRY726CNDk58+7IzB57pj2Kwa7Dw== 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)(346002)(136003)(186009)(1800799009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(1076003)(40460700003)(2616005)(5660300002)(4326008)(8676002)(8936002)(336012)(47076005)(426003)(36756003)(83380400001)(36860700001)(26005)(16526019)(40480700001)(82740400003)(356005)(6666004)(81166007)(70206006)(70586007)(54906003)(6636002)(316002)(110136005)(478600001)(41300700001)(2906002)(7696005)(86362001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:14:20.8883 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5acb31b5-19a7-4dfc-e291-08dba447d407 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: DM4PR12MB7502 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 preferred core states. Add one new early parameter `enable` to allow user to enable the preferred core if the processor and power firmware can support preferred core feature. Signed-off-by: Perry Yuan Co-developed-by: Perry Yuan Signed-off-by: Meng Li Co-developed-by: Meng Li Reviewed-by: Mario Limonciello --- drivers/cpufreq/amd-pstate.c | 120 ++++++++++++++++++++++++++++++----- 1 file changed, 104 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 9a1e194d5cf8..d02305675f66 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,9 @@ static struct cpufreq_driver amd_pstate_epp_driver; static int cppc_state = AMD_PSTATE_UNDEFINED; static bool cppc_enabled; +/*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 +296,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 +322,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 +678,72 @@ 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) { + 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 +1105,12 @@ 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", prefcore ? "enabled" : "disabled"); +} + cpufreq_freq_attr_ro(amd_pstate_max_freq); cpufreq_freq_attr_ro(amd_pstate_lowest_nonlinear_freq); @@ -1044,6 +1118,7 @@ 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(prefcore); static struct freq_attr *amd_pstate_attr[] = { &amd_pstate_max_freq, @@ -1063,6 +1138,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 +1582,8 @@ static int __init amd_pstate_init(void) } } + amd_pstate_init_prefcore(); + return ret; global_attr_free: @@ -1527,7 +1605,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 Thu Aug 24 02:12:46 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: 13363391 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 55BB3EE49B7 for ; Thu, 24 Aug 2023 02:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239289AbjHXCOs (ORCPT ); Wed, 23 Aug 2023 22:14:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239321AbjHXCOd (ORCPT ); Wed, 23 Aug 2023 22:14:33 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2082.outbound.protection.outlook.com [40.107.243.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BEC410DB; Wed, 23 Aug 2023 19:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=giTkVfkyeMvX8JMk8gxVhBhk3s0qTjPDnd6GIGgyuwqc3BiuurMPfSYaKDguAn5y+85k/fi+IS1kQOcwRUTh7kqlV6Hd/ntKjm4NtxPlUQkWRffEtQ9lHmuyb8eS6spKjmRterRBaKcQtMoXoLHsdG7q/kEMRMXUqZ0GzOmsnjqjlX/1dSw20uJhxq/x0Z9bRYnBXUCLlC6X19vXW+9SMBRdMoPtWOaxm00lHgAtNBXtWaWdJIT3Ntc8nHV9uBVAOYswiS8Qzk/WferVQgG6akHS/JcOjaWa0BlfAUn/mSwVEOOauJazDqPwTMoCXrYIJvpF+GnsHu0DCAIvUqbwpQ== 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=yeg8ZcyDn4t8Y70ZJHtotz35t0wSh2z3U3cvlssn7Zw=; b=fqF6J0cGRzvTYO6TNFcBD6EPP7qmA6J4IwmnlN9pd6UDhaBIWYylPJRmb4DkIYxWzjCho0qUHxhII2hVVY6UysacsKr1cCsPNRUUMLh8Aw65blf4YayVOhkBjciF0hb/JxII5gj3278WmREI1pe2bFHCIv1SIOKrYsaBmj2tj5IpeUA87Gqu440wfsmPGgwLu7Qnv51xGGWd99Gm4Vae+YQpCgpe90lvHIwg9AGjlmJxQPUitkXYs6HhThGOJBTLQFtFsusxcap/d60sslO0NfLvs6fvmswIS8rIwiXkO8feT0vAOQqAz4OeLA1sbgOobf0bKA86sbmYw/TaMjTR2g== 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=yeg8ZcyDn4t8Y70ZJHtotz35t0wSh2z3U3cvlssn7Zw=; b=5gs/zaPcfPLC5tJNEdLV5rIQUOO8OOp0zjliNFrXmrsdawIKjJ2fSzgXiVPHOSjtuwhle9pl+4qjgOfMpJ4hAKGcG/Iy0d57Ab4dufakM1hJZgYNij78BEjccJ8JFJ52mNQ44PSIuArpx6fCn4T1sxJXAx43Rwcvhb7VG5xqAU8= Received: from CH0PR03CA0440.namprd03.prod.outlook.com (2603:10b6:610:10e::29) by CH3PR12MB9453.namprd12.prod.outlook.com (2603:10b6:610:1c9::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26; Thu, 24 Aug 2023 02:14:29 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:610:10e:cafe::55) by CH0PR03CA0440.outlook.office365.com (2603:10b6:610:10e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26 via Frontend Transport; Thu, 24 Aug 2023 02:14:28 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:14:28 +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; Wed, 23 Aug 2023 21:14:19 -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 V3 4/7] cpufreq: Add a notification message that the highest perf has changed Date: Thu, 24 Aug 2023 10:12:46 +0800 Message-ID: <20230824021249.271946-5-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|CH3PR12MB9453:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a97771d-10e4-4a4a-3494-08dba447d8ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 18zy6u/wRDdG741J0hrwEsyybsIJULAxu36dSxrMxC1865JHo09zh+BEOMAk112YDTdyr2MDQLVtSjUnEfbHv/0HwFuE3H8bvHFfcqg7sNKHCcFqIAt/0if8U5CNpHaEoeXy3NCPa+Hop9h+wE6Ql8X2ZgVVYI/9hHcPhAE5Wvy9Tc7xAqLYCgdSi2/2OsZTUU1WD44oqfABNQ0dfN2pJXfDdXu30Wus1Cr58DhhgdpSCcxsDGHlMKGfgM9ikOdGyJQMbuiKCfih4UjgeuNs3R7i/dUm7A0WpyjH0xalQIFoBBaT75B8uexd1xSqH5HooECpFh9o+OWh0U6mCCyEJC1rUttS9Fx1tKqOmIh0jCekuEjWGuV69m+Qjlo7r2VlJpBRgx70DHnDCmM5EHa07lcNolXOj7mKn2ad1oXUhwesv3K01OSZUCEZa0X03BLe0Vs0+7k8uM7E7tu2f8RY2P4u7MYmuISYqpkho1Nowj2q+jZ8t0GH8hoabrfImsnL/BHe6fw5Jv5YHQPOw1tPp+5JrauUkbx2ZpSpP6Uutd7MeQ1tOr9xZ5nmjhgIs3s/JBsdRM+VMDMZpceb3UYMOGLc0ytN6i+4tjesXyj2HePTocr54ug8Ovv0uGLgP61fPT4LkGK08+a1gbPmGZCu6EFgf0BGE29LApLfnHv1ZwxOax8q992zlpxwnYpNKxjefdmUug8xCX8FqvAryOX46uXWfT4y99Ka1eeezVToejoD8NekhkjfywKGfYbSgA9+4sDTaTlqa4InDeXQbqgLYNkv/UMLM4I1Lmyb8wK1nPw= 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)(346002)(376002)(1800799009)(186009)(82310400011)(451199024)(36840700001)(40470700004)(46966006)(356005)(82740400003)(6666004)(81166007)(40460700003)(7696005)(336012)(426003)(1076003)(40480700001)(16526019)(26005)(47076005)(36860700001)(83380400001)(36756003)(2616005)(6636002)(316002)(2906002)(41300700001)(15650500001)(54906003)(70206006)(70586007)(110136005)(5660300002)(4326008)(8676002)(8936002)(86362001)(966005)(478600001)(226483002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:14:28.6695 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a97771d-10e4-4a4a-3494-08dba447d8ab 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: CH3PR12MB9453 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 | 4 ++++ 3 files changed, 23 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 50bbc969ffe5..842357abfae6 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c @@ -2675,6 +2675,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 9bf94ae08158..58106b3d9183 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -232,6 +232,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); @@ -377,6 +378,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 Thu Aug 24 02:12:47 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: 13363392 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 65275EE49BA for ; Thu, 24 Aug 2023 02:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239253AbjHXCOr (ORCPT ); Wed, 23 Aug 2023 22:14:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239328AbjHXCOh (ORCPT ); Wed, 23 Aug 2023 22:14:37 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2086.outbound.protection.outlook.com [40.107.220.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4255F10C4; Wed, 23 Aug 2023 19:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FPMt50tdeBB9RvG2l8FYNp904E/S/ik+CJ8yYAj59dZIBEqB1KyLZTm6dPqDNi30OFU5XX+K/jGBbLM5Swi6numdPQ4zJQL/feUjV9CSz/SK56udUQ5LnsSrpbb8U/zqRx/zFqp6gqQoQRqzb14oNHakM3vSy+hyakyPEm/7OlTPfc9vLJKnJDdkFFNTEc33qCLc3YtCU23QcnWIlk+UGb6nIHqznZlboYaGNmV/8hKWXsLFtSy78TjSn1uILs7JFazZxUvCXF0/3szRJ9R0Bkj5/o7+ITx7FggGPwXpwIh1ncR+NWTUcyIoyR4DQNxst/k75/PnoxZdG6H9bb1MGg== 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=R+RQepWEpY82uXKfwKZoS1l72EUVb6pDIlmqk6YuNWs=; b=BZwFwx3tJUf5gwJGTQJp7t8hxQYXLaozc3/clUFlOi2pJ9C5hoN1wqETObHGfmd67RenhgMvOMeuMRvySbl8h9Ik0u0EjE25SB2cOoQtofSN5iAJ7rzCYbfJwVVpPmnDWXwEr/CU0NSDldAVfE7DS21VaueqPSbVFmZegYHqd2QoGTHtrcXCOG5pQ/OR/g8yfaXU9C+15JNG0UuG15OeGDiGV9qXhkWE9auY9+TDOGCtaL4kcNIbLGh+TuE7Rh3pDNZxGuLjxH96VdLfpcaLMlzDcoe5KLKDpqaTcSpF0RdQ2POATsyelKzq3nXyF5e1EClinE2iJOpAr98ywFqNbQ== 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=R+RQepWEpY82uXKfwKZoS1l72EUVb6pDIlmqk6YuNWs=; b=4NmNSHIAsLAJxA5uf1QmGHGyu12H/MhopCMO1ssyLMDoLhFF64CG3I0bTBfghTrvvnz1nU3DSKT26TvLD0kPunsCae55Gqzxf3cmr15dzC+COADpP1SNCwc/7p2vx9ybVtAw1Pl5Fh1OkvueqIWZdHAQPCZzm4H3SC6eapJH6GM= Received: from CH0PR03CA0450.namprd03.prod.outlook.com (2603:10b6:610:10e::28) by CH3PR12MB8972.namprd12.prod.outlook.com (2603:10b6:610:169::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Thu, 24 Aug 2023 02:14:31 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:610:10e:cafe::59) by CH0PR03CA0450.outlook.office365.com (2603:10b6:610:10e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27 via Frontend Transport; Thu, 24 Aug 2023 02:14:31 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:14:31 +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; Wed, 23 Aug 2023 21:14:24 -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 V3 5/7] cpufreq: amd-pstate: Update AMD Pstate Preferred Core ranking dynamically Date: Thu, 24 Aug 2023 10:12:47 +0800 Message-ID: <20230824021249.271946-6-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|CH3PR12MB8972:EE_ X-MS-Office365-Filtering-Correlation-Id: a687b481-ba68-4022-bf3e-08dba447da3b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GpbpN2MK9Ib5u8PU8ydkysNGBE3vPmwXgenA5qXd86007XxQ2Pf8O87mO15Yn8XGSU8GQ9Osldh06x5J0lG0lsW12aMAHPcYNnieK8PntD+hTaNI+mAmVMGK5FWlN0BiZZGZ+h+XO4wYi0NYWcc2eVQ5e9/1S+sCCS0a0dLsLD8IY63LKZHfy3LRzci/deeFB+D3Rna4ByWzMDoze9EnAeMfWbC/Oaw72VbuLIxyT3UjABhmCDCNaYHjB5n12LcV5PHR1bQ2dsPYJPrMwXo/tuNtSjS4uAEg0j0HdvJZ3X7VLcNGsLcH8tOT7Ye631xXle2zb/UQ9q0FTixnan5fl/1VGE55zW2nVGBXMMOzix7WHL8hs42UCjK/VYffEPKqBJCSn35J3D7+wAoWWsHLUVXdDogtYqhOZBzF/LaBvs+L/B5yU6JYnqJPX505/oNBsovOe4oL3ejPEpyf936mRsP0uUwQolYsy2/eCQiKuIn7LL0HNnA/r/DT8Eh32ogQZAnCbMc+4dXPPHjNSDvNErGY1riISrYEov+I5IygU/kZ38F87Kbfq4FshVyaQBXndStbeIg6xSwTwKw0j92Vv6JEpXdnttAiF7t9aFbTZPOdOZYqgMfNnMV+KjhUZlqDfBt9TCJ0bL8SQilPapXojnRv9+xygz7CxvUj89MXtz6/0LlYq/AU1BsZltGEfTdlHAX2l2VNaJrfP+SSdX6a8ifDf3wDugR7rAvWIlOU8DuXKw0eKbwIdg4y/gcRJhsKsjjOBQuCrI/z0dUZfDWNjg== 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)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(70586007)(316002)(70206006)(110136005)(6636002)(8676002)(8936002)(2616005)(4326008)(41300700001)(36756003)(40460700003)(1076003)(356005)(82740400003)(81166007)(478600001)(6666004)(15650500001)(40480700001)(83380400001)(2906002)(47076005)(7696005)(36860700001)(86362001)(426003)(336012)(5660300002)(16526019)(26005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:14:31.2789 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a687b481-ba68-4022-bf3e-08dba447da3b 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: CH3PR12MB8972 Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 | 32 ++++++++++++++++++++++++++++++++ include/linux/amd-pstate.h | 1 + 2 files changed, 33 insertions(+) diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index d02305675f66..8a8e4ecb1b5c 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_highest_perf, AMD_CPPC_HIGHEST_PERF(cap1)); return 0; } @@ -336,6 +337,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_highest_perf, cppc_perf.highest_perf); if (cppc_state == AMD_PSTATE_ACTIVE) return 0; @@ -744,6 +746,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->prefcore_highest_perf); + + if (prev_high != cur_high) { + WRITE_ONCE(cpudata->prefcore_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; @@ -1468,6 +1498,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, }; @@ -1482,6 +1513,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..fa86bc953d3e 100644 --- a/include/linux/amd-pstate.h +++ b/include/linux/amd-pstate.h @@ -70,6 +70,7 @@ struct amd_cpudata { u32 nominal_perf; u32 lowest_nonlinear_perf; u32 lowest_perf; + u32 prefcore_highest_perf; u32 max_freq; u32 min_freq; From patchwork Thu Aug 24 02:12:48 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: 13363387 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 D2867C71153 for ; Thu, 24 Aug 2023 02:15:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239296AbjHXCOt (ORCPT ); Wed, 23 Aug 2023 22:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56582 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239330AbjHXCOm (ORCPT ); Wed, 23 Aug 2023 22:14:42 -0400 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2064.outbound.protection.outlook.com [40.107.96.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4219F10C4; Wed, 23 Aug 2023 19:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jgmt7X74/GyJzY26nfebweOG//dVLJOhobMKG4aLwshV3+eqszGKSHwC5wEzsbhgwd1aGj6+p/UDCfQWLBlSzAP1/TFGuBl+MlBBYR202vPMIaGeFSKW1LmJ0IY0JKR4TcNrJO+0kkml9fuZTxR2YG+9FMIFPKptqERITJYDgC6yQV4QoxPfKreTG5jwGAVkHt4AMmCJO+rQcGjY8jgGNplQX6fsJKeHwyrx1yhpFvBOqS6JGKcM6n7W17V4alKnyqP0N8lh9A0ZPzeys7e2ahpPr7Z9zGmfp23Zsu7ejMj5dOqf7GkkVFa38Onx1USCoM/Syph+XvQcFErAuax3VA== 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=xdQmgPZ0zUlC4SlUyNmWx6l2lYzdtFJA5PmVErBA9Hs=; b=HPIErkHJWVm+DPGn633ouDOxcQryDCdPVhpl3L8Yh1nic3mtFZc36sQIpgPa1W0Nw1iYPiqXUPu+kpq2LQ1ct15HmQ8RT2t0Rv+g+1/zzV9502K+d3CYcs+12Kdf8c1gCytTc+9ZKyEeFCZ79k3R/saXSLZK+WFvgcfFpqDuAtUY5C/drcTxHc9+ZEh/x8pEGpIAuYCM39HuA2b0/ztPqZrXsbCwTGS+mgFwdrQDuyMw5eNeCVCcz2FGY6NU/biuNWsQnE+rN1TfNFuTBWenMP4xRet7AV/Ewd9yX4PdgTbRmN6skjfqYiH18N9zTIZycLpGp5OR/nhf0DDAtWq4oQ== 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=xdQmgPZ0zUlC4SlUyNmWx6l2lYzdtFJA5PmVErBA9Hs=; b=jxn0LnXOgLgAe6gmHhGOe+hNh3RTeMG4MxspnM7v+IP2Dyc5+ZUBirzNaEFoy3xVdOlBafmO2gLQugrVLMXLt7FpyHuiX3BGJL8ElsOaZ/p1FW0TFG14p55F1AdKyWqi+quddK55Jbu6QF8dCAzgfnLwmjL+XmvsnxCi4HgXHKg= Received: from CH0PR03CA0431.namprd03.prod.outlook.com (2603:10b6:610:10e::22) by PH8PR12MB7230.namprd12.prod.outlook.com (2603:10b6:510:226::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Thu, 24 Aug 2023 02:14:36 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:610:10e:cafe::39) by CH0PR03CA0431.outlook.office365.com (2603:10b6:610:10e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.26 via Frontend Transport; Thu, 24 Aug 2023 02:14: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 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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:14: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.27; Wed, 23 Aug 2023 21:14:29 -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 V3 6/7] Documentation: amd-pstate: introduce AMD Pstate Preferred Core Date: Thu, 24 Aug 2023 10:12:48 +0800 Message-ID: <20230824021249.271946-7-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|PH8PR12MB7230:EE_ X-MS-Office365-Filtering-Correlation-Id: a53d6250-08b2-4273-3df1-08dba447dcc4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LS3AHKJx4jeigzGSV0u5LC7NR8zAB9ZqSGCefB3Z64kbmfnmR/bVuMxSs64U5+XDb65gQhuYRdHqRRFkfOSQgfl0bEyg3ZdBPOONsb8PKQrkrkYJeIVgEPpHyIbI3ia3rWNbQQONbzRXm/tYVjnfPXLmbptKUxsVQ9ODYxwEsKPp01QlZ4DxSzdpC4plnA9bhf1WwZ7slXUubZEBCOqsTh3nziEtDfXKNySR6TVpL2inRlAUbkSjdlECJM+5VfSLa0qpGtx3I6hGnqD2XJl6ukcoHacEO0K1xYa5rGY9mlHHcnYIcGAAm39+t76ote7dpCOumAp81le+FKAjkF/xtKYPtHXYNrHkSxQWdrmbMju274X4Osd6F9b5b9c9W1ot8EiZEMiseFM6+ZlR8KUj1nLTJ9QvEHV3gRlV0I2njLKKFZh7OC2xwy5eBhhws9B1+tsbcjBXcGzykpUgmKZSvcdQpP/hMHRoXOZoEg9bOTcmUg/Hi1UkB/AKkjoksVbByHoP59sV0277YgTEeVWK6FPidMM9j70gq38nJoX/HmRNfYc9HAZFfnRxCDQefZRkwnh8R5+cGBf6EnTJdNk8dtosxmSAkDZd9apyh1/LFGeXrmc1QzU+9MIlr9kwbS0u2J2SWh4BZZaV6gkR2Yh39vNiGyAjwJyUCBkc7Zjj+aiwXN3QOpcxFQV6UN/zaTcgWfDcWXwcO5AgpEPs38AKd0MQFMwaAcWT0AGQ3GLsgHmhfSkmasLD6q+kny4F4uWB4LMl3iO7R1Uje6odQGE/KQ== 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)(346002)(396003)(39860400002)(376002)(186009)(451199024)(1800799009)(82310400011)(36840700001)(46966006)(40470700004)(36756003)(86362001)(478600001)(40460700003)(40480700001)(47076005)(8676002)(8936002)(36860700001)(426003)(16526019)(26005)(2906002)(4326008)(1076003)(336012)(83380400001)(5660300002)(2616005)(110136005)(316002)(70586007)(6666004)(82740400003)(6636002)(356005)(54906003)(70206006)(41300700001)(7696005)(81166007)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:14:35.5445 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a53d6250-08b2-4273-3df1-08dba447dcc4 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: PH8PR12MB7230 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Introduce AMD Pstate Preferred Core. check preferred core state: $ cat /sys/devices/system/cpu/amd-pstate/prefcore Signed-off-by: Meng Li --- Documentation/admin-guide/pm/amd-pstate.rst | 53 +++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/Documentation/admin-guide/pm/amd-pstate.rst b/Documentation/admin-guide/pm/amd-pstate.rst index 1cf40f69278c..2369b58a3521 100644 --- a/Documentation/admin-guide/pm/amd-pstate.rst +++ b/Documentation/admin-guide/pm/amd-pstate.rst @@ -353,6 +353,47 @@ 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`` enable the scheduler to favor scheduling on cores +can be get a higher frequency with lower voltage under preferred core. +And it has the ability to dynamically change the preferred core based on the +workload and platform conditions and accounting for thermals and aging. + +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 Preferred Core Switch +================================= +Kernel Parameters +----------------- + +``AMD Pstate Preferred 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`` + +``AMD Pstate Preferred Core`` will be enabled if the underlying platform +supports it. It can be disabled by kernerl parameter: ``amd_prefcore=disable``. + User Space Interface in ``sysfs`` - General =========================================== @@ -385,6 +426,18 @@ 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 Preferred Core. + + "disabled" + Disable the AMD Preferred Core + + + This attribute is read-only to check the state of Preferred Core. + ``cpupower`` tool support for ``amd-pstate`` =============================================== From patchwork Thu Aug 24 02:12:49 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: 13363394 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 1EA43FC6165 for ; Thu, 24 Aug 2023 02:15:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239297AbjHXCOu (ORCPT ); Wed, 23 Aug 2023 22:14:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239332AbjHXCOp (ORCPT ); Wed, 23 Aug 2023 22:14:45 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2086.outbound.protection.outlook.com [40.107.212.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 659D810C7; Wed, 23 Aug 2023 19:14:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C/FiMct444vsyBl3A9lB4hdxevzC4d0Q5Hq/eA8V0RffOxDM0sEnLjv3Sb6Gr3dypbCpySv3clLGpBSwMvVZ1f5mSMWsJ3sLgy8W+HJZNLmWrdrDjhy0gv8uCQ/ZtBPpPyW2ik4iN8dy+0GWxP/cZKWJl/RO8BBOmPhKsfI+w3HJ3A7KMtsIZ/ZyBFAc2wqiyqAPmcJUekOdeNzIC90y6R2JIwf/HY8QSIZJ1dnJ/WTrBJy+4UVuDHRrlGnG8/paqBRdcz3Y+T3YLPfdhsOFgNVBYhh9erYwkleMGRM0Z/IibeoXMbpIz/f2ka2WnMhur9/HWDJIyNlQ56cyzxEf6w== 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=L/CkHh/XcfhK0dNgI9Hlr7RAo8wQP5DuG9zY4ElzxDw=; b=LJWSARFhr2UBHlLgX2L7SDHdxmjENUA3xNPL+3JgwB7SML4Pn/ryjdVNL6J9VyBGh/iABGkJ63CIXUBtTCXPhjlUEsjgxJlNqOKe0k53eRkuV7pi2JWht0TbVgAxHkUC6aV0udKb1Y9cMdM9skB65ptS7WXSZsXmgcUFBY+sreLIP0N20ww1yPdTszeG65A0O22LHxHJnzApT5RvUqhQ9FL9ml2kgveWGRKN4cqVrVigJDPMQn8qk1gMgSrsL6t2+RFEiRFsq1Wk5huxUCQSrrJh+iYJ8YzRcRwM9BhFtru9sBDwSoqhxbtkOKopRBRfu8fP+T5PX03lK77lcNsl0A== 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=L/CkHh/XcfhK0dNgI9Hlr7RAo8wQP5DuG9zY4ElzxDw=; b=Y2DnfM26rVXnXsSZcBGAMJSUSggeuCKVzWj0uPOTupvH6CCd/5j5OOGUNzYCjHYlXNzgn6pEdSsziP0M2/Qm2G9F/HfnaLAcpgqI7JEp2iO6O/azXUYggEEHNWBmoHKVRpuo7LtpwDhOAVXdqAVExqBv8rxCcQfaOeBjBypwt0g= Received: from CH0PR03CA0423.namprd03.prod.outlook.com (2603:10b6:610:10e::6) by MW4PR12MB6975.namprd12.prod.outlook.com (2603:10b6:303:20a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.24; Thu, 24 Aug 2023 02:14:40 +0000 Received: from CY4PEPF0000EDD3.namprd03.prod.outlook.com (2603:10b6:610:10e:cafe::5c) by CH0PR03CA0423.outlook.office365.com (2603:10b6:610:10e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.20 via Frontend Transport; Thu, 24 Aug 2023 02:14:40 +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.6699.15 via Frontend Transport; Thu, 24 Aug 2023 02:14:40 +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; Wed, 23 Aug 2023 21:14:35 -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 V3 7/7] Documentation: introduce AMD Pstate Preferrd Core mode kernel command line options Date: Thu, 24 Aug 2023 10:12:49 +0800 Message-ID: <20230824021249.271946-8-li.meng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230824021249.271946-1-li.meng@amd.com> References: <20230824021249.271946-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_|MW4PR12MB6975:EE_ X-MS-Office365-Filtering-Correlation-Id: c99c7a61-37c9-4e16-b9df-08dba447df8a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3vdMQNOvwAMizMj6y8fms38UbY2Y+aQ1d+Ahofecj9RCFsEFPHU6Phtt9TLuCapqczl1NGDg+/Jzppc0HZOKyjfBbOnjxg1ie3Rr5Vs5yzoIcBjOoG9F7cknEpUSLM38G+WMMuAea6uym2PzCcs18taHgxHGmeyiJ7KgYtZVmqiu7CE1wL3yUh1XOLgqgJbGclknCITCobyCvMjKmhaaLjgSxCjCp1Du9msNc2ROasSFFWMCdQsEOZA2BFc7SoenJANTyEkQrIYC35ImSthVVnGadgsWjyzlRffMMBQ1E0FJaQHfNnQgig5j8YuFgipd+FDFHM20/LL3CvEdhlMPfpEUquS5pU3C2aDUJOXMDol08Q+ZnH7efGi98eTg1GCqqgGjfpyB9Qz/SHx6hnmmoskDM9gWlMLYu44ZAbqKJnwJDl9rG4XvOY/mirwZaz0Vo08/mSzmjNDyrV40ElhYHzt8X4gQFspOV12Flm+rbze2a5+kIy+E6exLlTpNwsWf/m1MTj5vxM846QqvwkF8eC8xeeFQdLXCZzuG4xulu1kGmdFdtBAaaMaV8BklgGJav8yqSYVzAglld8LdVjrLaO/TgwX4HkdcdXPT1FPZuSvfyNUFjL5lXBUQghuKi2Y6+o2ZXt9O4FzZijI1jAY4Sq1u461koAaXogqsFW4cPvtW5pLESt6GJzYkV7KlVpJMsR2/9dNTdlrW6N4TBLa2Hy9NmynM4k89tM6pDcN8Bf1NRhpA0I3tKNSeucYyIV8zyaUn0Gc3nukgvEDHmMpHigbRq4GaH3JV/m1SZB65xtRKFtNKTLnnc54Ejc09DM0n 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)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(54906003)(70586007)(316002)(70206006)(110136005)(6636002)(8676002)(8936002)(2616005)(4326008)(41300700001)(36756003)(40460700003)(1076003)(356005)(82740400003)(81166007)(478600001)(6666004)(40480700001)(83380400001)(4744005)(2906002)(47076005)(7696005)(36860700001)(86362001)(426003)(336012)(5660300002)(16526019)(26005)(36900700001)(14943795004);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2023 02:14:40.2007 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c99c7a61-37c9-4e16-b9df-08dba447df8a 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: MW4PR12MB6975 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org AMD Pstate driver support enable/disable Preferred core. Default enabled on platforms supporting AMD 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 23ebe34ff901..4f78067bb8af 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: ,