Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2335042imu; Tue, 6 Nov 2018 12:50:39 -0800 (PST) X-Google-Smtp-Source: AJdET5ek7ZX4HYSsMLK+io9t/dbOx58+vjUON3yTzmpptuuNGmYNKoRYkIXSgX0pzRh7eSADvfR4 X-Received: by 2002:a17:902:f83:: with SMTP id 3-v6mr28269568plz.254.1541537439751; Tue, 06 Nov 2018 12:50:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541537439; cv=none; d=google.com; s=arc-20160816; b=khL3sWT2uNTHuiYH/Lbrmi83uqWZ5I724vc8P9oDTWdS9fn9sW6QBvibi0zz1yqtqc t6ZifNBEGPXkxondmVjVViGF+Q81AuuSnlQG40tmZMW30jzjhJ3KnTrn/ISQMHQJ2sFp uTVG8H7Vj62Uq7N8Y7m2Q0vsXpZnEeCFIJ+WhfdrEuFk/sd2i8Bq7fmG++WiYcfVieZz L7UdknoxZox7xvVE4FZn9SKawNdwYiL5AYWTaqqjC9Ks379vx1manLpdUPgez+jh3YXt ff4Dx7pB1KkXyudhaiKw+FlChEmWZuMCmutnq+Y2NqoY0K4+MVUZDTcZjMrcHCzoHZ0A h7sQ== 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; bh=7Ah82yuIEMepeSZhiXSJu5BGqRVqnzIYEo4bqDb5Wag=; b=Lq/0AHfwytG3CkSNGCD7j3VT8KnqMjyzhZUHC/QB1Z8Pi3Q/JuX2GL0GCsU+IzE0ln MnVeCRvkAbsAcLa9BDphuzIgpXpzb25KfoAWDvyOPPqkmovDOEDzFphfUQ330uUrtE/I iqEqeIUR22DJrre+dhSi+q1WSyRWnsWrtOQjV3CnI8kRml+gW+cafRKS5h3BngkYPG8A 8Sp2XPABf2jS+aa0/UeWbj+V+iW/+d9SYjak7vqVGOoXMQskZInMXraAv1hbTmzDcyxk hYmYCglNV98LUEXpe2YgBFjW1mQhvOGgvzKNY7SHGZthFKF0UtKhbqAEUrEa5HqYPYsI rwIg== 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 a2si775945pgm.154.2018.11.06.12.50.24; Tue, 06 Nov 2018 12:50:39 -0800 (PST) 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 S1730824AbeKGGRA (ORCPT + 99 others); Wed, 7 Nov 2018 01:17:00 -0500 Received: from terminus.zytor.com ([198.137.202.136]:37041 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbeKGGQ7 (ORCPT ); Wed, 7 Nov 2018 01:16:59 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wA6KnTBN951442 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Nov 2018 12:49:29 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wA6KnT6s951439; Tue, 6 Nov 2018 12:49:29 -0800 Date: Tue, 6 Nov 2018 12:49:29 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Zhenzhong Duan Message-ID: Cc: mingo@kernel.org, dwmw@amazon.co.uk, bp@suse.de, peterz@infradead.org, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, zhenzhong.duan@oracle.com, konrad.wilk@oracle.com, srinivas.eeda@oracle.com Reply-To: bp@suse.de, mingo@kernel.org, dwmw@amazon.co.uk, peterz@infradead.org, srinivas.eeda@oracle.com, linux-kernel@vger.kernel.org, zhenzhong.duan@oracle.com, tglx@linutronix.de, hpa@zytor.com, konrad.wilk@oracle.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/retpoline: Remove minimal retpoline support Git-Commit-ID: aa0bb5a223720948bdd54d4c7bd48b147502e214 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, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: aa0bb5a223720948bdd54d4c7bd48b147502e214 Gitweb: https://git.kernel.org/tip/aa0bb5a223720948bdd54d4c7bd48b147502e214 Author: Zhenzhong Duan AuthorDate: Fri, 2 Nov 2018 01:45:41 -0700 Committer: Thomas Gleixner CommitDate: Tue, 6 Nov 2018 21:46:20 +0100 x86/retpoline: Remove minimal retpoline support Now that CONFIG_RETPOLINE hard depends on compiler support, there is no reason to keep the minimal retpoline support around which only provided basic protection in the assembly files. Suggested-by: Peter Zijlstra Signed-off-by: Zhenzhong Duan Signed-off-by: Thomas Gleixner Cc: David Woodhouse Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Konrad Rzeszutek Wilk Cc: Link: https://lkml.kernel.org/r/f06f0a89-5587-45db-8ed2-0a9d6638d5c0@default --- 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/nospec-branch.h index 8b09cbb2d52c..c202a64edd95 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 { SPECTRE_V2_NONE, - SPECTRE_V2_RETPOLINE_MINIMAL, - SPECTRE_V2_RETPOLINE_MINIMAL_AMD, SPECTRE_V2_RETPOLINE_GENERIC, SPECTRE_V2_RETPOLINE_AMD, SPECTRE_V2_IBRS_ENHANCED, diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index d0108fb6e4dd..7f6d8159398e 100644 --- a/arch/x86/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c @@ -135,8 +135,6 @@ enum spectre_v2_mitigation_cmd { static const char *spectre_v2_strings[] = { [SPECTRE_V2_NONE] = "Vulnerable", - [SPECTRE_V2_RETPOLINE_MINIMAL] = "Vulnerable: Minimal generic ASM retpoline", - [SPECTRE_V2_RETPOLINE_MINIMAL_AMD] = "Vulnerable: Minimal AMD ASM retpoline", [SPECTRE_V2_RETPOLINE_GENERIC] = "Mitigation: Full generic retpoline", [SPECTRE_V2_RETPOLINE_AMD] = "Mitigation: Full AMD retpoline", [SPECTRE_V2_IBRS_ENHANCED] = "Mitigation: Enhanced IBRS", @@ -250,11 +248,6 @@ static void __init spec2_print_if_secure(const char *reason) pr_info("%s selected on command line.\n", reason); } -static inline bool retp_compiler(void) -{ - return __is_defined(CONFIG_RETPOLINE); -} - static inline bool match_option(const char *arg, int arglen, const char *opt) { int len = strlen(opt); @@ -417,14 +410,12 @@ retpoline_auto: pr_err("Spectre mitigation: LFENCE not serializing, switching to generic retpoline\n"); goto retpoline_generic; } - mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_AMD : - SPECTRE_V2_RETPOLINE_MINIMAL_AMD; + mode = SPECTRE_V2_RETPOLINE_AMD; setup_force_cpu_cap(X86_FEATURE_RETPOLINE_AMD); setup_force_cpu_cap(X86_FEATURE_RETPOLINE); } else { retpoline_generic: - mode = retp_compiler() ? SPECTRE_V2_RETPOLINE_GENERIC : - SPECTRE_V2_RETPOLINE_MINIMAL; + mode = SPECTRE_V2_RETPOLINE_GENERIC; setup_force_cpu_cap(X86_FEATURE_RETPOLINE); }