Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp10047imm; Tue, 17 Jul 2018 19:28:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe3oVfpanJkpEUGZhE8v2T4yjoTefPiQTIY1qw11HohgBiIFLfy1uwRk1n/rsDWV1m+EDWn X-Received: by 2002:a17:902:7b87:: with SMTP id w7-v6mr4019008pll.142.1531880891009; Tue, 17 Jul 2018 19:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531880890; cv=none; d=google.com; s=arc-20160816; b=LVJPwR0v2Y6OfdQkyQKyGghSCrwGJQtTSQM1ROwJs/m5g/87cWB7T88dTJBFerZsVK pzS5ueB17UJ81mNQf/jMtZ355Eb4qmmSDlGCaP5giDo0Q9oC3DvGqlvjQ5TYjOLh6akG kCD+Xt2DOg1vQ7C8BBHfc3RB3J4BiOyezEwzfoTrxaN4vUD3nfpzHlA5Uw2Maohm/i+4 Je1/KSl0gSOQKuNAxri61d5W3bIC09tftk6uaI3TBls9RE7poQaIA6uVsPrYQyoi5GPm FTquvuvys0HBLpQ+Ehcix4oH5lhGnwlFSx9HGz75/6NQQ9QeuUHVIlGYZc4lxxeCfDzx EAyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:arc-authentication-results; bh=KIc2q7BCkp3E2/GG6EsGHTnVhfILanH2549gIYVBqmw=; b=zjFaoKz6+x8+bSD5VswI+ddnvq+OOsYM9al0of3kXPSfwpr+vcPWQKT6jDd7wkqEvH kY0cKM9fjDwB1S7A6Gx7mUiL42Nc4z9TXmEKOZKq25gHOjS1gP+wKjSNJWJ2fYeMFTmD Oo8zAql1Nq4+u0YuT17LFwxNdd4LjB/KDzk7woNJv1VO5iFi2dAun3ywEJCiHWfk6gNh ujbtdX/FpJtdQVrm0odODk9QD6oDfHjzzfQjTZm54CSgYBoTBqUGXrMSXWMqsbgPwm6U /aETxaWKIel/4+iPF5tusgI5ETlVCD59gM5nDZkALsTKH/z8RmXvGM10H92pkLztHIB/ bPLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=olJ0UCNy; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v5-v6si2312888plg.348.2018.07.17.19.27.56; Tue, 17 Jul 2018 19:28:10 -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=@oracle.com header.s=corp-2018-07-02 header.b=olJ0UCNy; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731752AbeGRC7h (ORCPT + 99 others); Tue, 17 Jul 2018 22:59:37 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42380 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731235AbeGRC7g (ORCPT ); Tue, 17 Jul 2018 22:59:36 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w6I2JKiB006865; Wed, 18 Jul 2018 02:22:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=KIc2q7BCkp3E2/GG6EsGHTnVhfILanH2549gIYVBqmw=; b=olJ0UCNyws7Jor9v/CNxBTgwZzteOR9X7KUyMpn/2lYZNCqgCf3x7b+BjqU/BHCs6e4u rWG0uVbGc/bk0lZYnn0x/AWt9r3LPL1BjJOEHt5bE+AuvaygIdIUpjsH5V7/iYTUCGWJ yqxrwwxGXJNEBCGcHBX6Wenoh1JIRqXClWFCwRPCv9zQ6nUVXImus3/bqE8XdK43LyFP L64pVQRjTmkdUiwf8a6X20eJ6V6FSal69sSfereTuVjWOR/1M+/vBm9ZBbXXmTdS6LWt qYC6lEPFUcNt9MfuEjV50phPigHgtr8Ww4Hhm89s5QxL5a+4I/MAqQ0s4GX7DgaRTjkP QA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2k7a3432sj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:22:48 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w6I2MkOB023922 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jul 2018 02:22:47 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w6I2MkRP015928; Wed, 18 Jul 2018 02:22:46 GMT Received: from localhost.localdomain (/73.69.118.222) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 17 Jul 2018 19:22:46 -0700 From: Pavel Tatashin To: steven.sistare@oracle.com, daniel.m.jordan@oracle.com, linux@armlinux.org.uk, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, john.stultz@linaro.org, sboyd@codeaurora.org, x86@kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, douly.fnst@cn.fujitsu.com, peterz@infradead.org, prarit@redhat.com, feng.tang@intel.com, pmladek@suse.com, gnomes@lxorguk.ukuu.org.uk, linux-s390@vger.kernel.org, pasha.tatashin@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, pbonzini@redhat.com Subject: [PATCH v14 11/25] x86/CPU: Call detect_nopl() only on the BSP Date: Tue, 17 Jul 2018 22:21:57 -0400 Message-Id: <20180718022211.6259-12-pasha.tatashin@oracle.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180718022211.6259-1-pasha.tatashin@oracle.com> References: <20180718022211.6259-1-pasha.tatashin@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8957 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=834 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807180026 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Borislav Petkov 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 keep the mess at a manageable level. Signed-off-by: Borislav Petkov Signed-off-by: Pavel Tatashin --- 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); /* -- 2.18.0