Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1799004pxb; Mon, 13 Sep 2021 05:54:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK0U9/N2w69QDrdJqXn6v7+tPdV0Y91Egpe/jo+hn6xqCp8fD7T1DJ1vqgAbp6n1JjNwNx X-Received: by 2002:a17:906:9452:: with SMTP id z18mr12393945ejx.25.1631537642606; Mon, 13 Sep 2021 05:54:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1631537642; cv=pass; d=google.com; s=arc-20160816; b=sOCKW/PQpQ5YZTCNhnnKi2OV0OdKHrd9KYmyFRhe3zhnfNgG6qFmC2knnldW/YzZ3X Wg8AWymcGgBapiAS3duVPSgVckWl8MtS5rbJGrPn+yUxNJWZ0YNSH4CLO7GJ7HOTKdEl fuvilGCiQcVLFmh3e5VPFglRxQdLRXR1Hs69C0QE5jxzKSsvJpXBTGzrpxJertEDZ6Qq X74SKvhfpVwho1PH0mtdde0rbJrCCaBmrVZU+BPEBq1KsLxZBYhvA4xwoVm272vkiRxh yoGVLQpLfH+aXLbyIR8sTADQhUipkd0XzNF7FgyQFinhAGxSseO7+QtBU7dbAJXKzpTc q4rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=8wvrwCVklbys9dezQcaeIKSx2B0QReUrQ2cqCsGOUEY=; b=ixTRo680gW1whJiLmBzg10eGOrxmDpkWEuArLAtzmUEU0eqZR3N2S3YGU5krgfXfFK KqmWXjDJn+Ljoe70v7gphez/FfC8BpJQ2a05r6uc/JKxWXIsaBrj6id4OHgHL61+Z60d 8Ahk684DjY/IRLifqjjALqZskdF1EEi889XzRUoAfEUnIvfndFFKzfYvpV94UASGS6V+ +MWbt0P0+nGUbAenrqVwe8o4oq5MvQZvJ6B5XLixBK/pISFFj5zMbNVM0HNfDqQoYxAN UXUAW4DAOGYLiB2Nd4/m+BcSyYkO2pHzCN12vDLs3KgKTKPK+9vtGhW0H7jjAGEXy9ST fVAg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=q3oyH7vB; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d5si7481209ejm.652.2021.09.13.05.53.37; Mon, 13 Sep 2021 05:54:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=q3oyH7vB; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239509AbhIMLT4 (ORCPT + 99 others); Mon, 13 Sep 2021 07:19:56 -0400 Received: from mail-mw2nam10on2045.outbound.protection.outlook.com ([40.107.94.45]:16801 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239479AbhIMLTy (ORCPT ); Mon, 13 Sep 2021 07:19:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EJgGGYXnGFgS7QjkJEXwRXI8L9Dm0Tc1b+gINOAAHGVCXzPRa4JTAFgKqV6CosmTTzOzIPCUExv1vYaZMfUVn1XVUoAlik2RZL4k/RYBh8FA1rI+IIXKg46iLqGQ7OEzBpCLaDtbd5tjsAUDzop73JEXY58oaApJx7eFBXfqDiPMtDCsVZC0PCnnX+/Iw7j845LCkewLmg2W14oxxE6IOpndUwmmyHtonv1cm2aw140KHsh3B4UgEvtTg5ZpXcP74AbvcxF7OD1CgcopZKhsHTvYGittCyIOSKAXXdlpwOctPv2rm9OPd0JQr0HmBB9+/gBWXOWbUoPcsHSKzcB4ZA== 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; bh=8wvrwCVklbys9dezQcaeIKSx2B0QReUrQ2cqCsGOUEY=; b=We//KObRz5SW1o88Gakn10TK0arVVgIB8J53YFVkNZu83Ed/rPJy58xcBoLzooV+NcXZ4exbCzRm9Da78LJ7HpQWAf8TQxQy9AY5qDaxVchibyR9LdhcjRtmYLEJZ8Ri6bvK/RTSGl6Uv7TfLugGfgMYSryR3mBKFLAYtNd5I1w2Z8XeQaxJIrHyPtbNKFBEMwBL1+iqSht9qi9/Ufyzsip7OEbhghShwtP06DxgzURQCA0dwX6D6DK3KYlQjzkBZTahjUxkL/QT61A4OD2WEtJtEiUybqCcygOT3TYDLWurNAHUh8axr8ddcGsY1pdUbRS0tPjR/7DxGgon2A2bSQ== 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=8wvrwCVklbys9dezQcaeIKSx2B0QReUrQ2cqCsGOUEY=; b=q3oyH7vBYVI0QjSnVl7T0uoWW7G7A9tUfynOPTbsNUZIW0igzQ8OJbygFZZnrzydpKIWGuC4UFeJ3PzB45iJa5562bPEs0aicZ6CQ4+ssRfd11MQ7RQBNjcVEpkhmIdt5XWN3JUda4TX6WmpesqJwNgblB9NI1wfs6onBigBD84= Received: from BN6PR11CA0011.namprd11.prod.outlook.com (2603:10b6:405:2::21) by MN2PR12MB4991.namprd12.prod.outlook.com (2603:10b6:208:a4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.15; Mon, 13 Sep 2021 11:18:36 +0000 Received: from BN8NAM11FT048.eop-nam11.prod.protection.outlook.com (2603:10b6:405:2:cafe::72) by BN6PR11CA0011.outlook.office365.com (2603:10b6:405:2::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 11:18:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; 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; Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT048.mail.protection.outlook.com (10.13.177.117) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4500.14 via Frontend Transport; Mon, 13 Sep 2021 11:18:36 +0000 Received: from hr-amd (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.2308.8; Mon, 13 Sep 2021 06:18:32 -0500 Date: Mon, 13 Sep 2021 19:18:28 +0800 From: Huang Rui To: "Fontenot, Nathan" CC: "Rafael J . Wysocki" , Viresh Kumar , Shuah Khan , "Borislav Petkov" , Ingo Molnar , "linux-pm@vger.kernel.org" , "Sharma, Deepak" , "Deucher, Alexander" , "Limonciello, Mario" , "Su, Jinzhou (Joe)" , "Du, Xiaojian" , "linux-kernel@vger.kernel.org" , "x86@kernel.org" Subject: Re: [PATCH 04/19] cpufreq: amd: introduce a new amd pstate driver to support future processors Message-ID: <20210913111828.GD3731830@hr-amd> References: <20210908150001.3702552-1-ray.huang@amd.com> <20210908150001.3702552-5-ray.huang@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: 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-Office365-Filtering-Correlation-Id: 8ecb4eea-d5bc-4efa-bea8-08d976a83aaf X-MS-TrafficTypeDiagnostic: MN2PR12MB4991: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jlbLsPSepq9IxyHvyWIwjhrc1Xo+oyc3ia4UetjBrAOrPhZPOQaO3HJYGAKA4MSD3l/3mDCsMlNqUEu8ObW2EwapFreIwLRsDVqFkvs8nnuTSSYA4qWTONAbDUr3L99hJWWj4lpX9gHCkNewh0T4O9R8eMOWc95pNxRPvJl227RmW0r3dgAnxpYKqorRAct50nb4vculkUkpmvY/50cOwVDx4upgMwtP2gZjaLCMKTp5v3xUUhr3zYlLklD+tNS/TdmF/LkcbDED1lNpRx/ObaY/aHeHaAQzBAC0O3XAMFIETWeAsZH+KxDC+s0f7zbki8T2ULD0wp51mBt2ZqY1OCertzFJ9xhoKY3ccgodkVxUHzrR6VCFC8nLTUFPiZaic539nszqpqRUQIhVY5N1IPbzNMtkeDNAXkMDBh9gk8gSScaTh2sOAndAcsfW4ZXLkYOC4pfJKAoLBRDbTUP2igzzhMbQlEEeLX2W9MTu6TBGsIqIRSN4b0Y2ZE/Nf9JCwoGRUVYcT3uZJV2XLHWqhEAILtg0m6GASouxJPT7BWLLDgIWvis1OFkrgSi/d4OHHy3KPd5f2Ii0r3wTTkm6AeqjZL/6sHwfT1lQlox4Uv7DCenJCT7o7SfsVSmAQVzmUwSqjeOE3aJn5EITZa9NzbHn5n+gDKo7cVx7k/RS/SU6NYPPmBdzcJHsRFep5lUXFo0SleC7JfIbTwTvJ6nUQS6frxxMaRdxa/VkhDhI8Wo= 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:(4636009)(39860400002)(396003)(376002)(136003)(346002)(46966006)(36840700001)(53546011)(47076005)(5660300002)(6666004)(316002)(4326008)(356005)(2906002)(1076003)(83380400001)(336012)(426003)(26005)(55016002)(70206006)(36860700001)(8936002)(81166007)(8676002)(70586007)(186003)(16526019)(6636002)(54906003)(82310400003)(82740400003)(33656002)(9686003)(33716001)(6862004)(86362001)(478600001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2021 11:18:36.0385 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ecb4eea-d5bc-4efa-bea8-08d976a83aaf 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: BN8NAM11FT048.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4991 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 10, 2021 at 03:31:26AM +0800, Fontenot, Nathan wrote: > > On 9/8/2021 9:59 AM, Huang Rui wrote: > > amd-pstate is the AMD CPU performance scaling driver that introduces a > > new CPU frequency control mechanism on AMD Zen based CPU series in Linux > > kernel. The new mechanism is based on Collaborative processor > > performance control (CPPC) which is finer grain frequency management > > than legacy ACPI hardware P-States. Current AMD CPU platforms are using > > the ACPI P-states driver to manage CPU frequency and clocks with > > switching only in 3 P-states. AMD P-States is to replace the ACPI > > P-states controls, allows a flexible, low-latency interface for the > > Linux kernel to directly communicate the performance hints to hardware. > > > > This patch seems like it is just enabling CPPC on AMD and not a new mechanism > based on CPPC. Can you clarify? > > Also, if this is just enabling CPPC, shouldn't the driver be named something > like amd_cppc and not amd_pstate? This isn't using P-states. That's just a name. We use the "amd-pstate" to indicate the new driver that use the kernel governors such as schedutil and others for frequency control. And "amd_cppc" indicates the legacy solution with userspace tool for frequency control. > > > "amd-pstate" leverages the Linux kernel governors such as *schedutil*, > > *ondemand*, etc. to manage the performance hints which are provided by CPPC > > hardware functionality. The first version for amd-pstate is to support one > > of the Zen3 processors, and we will support more in future after we verify > > the hardware and SBIOS functionalities. > > > > There are two types of hardware implementations for amd-pstate: one is full > > MSR support and another is shared memory support. It can use > > X86_FEATURE_AMD_CPPC_EXT feature flag to distinguish the different types. > > > > Looking at the drivers/acpi code for CPPC I don't think this distinction > between MSRs and shared memory requires a feature flag. Shouldn't this be > handled properly in cpc_read|write if the ACPI tables are set up correctly? > Please correct me if I'm wrong. MSR registers can be used for implementing the fast switch function which has the better performance on schedutil and other governors. > > This would also remove the need for the additional indirection pointed > out by Peter. > > Could you also provide an explanation as to why a new CPPC driver is need > instead of updating the existing cppc_cpufreq driver. > Good question, I had explained these in last mail with Peter. Thanks, Ray