Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1846256pxp; Thu, 10 Mar 2022 13:21:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJ9AknnxEFqPxhA8LwRNCvpeqrMYkXyYr167zmPO+XFNFvAngDH8FrB5U7n9VdCDeDb+g5 X-Received: by 2002:a63:6b83:0:b0:380:102:8779 with SMTP id g125-20020a636b83000000b0038001028779mr5815843pgc.42.1646947306343; Thu, 10 Mar 2022 13:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646947306; cv=none; d=google.com; s=arc-20160816; b=kTamVPrRlWu+j9SJDnDej8+ioTSsiymEg2Wd9FWjgT0zyRBUQKYvrVK9gjoaWQ/Yow uyxE/IImj96vHRwE2YXjLllSnVASo0Ib8kgr63alpm2be0GAc/tqVr/O5CgRV0YE//4D dXJ+2euMRW0gLqD/9NeuaQnYd4BMEQVend7blnVwUCkcBtt22/3HQBWmzgnR0paEmv8A L5/uZfecZnbQ2bhKHP929vFbDt5/vfjKpjur296JkvdKfW13HFDhmv5CfRThztn2wlgq /VSiN+R5mYFOKj/clwdKa5y0E/7ZMmiiemECUAjs1Ldk5Ia0z6QlnFYH5lrWWXJQchKe g3GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IHvMV0x94aBUFtVX3ny5XBTWWUh5RwvKvRIq6akHNyE=; b=jdsPMrz8MkXYjE2RVqjAVmjrdU734rvQV765FFl/3ZKlUVENZGlHH63crXTLpVBxOL qS+sqSY4d61U03os6EDbcVd+OmzLx59kz1oRPYw3pEVjXyQIzxUR77YgN1sWCHLEuU/B D6z+LWzFFSo+9aiCep8fr1zY0jqUR7ifa35s52tkOZyRMk8LhtsABrqYeijB1c6WOXp4 uE5eZlGrO/0mCYenIMtaqzyloZUF9eSzz6LfI+xd2kU6e6BOY84HQqPwZqDGQCyqoc/E 0531cv5CUtvnx4Hb536bzHbCIfJRjYFM7mclaWUV4fTLfujxL/kRbbsxXY1WgxTXq0rI O7qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rSDp0HdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nm19-20020a17090b19d300b001bd14e03083si2832693pjb.91.2022.03.10.13.21.29; Thu, 10 Mar 2022 13:21:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rSDp0HdA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243252AbiCJOVv (ORCPT + 99 others); Thu, 10 Mar 2022 09:21:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243871AbiCJOS3 (ORCPT ); Thu, 10 Mar 2022 09:18:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9EF51567A6; Thu, 10 Mar 2022 06:14:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B624161CAA; Thu, 10 Mar 2022 14:14:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97677C340F7; Thu, 10 Mar 2022 14:14:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646921697; bh=HSc3wFtLjti/d4eRAAzuyhTWC1ahVbUMNGqKeSkzAyQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rSDp0HdA3WItM0hoeye+WNTCemyAG44Ka8h3yDd5c/5PwNyTJdFkFl/ylBUa4HKIK lAH6XtQoPykujpweOnknWxXpfAMGE+cSwl0YuKVECJE5+h6dP/m0dMa4xmz2a5hNg7 mybCEGnJw2H6I3o6OQoD6oCEyXwQzdMv8h3p4hgM= 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, Ben Hutchings Subject: [PATCH 4.9 03/38] x86/retpoline: Remove minimal retpoline support Date: Thu, 10 Mar 2022 15:13:16 +0100 Message-Id: <20220310140808.238974462@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220310140808.136149678@linuxfoundation.org> References: <20220310140808.136149678@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhenzhong Duan 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: Ben Hutchings 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 @@ -223,8 +223,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 @@ -784,8 +784,6 @@ set_mode: static const char * const 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", @@ -810,11 +808,6 @@ static void __init spec_v2_print_cond(co pr_info("%s selected on command line.\n", reason); } -static inline bool retp_compiler(void) -{ - return __is_defined(CONFIG_RETPOLINE); -} - static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void) { enum spectre_v2_mitigation_cmd cmd = SPECTRE_V2_CMD_AUTO; @@ -912,14 +905,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); }