Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4349749imd; Mon, 29 Oct 2018 23:56:35 -0700 (PDT) X-Google-Smtp-Source: AJdET5dZMIpNxT2rXry6/bs1cCZz1VG4ZpzA860DSSgt7UIp0ckFk9prokmNp/NoOIPUadNDZZLE X-Received: by 2002:a63:4e41:: with SMTP id o1mr14436818pgl.282.1540882595898; Mon, 29 Oct 2018 23:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540882595; cv=none; d=google.com; s=arc-20160816; b=jCkmDje7GAzH7sx6WTh4tNhejx+6XlXFJr2/arvFDNj6iNrLQNMvIz365YyOuODYna 8QulrUeYkcZ0fqxRhrm7wX1vrPqz+QysK1NaMQKL7euKeKwAM7L10j20Xsy4spgpY1dl ZoRWe25gLbQ3FcBTFoLxiCB2hRjvb01JTZOavgPaIznSwlg/6InKoWrv7Tu8wG1JzwOW ShJuP3V7jS0aHotZqxSBJRb9H1mgw750omCgw+UiyAYcGTrmNX1QejzwkK2xgBu9OIqC m7+KuCas/warW8SmKzYPnf1wRO6SRda5oGJDGLlO5YBt2CyICDU/hA4SQW9mPUElzd89 YfsQ== 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=bh7DpYvCpmUq0XINMD1CfccW8hstD8llaBULPDkPM/3j3MtHl4eh+ZjqY0L3Eb7jhq SK4mxg/pwkdSvfxHJK2p053xtZX61h/sDmFWxeUyDOlDUot+7quJwGVxmpN4U5mUga5Q wWgmgY+gakTikI/1pIBxq0FeIgu+Qeg0igWXVwhVHLEqigcKecM95+HqctjAE0h2OAE2 MQPT3lAbiIktoKLcD7+kD9IO4t2bg5onqmEoovq2i/2Jq95+UbEunY8TkvVAjKNLRfcX xiK/jjfFlolo0kNlfXienG/RgadYmw3rRjXsDlXCLu51WAUEZ6Bj7hhCMJtyjqsaD9sY Ntqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=WXAdPrM1; 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 u28si12090650pgn.436.2018.10.29.23.56.20; Mon, 29 Oct 2018 23:56:35 -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=WXAdPrM1; 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 S1727462AbeJ3Pr4 (ORCPT + 99 others); Tue, 30 Oct 2018 11:47:56 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:39122 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbeJ3Pr4 (ORCPT ); Tue, 30 Oct 2018 11:47:56 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9U6rja0064348; Tue, 30 Oct 2018 06:55:07 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=WXAdPrM1pAhiZ75Pktqa646VDuk//nIyrReuwtNQuvJorg647W/H8RgiL0e+eJGvV1ni 8E/L8qtaoPxjYDJ37WSHWJeruSLW7M6egJuAzSdQE7aRKfpkUfBLeh6hZImrYKgajqJJ R5GuPxODb4AHS69NeuEXjE/hShS3oDrosc3tBBqCf96zYEX2qj3/umyccT2f/b7tRJnw TOVBgrmplXqcUgGYPoXjg8l9iwjh9pGhkvjTw5ry3Y5c9XY9dqK1Cz+xoMlFj2YUZTVj VnpjiVNzqfrTHJkIgEfD81EikL/GQNtKgnmK2kDzlF17vM9liliJ7PjcFUM/+6TiobeJ 8g== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2ncgnqsxht-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Oct 2018 06:55:07 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9U6t7A1021281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Oct 2018 06:55:07 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9U6t6RZ030589; Tue, 30 Oct 2018 06:55:06 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 29 Oct 2018 23:55:06 -0700 (PDT) From: Zhenzhong Duan To: Linux-Kernel Cc: , , , , Srinivas REDDY Eeda , , , Subject: [PATCH 2/3] retpolines: Remove the minimal stuff of 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=9061 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-1810300060 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