Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1864086imd; Fri, 2 Nov 2018 01:47:36 -0700 (PDT) X-Google-Smtp-Source: AJdET5dn9ofqcmHDMu2dqtyju0a0zBntlGk7XISrQbf8YD/tFQ7fNvEDEElnAxqEeDy/0d65/nk8 X-Received: by 2002:a17:902:b401:: with SMTP id x1-v6mr5821418plr.237.1541148456708; Fri, 02 Nov 2018 01:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541148456; cv=none; d=google.com; s=arc-20160816; b=TVxbz3VstOQCtnZCVKIoLZdcCcbZR8oOlV/nJEWypNGoYApWkOiaWormRUgDAjIOdH JNxsxxOJA2C72+4mZhNhBfTNH9Ao37A1U79FTfDo/AqyKj9kWDUObicK0P6Yjxz6WLgh ug4XlYDvfR50JRUFgGMUEODvyMyVI5vRtLqEi/A+t1kpdlB/DbelFYznRDQr4uGx1dia LfehWUgpPEzaZZAaUr7rHMM7itJ53UuFkiXD2IrfMfyeFx9SZQg+jH00pcuEZnhExlWE EWFUTgkcIL0DtunrN0bzzLc9p1nQn0eSo3GLc2QfSmPkbWA06UspRUx4qKxqZ8yoKrAx R3Ow== 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=G7Ysa3cM3JSt/Fyo2Pa7i0crLwbSmXhLMPSBp3Lxcz8=; b=i9GlehZ8zzWZb9OPzuvxRw+nvwkhbnorPQBGSxrBT9HHVMn2ASk8tgu6hCCHO/KkeZ 6klcjJTeUauwbtb+uSvdvw3NUayvKyuoCg+cC4kSi7YJKUAfOEcCkoFviOXQINtRZ3Qn X+sGHMeC2bzYPnCl2fImWxdFKJgUJ6J28rE6npF6rutrd+ziaqJxQJDEb06BOXIoAbrj Fwn4HOaiCYm11Be9hKb1IjGrIbyyB+sHW/V5IYlhm3psZL5HnnoYDf/sju1x7OVuF0mU 7LRH7Q6mCFXYruPIHD/yRyeA/gwsvxUGgjx+PmU2KXfiGxunQvJqceuYYP3toVIqA8i3 wMiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=hWkmEbZf; 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 k7si3585206pgm.462.2018.11.02.01.47.21; Fri, 02 Nov 2018 01:47:36 -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=hWkmEbZf; 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 S1726469AbeKBRwp (ORCPT + 99 others); Fri, 2 Nov 2018 13:52:45 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33878 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbeKBRwo (ORCPT ); Fri, 2 Nov 2018 13:52:44 -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 wA28jMLS133787; Fri, 2 Nov 2018 08:45:43 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=G7Ysa3cM3JSt/Fyo2Pa7i0crLwbSmXhLMPSBp3Lxcz8=; b=hWkmEbZfB0FvUYgNy9SZ3LSbjH5ULBoivZcT2FHit7BYc0XhjdJ8EMjQUY0miSJspPlv y+gT+i9hCsSIQuIiB+Er9Ple+ii8NQTkYPkFc94+m2qpTdPMSf4Q/1a/OrVOyh1enZFH Jp7l3J8w40NUxAY/wutWVEXLmhTIAZX+Xt1/qtQwyrQB7mL3UAgVI+T89+iiPPFTVW9A EhRBG63CbDzZkaI5au43kzSGHQMjktjXgyBhtr3D3HP6bKfKb1s1mW8c42y0zBkkqkzb SlpL5GTaL46lHrd1foH31VSwu0RFpPpsACRKPjuN69FYsE38ILWn/aW9A+qsXdFuOL0C 6A== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2ncfyqd8tb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Nov 2018 08:45:43 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id wA28jg5n022247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 2 Nov 2018 08:45:42 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id wA28jg8F022765; Fri, 2 Nov 2018 08:45:42 GMT MIME-Version: 1.0 Message-ID: Date: Fri, 2 Nov 2018 01:45:41 -0700 (PDT) From: Zhenzhong Duan To: Cc: , , , , , , , Subject: [PATCH v3 2/2] 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=9064 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-1811020083 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. [peterz@infradead.org: initial suggestion] Link: Link: https://lore.kernel.org/lkml/caeb3213f13e57191e362ca04f2892cfa2= ccda65.camel@infradead.org Signed-off-by: Zhenzhong Duan Suggested-by: Peter Zijlstra Cc: David Woodhouse Cc: Thomas Gleixner Cc: Borislav Petkov 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