Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp604695imd; Thu, 1 Nov 2018 02:33:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5fsezcMuW0sgNnaXy63LaXRlzJg4/M+OjHTxkUzHBT4Qjm+ac4ubZgHNMUYhyBmG94kFUhX X-Received: by 2002:a63:4e18:: with SMTP id c24-v6mr6456761pgb.6.1541064807728; Thu, 01 Nov 2018 02:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541064807; cv=none; d=google.com; s=arc-20160816; b=BcEugNmHQMR/gm+PcLP0R8R98CwuCR1a9xGuCB8CZty+TbAt93qvk9VSqL0dZuKjIF UnQkaoXcn0X4M2Xn20+tiIdDAV39mUPKv4WYPNDLF7ofn+crymYTMRCbXpK4Z+thQxqi OKFnbwRNeBuasa2FblPYZQQTa6tmTTbJdHrJUmTVSazdBUeP0K0eGnZM0WElBes9A8qf 0fNxG4KkAPnL0YMGQoTH7qTGJZpmQb+i3w41bx/iJxiwP28xr9X2Kd8ezHMNNODx96Wl fXVJEM42xKqkKVF806n5YQ11OsmRPASb/3Hr0NApV2UGBWJnh/2MyDNFR+VXWCAtMek4 GsuQ== 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:subject:cc:to:from:date:message-id :mime-version:dkim-signature; bh=ZasPdyyfMaoTYYtoXzlqo83MGm65M1bUrdZ9blzatFc=; b=Hf4a0pbfclcy+RpGPkhG7q8AKDgU7L78UWrx1NDAzp/H4bDjE7VYujz2+9EnXUBc/B kRE9vsFIZL5l6sREBggzo6ylfldBQ5Mg0+GRIvGrQp9HLBaWbeKXa+21BbrUFWeJ1cPA IRBCKViICN+acem51BjgjSo+B+uZwGTNhHQp8kUOQScNSeEVUKBR5fpaa8kJNAqdw/ds MlW5OfPQfUpCIGTm4LiTomR00Cf6tbGlSJKBtCCkc0/I9ayNBzhJ8gVdhXK9lCK/OaBn xrMpvdOrRQFyrA6ySO8423+Z9sKdcuKpXM/cLeWGlZwT75P/koJebmdCYpBwHEPwy1sj yNGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=256f6ybc; 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 o131-v6si29922236pgo.591.2018.11.01.02.33.12; Thu, 01 Nov 2018 02:33:27 -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=256f6ybc; 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 S1728016AbeKASee (ORCPT + 99 others); Thu, 1 Nov 2018 14:34:34 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55824 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727608AbeKASee (ORCPT ); Thu, 1 Nov 2018 14:34:34 -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 wA19NcgU034818; Thu, 1 Nov 2018 09:31:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : to : cc : subject : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=ZasPdyyfMaoTYYtoXzlqo83MGm65M1bUrdZ9blzatFc=; b=256f6ybc/222rhjTXiN1CLpReMR9CkmxnIkYQhEjLuuigJBz4AqmlkHjooN4oL5dKgX1 CFTi43c51Lws4Lgci02HwekuhpjFtzPgLga/0rCPAcEZsl9o7bZ5rWtx12YyU9SI1dbl FE/4UQ5qhBSs1bXORDHvIt7e6/NZfYOKSD1d2q4hCRnrCtTCRmJWSJ9d0xjk7gk307/3 re7LbeF3WvKsisKNBUY+Isuh6NZ8C/Sz0uIxO1QB+det/kJ+nLcMejBt4gh1Z+5EZwNR ifor/60m2Uz1bFEZbwFwT8PiXUw39xgD6I4gCfpi0kvzwKIcJ1tMpa/9iWjCVbT4pF/z jA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2ncfyq7tmn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 01 Nov 2018 09:31:48 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA19Vl8g029885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 1 Nov 2018 09:31:48 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wA19Vlt4029491; Thu, 1 Nov 2018 09:31:47 GMT MIME-Version: 1.0 Message-ID: <0eb95f39-583d-498d-a7a6-829519e251e2@default> Date: Thu, 1 Nov 2018 02:31:46 -0700 (PDT) From: Zhenzhong Duan To: Cc: , , , , , , , Subject: [PATCH v2 2/2] retpolines: Remove minimal stuff in retpoline support X-Mailer: Zimbra on Oracle Beehive Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9063 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811010083 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that CONFIG_RETPOLINE hard depends on compiler support, there is no reason for minimal stuff to still exist. This change is based on suggestion in https://lkml.org/lkml/2018/9/18/1016 Signed-off-by: Zhenzhong Duan Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Borislav Petkov Cc: David Woodhouse Cc: H. Peter Anvin Cc: Ingo Molnar Cc: Konrad Rzeszutek Wilk --- arch/x86/include/asm/nospec-branch.h | 2 -- arch/x86/kernel/cpu/bugs.c | 13 ++----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/no= spec-branch.h index 8b09cbb..c202a64 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -221,8 +221,6 @@ /* The Spectre V2 mitigation variants */ enum spectre_v2_mitigation { =09SPECTRE_V2_NONE, -=09SPECTRE_V2_RETPOLINE_MINIMAL, -=09SPECTRE_V2_RETPOLINE_MINIMAL_AMD, =09SPECTRE_V2_RETPOLINE_GENERIC, =09SPECTRE_V2_RETPOLINE_AMD, =09SPECTRE_V2_IBRS_ENHANCED, diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d0108fb..7f6d815 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd { =20 static const char *spectre_v2_strings[] =3D { =09[SPECTRE_V2_NONE]=09=09=09=3D "Vulnerable", -=09[SPECTRE_V2_RETPOLINE_MINIMAL]=09=09=3D "Vulnerable: Minimal generic AS= M retpoline", -=09[SPECTRE_V2_RETPOLINE_MINIMAL_AMD]=09=3D "Vulnerable: Minimal AMD ASM r= etpoline", =09[SPECTRE_V2_RETPOLINE_GENERIC]=09=09=3D "Mitigation: Full generic retpo= line", =09[SPECTRE_V2_RETPOLINE_AMD]=09=09=3D "Mitigation: Full AMD retpoline", =09[SPECTRE_V2_IBRS_ENHANCED]=09=09=3D "Mitigation: Enhanced IBRS", @@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *r= eason) =09=09pr_info("%s selected on command line.\n", reason); } =20 -static inline bool retp_compiler(void) -{ -=09return __is_defined(CONFIG_RETPOLINE); -} - static inline bool match_option(const char *arg, int arglen, const char *o= pt) { =09int len =3D strlen(opt); @@ -417,14 +410,12 @@ static void __init spectre_v2_select_mitigation(void) =09=09=09pr_err("Spectre mitigation: LFENCE not serializing, switching to = generic retpoline\n"); =09=09=09goto retpoline_generic; =09=09} -=09=09mode =3D retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD : -=09=09=09=09=09 SPECTRE_V2_RETPOLINE_MINIMAL_AMD; +=09=09mode =3D SPECTRE_V2_RETPOLINE_AMD; =09=09setup_force_cpu_cap(X86_FEATURE_RETPOLINE_AMD); =09=09setup_force_cpu_cap(X86_FEATURE_RETPOLINE); =09} else { =09retpoline_generic: -=09=09mode =3D retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC : -=09=09=09=09=09 SPECTRE_V2_RETPOLINE_MINIMAL; +=09=09mode =3D SPECTRE_V2_RETPOLINE_GENERIC; =09=09setup_force_cpu_cap(X86_FEATURE_RETPOLINE); =09} =20 --=20 1.8.3.1