Received: by 2002:a17:90a:c8b:0:0:0:0 with SMTP id v11csp2302821pja; Fri, 19 Apr 2019 11:36:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxHxoBOJZK17Y8v0xa+Z0PoZywoEd7ldQ9u1dSfhD0iEI6QkxnlWsEsDNJyjKAtp3AW37x X-Received: by 2002:aa7:8e0d:: with SMTP id c13mr5606275pfr.193.1555698992918; Fri, 19 Apr 2019 11:36:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555698992; cv=none; d=google.com; s=arc-20160816; b=aG+0aY5EMJ6xb0nI7IodgQJaAYu4mXzfhkEinOjo8IsZZoa6yi31bcr17NrXf49WVw kNkUNUmDf9vBuCqVVqoP5ZoHULfEj4oKFdwkoE0BZNJsmxqUXMsjzHsVptK2ORccDw/4 LQUdrHL1kihZewLe4tJlSoYFYUmYZy4LW+h+k3hO4DydP8FVTrKlpNwZjg3BVw4lSJPQ 3w4YbKDa5wdHVjrtboG1IbxM0mYEtGEeHEMeDJb5XEjkig4Z8ICnrJ9sH9DXQ1K7Ki+F IC1U+2x/sWd+TdUE39oLvH2B69r21WoUEcsDMPmwz/Aj9BVKWbCji/kYd2pGCr7342s4 PzSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=HkLN3uLvaQusWAtPoOKgQckjhX+Fo28CPjJvGY72Owk=; b=NVVDLsJS17EcSXGzFtMBao+mu/f8zad0B6ja7gDQwNyEQpHhqErIv34qsCTStB5xu3 zP8F+T5gKToOoXSAyv7G+6XuxoEiyWE4XkVhLiT8XXu1tN30P6o/9uWPq1NL5X4tgguX gmFzeHe6WQkwf0Sc5DdkfOrpyXWjQXGnIOTrw1uyQQwj3KKe1BoGlTpaE7Nq4zBkhZvn 4j1vkWhsdxtXONqNMyFb2jNZLiQVEDn/lk+zdeXUjMQ5UjkUeke6MYKeruuSPpY6iZvT yQf0CXKO0e3jIsWn/bhvtAbOZdeZrbUKGyXW7oLfSaIMDc+cbdj2GxO07PWU/R0BaHPB i03A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=w4FKdiYK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si6114120pfc.92.2019.04.19.11.36.18; Fri, 19 Apr 2019 11:36:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=w4FKdiYK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728209AbfDSSeo (ORCPT + 99 others); Fri, 19 Apr 2019 14:34:44 -0400 Received: from terminus.zytor.com ([198.137.202.136]:59213 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727349AbfDSSel (ORCPT ); Fri, 19 Apr 2019 14:34:41 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3JIYHDc384135 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 19 Apr 2019 11:34:17 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3JIYHDc384135 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1555698857; bh=HkLN3uLvaQusWAtPoOKgQckjhX+Fo28CPjJvGY72Owk=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=w4FKdiYKWXXESRb88ojtbGXL3C5OhR+VwY96iPC4ZHFWSwgKNct65L4T8Xevnxbzt 65Gectxr6Cc/EwKyb4mDE9fLJo7hAtsWTkeJcp6lh4JnskdpA3Fih5GmmuKyysXAY9 mTOhR6XxJ9rhezl6IxBzytzwZVcQTayhuifVVZbLvij6cse9uOnkZxeSkHUIHGimky pbHEDPvHEcB+ioFUOof9c3Ys2XVhsaxbe1rWIuwV/UGnTqurV1crZOAOypuEGvLD49 +XwKem4kOti5cdjB1xbOwwSx4HoHwEZ+0KQXGsNvp7zFVGPsiajtaa0pfB3UQMJg20 8yH84VmXwtTUA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3JIYFJX384132; Fri, 19 Apr 2019 11:34:15 -0700 Date: Fri, 19 Apr 2019 11:34:15 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for David Wang Message-ID: Cc: peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, pavel@ucw.cz, davidwang@zhaoxin.com Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, pavel@ucw.cz, davidwang@zhaoxin.com, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <1545900110-2757-1-git-send-email-davidwang@zhaoxin.com> References: <1545900110-2757-1-git-send-email-davidwang@zhaoxin.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/power: Optimize C3 entry on Centaur CPUs Git-Commit-ID: 987ddbe4870b53623d76ac64044c55a13e368113 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=0.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_12_24,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 987ddbe4870b53623d76ac64044c55a13e368113 Gitweb: https://git.kernel.org/tip/987ddbe4870b53623d76ac64044c55a13e368113 Author: David Wang AuthorDate: Thu, 27 Dec 2018 16:41:50 +0800 Committer: Ingo Molnar CommitDate: Fri, 19 Apr 2019 19:28:06 +0200 x86/power: Optimize C3 entry on Centaur CPUs For new Centaur CPUs the ucode will take care of the preservation of cache coherence between CPU cores in C-states regardless of how deep the C-states are. So, it is not necessary to flush the caches in software befor entering C3. This useless operation will cause performance drop for the cores which share some caches with the idling core. Signed-off-by: David Wang Reviewed-by: Thomas Gleixner Acked-by: Pavel Machek Cc: Linus Torvalds Cc: Peter Zijlstra Cc: brucechang@via-alliance.com Cc: cooperyan@zhaoxin.com Cc: len.brown@intel.com Cc: linux-pm@kernel.org Cc: qiyuanwang@zhaoxin.com Cc: rjw@rjwysocki.net Cc: timguo@zhaoxin.com Link: http://lkml.kernel.org/r/1545900110-2757-1-git-send-email-davidwang@zhaoxin.com [ Tidy up the comment. ] Signed-off-by: Ingo Molnar --- arch/x86/kernel/acpi/cstate.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 158ad1483c43..cb6e076a6d39 100644 --- a/arch/x86/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c @@ -51,6 +51,18 @@ 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; + } } EXPORT_SYMBOL(acpi_processor_power_init_bm_check);