Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp5363112iog; Wed, 22 Jun 2022 18:29:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v6wUjWqLIFX/9UmBvp43fOUTLKRJN1ZEEcMau3gMHdv1Mc9h08XvBdMKJbczMvsGstkwkB X-Received: by 2002:aa7:c9c9:0:b0:431:962f:f61e with SMTP id i9-20020aa7c9c9000000b00431962ff61emr7657023edt.189.1655947782958; Wed, 22 Jun 2022 18:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655947782; cv=none; d=google.com; s=arc-20160816; b=P0PYIDSiVu3Zcs/wVIjgt8Qpu2ugocACa2hbi/j5iO732Tb93CA+fq9ASKfG8mOs4y wZdtC4S+XM3KLcSg/tm1nvvdooNv7PEB8Sm2x/6+0KzX0ywQTJyuLSy7bOyqdV26ZsZl YqXsJeLTkG0YGSIi4uPg5xGMNcO8PvUWn6B+elZ6jNjpjdt9PYqdx3gI2xM6swKE5YAC b5AcxEZuFguRKl/Hp5cWx1vPUCulNdmIBhBYCnCbYU/Y4ZJ8jycO2qk+Y02Z4txqOAA2 FXijQaZGHBSrXYEB7iM1IRrmpGlrS3xtyBwDv8NDwotZz7U7kWZv1Z7MfSOK33x5Lj9g Symg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:user-agent:date:message-id:subject:from:to; bh=VCXqjmKDBNW0bsQva73c9znKhGoYFJbBfzdundPLn2I=; b=Ad+yy7F8I4u+WyrGyz47u1aFUHkAxTe7KEnLMS2ri+MKJYinq/dJf77YdVbuaei2/n GrACQiLuGavWQ5f8d8AwN5OGFVwjvOnWpp5uTvmsuLABXeQPp2ihF5ikenRUi/vjJwmG 36ok4MFI+/0JWFDx2pnRNwGrm6xEXon+axftFsG5KElVNBoSylmxDp6DRFOuoFmmzBpN kdFByqaLDKo+jbsjXWFVOeyYsGgsLh6z67mrsrbCpRXWsRJt+W3kFYXANYWIf5pChBeJ EWERSEnTtNOHjtKxQ1kVuIy4wntwunLXi3N4kvpAa27D9KFqnYjnInqrpxxf2LVHOi05 xi6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o16-20020a056402439000b004358b2b575csi10452044edc.477.2022.06.22.18.29.18; Wed, 22 Jun 2022 18:29:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235771AbiFWBVc (ORCPT + 99 others); Wed, 22 Jun 2022 21:21:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230093AbiFWBVb (ORCPT ); Wed, 22 Jun 2022 21:21:31 -0400 X-Greylist: delayed 648 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 22 Jun 2022 18:21:29 PDT Received: from ZXSHCAS2.zhaoxin.com (ZXSHCAS2.zhaoxin.com [210.0.225.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B6BF39B82; Wed, 22 Jun 2022 18:21:29 -0700 (PDT) Received: from zxbjmbx1.zhaoxin.com (10.29.252.163) by ZXSHCAS2.zhaoxin.com (10.28.252.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 09:21:27 +0800 Received: from [10.32.64.1] (10.32.64.1) by zxbjmbx1.zhaoxin.com (10.29.252.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Thu, 23 Jun 2022 09:21:25 +0800 To: "Rafael J. Wysocki" , Viresh Kumar , Linux PM , "Linux Kernel Mailing List" , , , , , "ACPI Devel Maling List" From: Tony W Wang-oc Subject: [PATCH V2] cpufreq: Add Zhaoxin/Centaur turbo boost control interface support Message-ID: Date: Thu, 23 Jun 2022 09:21:26 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.32.64.1] X-ClientProxiedBy: ZXSHCAS2.zhaoxin.com (10.28.252.162) To zxbjmbx1.zhaoxin.com (10.29.252.163) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recent Zhaoxin/Centaur CPUs support X86_FEATURE_IDA and the turbo boost can be dynamically enabled or disabled through MSR 0x1a0[38] in the same way as Intel. So add turbo boost control support for these CPUs too. Signed-off-by: Tony W Wang-oc --- drivers/cpufreq/acpi-cpufreq.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 3d514b8..1bb2b90 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c @@ -78,6 +78,8 @@ static bool boost_state(unsigned int cpu) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_INTEL: + case X86_VENDOR_CENTAUR: + case X86_VENDOR_ZHAOXIN: rdmsr_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &lo, &hi); msr = lo | ((u64)hi << 32); return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE); @@ -97,6 +99,8 @@ static int boost_set_msr(bool enable) switch (boot_cpu_data.x86_vendor) { case X86_VENDOR_INTEL: + case X86_VENDOR_CENTAUR: + case X86_VENDOR_ZHAOXIN: msr_addr = MSR_IA32_MISC_ENABLE; msr_mask = MSR_IA32_MISC_ENABLE_TURBO_DISABLE; break; -- 2.7.4