Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2208843imm; Thu, 19 Jul 2018 15:27:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdZ9UR7Y1V9cJ8M25xCVuEUvj2vuPk2lv+Tmp7NoiPAwi9sr9cIE/SZueCLrYATbNeU5jAN X-Received: by 2002:a17:902:20c2:: with SMTP id v2-v6mr4237488plg.22.1532039275002; Thu, 19 Jul 2018 15:27:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532039274; cv=none; d=google.com; s=arc-20160816; b=g08CQ/c01Wc7iiCu6w2VhX28A92gNXXUxt2EnRlxqo8SkmxBFTP45DEMrQnPQkeGQy KdUQLv5bmfJNjOPvc5HJQ5NZcHhDAZWeD8JkDUGtS3j7hsl6lXjQhGimtqFg+BRj8C3Z URIn1P47pqParQ1Gk4DmOEIWqmVG4sHi0ElMxhwzwnD9AMSkgDP3pA3qWLEGNv0+CDPc ozR9YLQEXDHHdiKKLyEbeRgjin6Bf909rz+0eQBL3bUTRdSrb5vpTApqyMJZwgPI126k OBubt78e+tZ2rbvym1KKISpg/WFLYdyD+KlhiYcv9x4I+KsQ6AGhErCv781JRnYTKHTz huqg== 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:arc-authentication-results; bh=PZUDN2Fx7FK7KXgtyMMh3b2TbH8raG7e9vCFXEHdblk=; b=N4KhtQM8x94cYyZ8V2uP8nGGWJjg3Fqxn/6NjH0BMCwzKZ1VGpCEYrKjnGo7dubeUE YqKR0wf4VgCl2LRjf1VYs+jiXnSAJDRu6V9/WajSq1cOj48cID0aVnvbF//ECbOIePBK 0Kvj/2/9XJ+6fik6YdLj97FQDzbi36kGeez7Sj1rIERe/vuJJUwuNLrvklyrVM+QwVeB krPUm1T2d1evA3i9vHOr3s9EFcu7s9fn/9FXnPkOPUzAVtaESO5Gvz4EO6BBHcw+f0hc nlLkKJrRjrhwh5P2oW2FnwnQQSNjk+B4OyDxT1sYjFGy39eZObeiNeJK+S1BOcfwld2E NYOg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si298286pgk.135.2018.07.19.15.27.40; Thu, 19 Jul 2018 15:27:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731374AbeGSXMH (ORCPT + 99 others); Thu, 19 Jul 2018 19:12:07 -0400 Received: from terminus.zytor.com ([198.137.202.136]:36139 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727772AbeGSXMH (ORCPT ); Thu, 19 Jul 2018 19:12:07 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w6JMQiJa2438908 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 19 Jul 2018 15:26:44 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w6JMQhre2438905; Thu, 19 Jul 2018 15:26:43 -0700 Date: Thu, 19 Jul 2018 15:26:43 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Borislav Petkov Message-ID: Cc: tglx@linutronix.de, bp@alien8.de, linux-kernel@vger.kernel.org, bp@suse.de, pasha.tatashin@oracle.com, mingo@kernel.org, hpa@zytor.com Reply-To: bp@suse.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@alien8.de, hpa@zytor.com, mingo@kernel.org, pasha.tatashin@oracle.com In-Reply-To: <20180719205545.16512-11-pasha.tatashin@oracle.com> References: <20180719205545.16512-11-pasha.tatashin@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/timers] x86/CPU: Call detect_nopl() only on the BSP Git-Commit-ID: 9b3661cd7e5400689ed168a7275e75af333177e6 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=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) 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: 9b3661cd7e5400689ed168a7275e75af333177e6 Gitweb: https://git.kernel.org/tip/9b3661cd7e5400689ed168a7275e75af333177e6 Author: Borislav Petkov AuthorDate: Thu, 19 Jul 2018 16:55:29 -0400 Committer: Thomas Gleixner CommitDate: Fri, 20 Jul 2018 00:02:39 +0200 x86/CPU: Call detect_nopl() only on the BSP Make it use the setup_* variants and have it be called only on the BSP and drop the call in generic_identify() - X86_FEATURE_NOPL will be replicated to the APs through the forced caps. Helps to keep the mess at a manageable level. Signed-off-by: Borislav Petkov Signed-off-by: Pavel Tatashin Signed-off-by: Thomas Gleixner Cc: steven.sistare@oracle.com Cc: daniel.m.jordan@oracle.com Cc: linux@armlinux.org.uk Cc: schwidefsky@de.ibm.com Cc: heiko.carstens@de.ibm.com Cc: john.stultz@linaro.org Cc: sboyd@codeaurora.org Cc: hpa@zytor.com Cc: douly.fnst@cn.fujitsu.com Cc: peterz@infradead.org Cc: prarit@redhat.com Cc: feng.tang@intel.com Cc: pmladek@suse.com Cc: gnomes@lxorguk.ukuu.org.uk Cc: linux-s390@vger.kernel.org Cc: boris.ostrovsky@oracle.com Cc: jgross@suse.com Cc: pbonzini@redhat.com Link: https://lkml.kernel.org/r/20180719205545.16512-11-pasha.tatashin@oracle.com --- arch/x86/kernel/cpu/common.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 71281ac43b15..46408a8cdf62 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1024,12 +1024,12 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c) * unless we can find a reliable way to detect all the broken cases. * Enable it explicitly on 64-bit for non-constant inputs of cpu_has(). */ -static void detect_nopl(struct cpuinfo_x86 *c) +static void detect_nopl(void) { #ifdef CONFIG_X86_32 - clear_cpu_cap(c, X86_FEATURE_NOPL); + setup_clear_cpu_cap(X86_FEATURE_NOPL); #else - set_cpu_cap(c, X86_FEATURE_NOPL); + setup_force_cpu_cap(X86_FEATURE_NOPL); #endif } @@ -1108,7 +1108,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) if (!pgtable_l5_enabled()) setup_clear_cpu_cap(X86_FEATURE_LA57); - detect_nopl(c); + detect_nopl(); } void __init early_cpu_init(void) @@ -1206,8 +1206,6 @@ static void generic_identify(struct cpuinfo_x86 *c) get_model_name(c); /* Default name */ - detect_nopl(c); - detect_null_seg_behavior(c); /*