Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1122474rwb; Thu, 10 Nov 2022 11:27:29 -0800 (PST) X-Google-Smtp-Source: AMsMyM62MUlyHt0/zhDSi+kNeYAkEK4ySkG20w7Uz141Z/7qaHJrVX4MWwH2NqOgZKQA+MiYMYUx X-Received: by 2002:a17:903:494:b0:187:a14:56bd with SMTP id jj20-20020a170903049400b001870a1456bdmr66172981plb.131.1668108449710; Thu, 10 Nov 2022 11:27:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668108449; cv=none; d=google.com; s=arc-20160816; b=I46NPQJqcfO7gIUbTkMVV7xlI5oEy99R/vieU8kesgvyM/KhpimlkOTlMp5ZDpt4k7 ve+e3PIU0YIs0BZbrHeCTaE9htN+IbCiwQZF7AqL9iae4UEFpLvPoiBKfZfCCowAAsRV q5Eghi0WEj6EpMT38ObgltXy0l4EaUm6GC+IX0avbaW9tuagMbedvrYZ3HZ6/g4uYeFN 4vRNqApD+toBgjG7K964HNdXPf/anOoLtRivBLfn7VFuubAvT+q+pHS3ewUfW35Xjsxm cdC+FZKIw2eteqqF2oXSCgmZvcfTCsuhmYnI7pf1rAfuyv7gNA9XD7uHI3mKxTtNzg6g 0J3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=+YBGKTfu6TLq6OsvTGJR+t71TVt0vJcs9iDhz7OHA1o=; b=HmnPXTGMLltiMyWw8v0Cx2Ix2iAgVbkFJOpWgKHYIV6y1DFe/J/Jr7nt3fyW8h4QcK Hptn5licXShBCSEWKrAK4jm8wfptojpFZB2fjqDCXaVvN2sqpMp0kmuSK2sc+MLWFo8c wNm8w/goCgONgHjNyur3htfAwyaOHGmf2BnbNHHfQtH9T4YbAPzmB5XvNxFTuZdcJLqA YLQaM7z5qRw+zIkNm76nskvJ2mni5Zi1MfNzo2FgKCl7eKZKosBUCPw8UPIqInJROVK/ Oy/MbrBAsj1M0fMmPPnyR2LvL0Il3+LMvjssaDZDbn0eVdQ/NOwYLvmZClchIpiw4v8I ET8A== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a630f01000000b004703fc2ac54si21656886pgl.822.2022.11.10.11.27.17; Thu, 10 Nov 2022 11:27:29 -0800 (PST) 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229528AbiKJTUe (ORCPT + 92 others); Thu, 10 Nov 2022 14:20:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbiKJTUc (ORCPT ); Thu, 10 Nov 2022 14:20:32 -0500 Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E642E0FA; Thu, 10 Nov 2022 11:20:31 -0800 (PST) Received: by mail-qv1-f48.google.com with SMTP id c8so2082624qvn.10; Thu, 10 Nov 2022 11:20:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+YBGKTfu6TLq6OsvTGJR+t71TVt0vJcs9iDhz7OHA1o=; b=h/TnhlQit3+0usG12PwpjxiOc/IYbJ4ADi73QrZbk1W3sLJJd+2DxuuHf4S/w2DbNA 8eqUI+lPEzIsAEJJEr72Qtr72A9BmYmgSTvGXOpkUiFnhmFOGIDNj42vpbTlRElsJDo8 ZC2WfCUjqe+QrTGcLmd0j5+asYKVvM5WlX51oceakKqQZ5jMkKC/kMoDUL+Dwpwg1ETM hsJMRVJa9FUoGuY7wwJhN/zyO5ALWgetMzBiuPa/MrAd05BPyUxdqoFRbdk/jFZ+L8wE KOmhOjcjluO4pMbGG0dTLV8DeOtuFtdYsZ3Lwk7WKPKQcejwRjH1EmTDbYWkLfZLv8Wa xLIw== X-Gm-Message-State: ACrzQf1v9gOQUj3Rl6/DvY7GVS1qzgDFQJcmFAgWukCG0NJ2okcEo3fB XnAbyN6fYH6qP9JrZRTEKmNcAQnkKrL+e/udBvYgjWS1 X-Received: by 2002:a05:6214:4517:b0:4b1:a9ac:21de with SMTP id oo23-20020a056214451700b004b1a9ac21demr1706384qvb.119.1668108030271; Thu, 10 Nov 2022 11:20:30 -0800 (PST) MIME-Version: 1.0 References: <1667792089-4904-1-git-send-email-TonyWWang-oc@zhaoxin.com> In-Reply-To: <1667792089-4904-1-git-send-email-TonyWWang-oc@zhaoxin.com> From: "Rafael J. Wysocki" Date: Thu, 10 Nov 2022 20:20:19 +0100 Message-ID: Subject: Re: [PATCH v2] x86/acpi/cstate: Optimize ARB_DISABLE on Centaur CPUs To: Tony W Wang-oc Cc: rafael@kernel.org, len.brown@intel.com, pavel@ucw.cz, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, CobeChen@zhaoxin.com, TimGuo@zhaoxin.com, LindaChai@zhaoxin.com, LeoLiu@zhaoxin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 On Mon, Nov 7, 2022 at 4:35 AM Tony W Wang-oc wrote: > > On all recent Centaur platforms, ARB_DISABLE is handled by PMU > automatically while entering C3 type state. No need for OS to > issue the ARB_DISABLE, so set bm_control to zero to indicate that. > > Signed-off-by: Tony W Wang-oc Acked-by: Rafael J. Wysocki Or x86 maintainers please let me know if you want me to take care of this. Thanks! > --- > Changes in V2: > - fix typo in comments. > --- > arch/x86/kernel/acpi/cstate.c | 26 +++++++++++++++++--------- > 1 file changed, 17 insertions(+), 9 deletions(-) > > diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c > index 7945eae..da71679 100644 > --- a/arch/x86/kernel/acpi/cstate.c > +++ b/arch/x86/kernel/acpi/cstate.c > @@ -52,17 +52,25 @@ void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags, > if (c->x86_vendor == X86_VENDOR_INTEL && > (c->x86 > 0xf || (c->x86 == 6 && c->x86_model >= 0x0f))) > flags->bm_control = 0; > - /* > - * For all recent Centaur CPUs, the ucode will make sure that each > - * core can keep cache coherence with each other while entering C3 > - * type state. So, set bm_check to 1 to indicate that the kernel > - * doesn't need to execute a cache flush operation (WBINVD) when > - * entering C3 type state. > - */ > + > if (c->x86_vendor == X86_VENDOR_CENTAUR) { > if (c->x86 > 6 || (c->x86 == 6 && c->x86_model == 0x0f && > - c->x86_stepping >= 0x0e)) > - flags->bm_check = 1; > + c->x86_stepping >= 0x0e)) { > + /* > + * For all recent Centaur CPUs, the ucode will make sure that each > + * core can keep cache coherence with each other while entering C3 > + * type state. So, set bm_check to 1 to indicate that the kernel > + * doesn't need to execute a cache flush operation (WBINVD) when > + * entering C3 type state. > + */ > + flags->bm_check = 1; > + /* > + * For all recent Centaur platforms, ARB_DISABLE is a nop. > + * Set bm_control to zero to indicate that ARB_DISABLE is > + * not required while entering C3 type state. > + */ > + flags->bm_control = 0; > + } > } > > if (c->x86_vendor == X86_VENDOR_ZHAOXIN) { > -- > 2.7.4 >