Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8131277imu; Tue, 4 Dec 2018 03:32:59 -0800 (PST) X-Google-Smtp-Source: AFSGD/U2m7yXPkJcX6tledKyJocOEb8I76271YtS2GU/gLBXAWEtfMOx5Ygwi07Wn4itBuJkx4xr X-Received: by 2002:a62:4549:: with SMTP id s70mr19497819pfa.233.1543923179765; Tue, 04 Dec 2018 03:32:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543923179; cv=none; d=google.com; s=arc-20160816; b=TiCuKO1PnXnOmNbCqrEHeyLTDgqECYWfoLJmLKduaJOH01qDghn+2rw4Uijhx45wZM FYjACtx5fzvwINbQkgr5XnRmC+1xdgAMgRx0rl8PRTivknqchPu3qcNUdp4x1Rw9GtLZ uMQIEBHhAd8Aj8S6KNGUfxFUp9tBVm5xLMAddIAmdl0Y3lDR8j8iFBWByaRFP6Y5zS+p rzwVb5oB5KRkLI1IKlhV0XXRyyBS8NKLrSQJcKCS1HqELDcUWB8d1+PwN2a0Bev6x08i tytBbiLlJ5GFFjTjWNEuYSxdPcd/kCqXfi4J4DMjXqNBRzlIrmktm4K7il6j7/VOTdHf eY4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YIjHQ8Ehql7KUVEoKz1S/BgZo/KGqKhHCwkeC1FwclY=; b=US69xtB9NlFrDX9wXCnb19fN3FIeK4DyFM2lF/TtnQE+T32zEmNCjl1ehUeUSc4JIq 4uxgMDJDwuaCLf/yrTcA0EnFZQVvoRQKmZHzaqgUyiHsWThHlpCFL+r2S4cmUvE2vaoU NjaNbJUnoyudhHYvaqEs/lLjI2lL8O5osbDLNsl22UKwm/L9Zmqwv6OLFuRzLjb59X4r aYDbTHN6tLe1lqXe3MrYIC6sltSIo8rillOA6wXWTqEPMi/WHnJQU30skdHqclmYXKeR j/t3ZkvR+eXTPPddcLo7Vdl2+lI8xssv+t/2V7smzpI5xCBlWpFI7Ta9y+2W0mNc8Aiz H64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fh8FjHxn; 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 204si15649071pfu.273.2018.12.04.03.32.44; Tue, 04 Dec 2018 03:32:59 -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; dkim=pass header.i=@kernel.org header.s=default header.b=fh8FjHxn; 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 S1726684AbeLDLbv (ORCPT + 99 others); Tue, 4 Dec 2018 06:31:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:39520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726454AbeLDK4T (ORCPT ); Tue, 4 Dec 2018 05:56:19 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D11C4214DB; Tue, 4 Dec 2018 10:56:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543920978; bh=APm7iJbn72ndqn592Sa2R+iwIM+SFcN4ZPe2tL0AGAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fh8FjHxn5b0oyjNYs7bCJHSjGSev9D/tp8CdkG0urs/AWB/KPo/q3xjk/LV6Vg6g4 PuGY5+JCEIslfwEoRpr6/x2Uw7RQ4Ap7Eh7V0a49+rq4Wp5JQwesOs7Xyhc8h2tDfe fnYenHkApgsrWKaPJ5S8+UtYDLxwLRD6gKRJ/oYE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Zijlstra , Zhenzhong Duan , Thomas Gleixner , David Woodhouse , Borislav Petkov , "H. Peter Anvin" , Konrad Rzeszutek Wilk , srinivas.eeda@oracle.com Subject: [PATCH 4.19 032/139] x86/retpoline: Remove minimal retpoline support Date: Tue, 4 Dec 2018 11:48:33 +0100 Message-Id: <20181204103651.307986068@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181204103649.950154335@linuxfoundation.org> References: <20181204103649.950154335@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhenzhong Duan zhenzhong.duan@oracle.com commit ef014aae8f1cd2793e4e014bbb102bed53f852b7 upstream 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 Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/nospec-branch.h | 2 -- arch/x86/kernel/cpu/bugs.c | 13 ++----------- 2 files changed, 2 insertions(+), 13 deletions(-) --- 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, --- 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 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); @@ -415,14 +408,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); }