Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1212110imu; Wed, 28 Nov 2018 06:21:07 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wh9uCLTn8+sxiEVwvAbi7Cl9qbLTnDHMYDSHV0GM2b1MPbjkyosIQeulLNCMpJSF+W9JZ2 X-Received: by 2002:a17:902:1d4a:: with SMTP id u10mr34465487plu.122.1543414867410; Wed, 28 Nov 2018 06:21:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543414867; cv=none; d=google.com; s=arc-20160816; b=rmrZ+ACWBh4dRmEOkPq5EL5PbdaRCnHDkSG4b1HbQ24hjXtt5Jg5mu3dJDOgGRlwvx kNq/zHKWlaJ7QPYQveSnuphPknB3ow2iy4NNpPaniJSpN1j51PqbLrbXJbfmMxnK2ZnU BTsYcxCTVdfIxNKp0eiLVN+P1LrcrAJcjO9644F8Tk88iCdFaZ5FBKnnQ3mIPE0ZtIB4 AXpTyfgjcrCO0VU0+LNV04UE0uX8wH1ojycidNu8iOfSqYiMnLU4fgRe8fqr3WD1hmvv TiM1mP60YgBWYUouP4W5r3DC2YeAqjtf0ylfofdQQlaeWdPGd2Ocrxmsm4JJhM3PUL73 Q1Nw== 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=796Z7QWw6ilq5SHfs7T1zk2m62Z1jjUINAZHQO0A0VI=; b=xkdgzEJrsI5TYYUA0eM1WY6GZNHo9+xR96Xo846AkwOVC62hBPjKiU6yVGV/Vdyc/f B3rGgCJy/xLxRyAajFXfVS4Bk3X54qEsO5teUwkhx3FBbukrlbacaegyKlfDZxC7BZdM JSup4xfLI/S6bwXVs4m/XjaeqgctNuDw3OkIM089AmvcaIJiruDdvJ5427gI8Tc+d4RD tdAOek6Qp3xErzJr7Z7yThgMqe3dxDVdkXK+VkaMl0Aw+sdvZwabXVEbDDnme5Pt2fTr iI3pQV/3QfUureDqDTnLqeY0pCDCek+k39gNfieQZD8l0V4zDigYVY6kMkeC2sYmU5UH 0x9w== 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 e1si8112196pln.55.2018.11.28.06.20.51; Wed, 28 Nov 2018 06:21:07 -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 S1728315AbeK2BV4 (ORCPT + 99 others); Wed, 28 Nov 2018 20:21:56 -0500 Received: from terminus.zytor.com ([198.137.202.136]:55875 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728031AbeK2BV4 (ORCPT ); Wed, 28 Nov 2018 20:21:56 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id wASEJanX2320475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 28 Nov 2018 06:19:36 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id wASEJamK2320472; Wed, 28 Nov 2018 06:19:36 -0800 Date: Wed, 28 Nov 2018 06:19:36 -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: zhenzhong.duan@oracle.com, konrad.wilk@oracle.com, dwmw@amazon.co.uk, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, bp@suse.de, hpa@zytor.com, srinivas.eeda@oracle.com Reply-To: tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, bp@suse.de, srinivas.eeda@oracle.com, hpa@zytor.com, konrad.wilk@oracle.com, zhenzhong.duan@oracle.com, linux-kernel@vger.kernel.org, dwmw@amazon.co.uk In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] x86/retpoline: Remove minimal retpoline support Git-Commit-ID: ef014aae8f1cd2793e4e014bbb102bed53f852b7 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=-0.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_24_48 autolearn=no 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: ef014aae8f1cd2793e4e014bbb102bed53f852b7 Gitweb: https://git.kernel.org/tip/ef014aae8f1cd2793e4e014bbb102bed53f852b7 Author: Zhenzhong Duan AuthorDate: Fri, 2 Nov 2018 01:45:41 -0700 Committer: Thomas Gleixner CommitDate: Wed, 28 Nov 2018 11:57:03 +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: Cc: stable@vger.kernel.org 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); }