Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4692728imw; Tue, 12 Jul 2022 12:32:48 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ukPgR+ZsAtT395OOIFUPzA7DqztnTkbwh5IMGCV1x4fmGZApQf6yFA6OpUaNDWCY+u6xTK X-Received: by 2002:a05:6402:4244:b0:43a:ded8:563b with SMTP id g4-20020a056402424400b0043aded8563bmr12908446edb.222.1657654368013; Tue, 12 Jul 2022 12:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657654368; cv=none; d=google.com; s=arc-20160816; b=zyTNrty65yDyYvlYtoc1QlcQSqO1S6egg7diuyU5NsfTqQ/e87i39oXTMxtYNbZjrz ju+JYYQ0imnmpKPuUb7juyLdB2Dge4NT74mEPuONffDhcHCyvhKYFSf2L2uGmH7hrJdo Y5TgSS+bnedawpjDd1MNcim8PWEPN9X5B4LQRc/GwrviY2cnHwBfcF7HFXDKY1caHPNg 5nuL8lqxw7P0GzHLcsp/vXFonfQQsuqBANfuzQWQbT/OOYFjEyuBNAHAyC0QDRwiuVr7 w0AiMiTTDIuUiX53UU0JeJn7ZScz8TnmLLpODIFKJDXYqpDvRG7/HlIUCLoNCLLnzBa5 DkIA== 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=EN15NRx80e1e3wDIkhNQ881GOgZ50YbV/c0TlVHdoZ8=; b=AEISMyrjqh1Aqm6Jgb1SuwgVHbvssXKjzGQiLg42MFaCRmnfXNSCWqfgvhlUaTqhBo uRhmSDG+d36QmxNRSWcw/FtNxoOLmihA3b/KLU9deqQWm2IJ1fp/WykJIy7xC9VmhXvL tQOjIDyn7PkpBLgbUsfkejRVNEEAH+NIszX+KZoHEsHYUQWyHw5nQs8kGGvCG74nLGsK OwK3luZ6XWk2J7tnqEv7kw/cBv76mxEi1eHoXXF7AmAdvDm/oNPZPIxW0l1wkN5tsKFG 2HzQrl2uhz4Ae5O11mrjKLjoYUJKPKEzR0PZ0CHq01E5v0PUCQjztIYk84+Oob03/VYX N1gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bertNumD; 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 oz30-20020a1709077d9e00b00722fb07523asi6569636ejc.614.2022.07.12.12.32.21; Tue, 12 Jul 2022 12:32:48 -0700 (PDT) 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=bertNumD; 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 S234849AbiGLSy6 (ORCPT + 99 others); Tue, 12 Jul 2022 14:54:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234921AbiGLSyV (ORCPT ); Tue, 12 Jul 2022 14:54:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0CDE8DBA; Tue, 12 Jul 2022 11:45:50 -0700 (PDT) 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 97FB36090C; Tue, 12 Jul 2022 18:45:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 99905C3411E; Tue, 12 Jul 2022 18:45:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657651550; bh=xUZao+YZQ5hWJQmX+X+GqLQnsVGFxF9clzCVR/E8YC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bertNumDqCAOEzYYtm+UvTzemXsWjQuf8FoJGK/yo+uc3saDzo1BsViedfaItRaow t0HuwaoTDOfR9SGjc1sUstFfOhLAwd4po+A/PiytKM38JvP9RLVCzQ/q5K8cV6mYV7 fs9VqDZj2W5aIFEQeRk+93ta+nVi8pUYw1t4riTk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Borislav Petkov , Josh Poimboeuf , Thadeu Lima de Souza Cascardo , Ben Hutchings Subject: [PATCH 5.10 080/130] x86/retpoline: Cleanup some #ifdefery Date: Tue, 12 Jul 2022 20:38:46 +0200 Message-Id: <20220712183250.151806844@linuxfoundation.org> X-Mailer: git-send-email 2.37.0 In-Reply-To: <20220712183246.394947160@linuxfoundation.org> References: <20220712183246.394947160@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.7 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: Peter Zijlstra commit 369ae6ffc41a3c1137cab697635a84d0cc7cdcea upstream. On it's own not much of a cleanup but it prepares for more/similar code. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Reviewed-by: Josh Poimboeuf Signed-off-by: Borislav Petkov [cascardo: conflict fixup because of DISABLE_ENQCMD] [cascardo: no changes at nospec-branch.h and bpf_jit_comp.c] Signed-off-by: Thadeu Lima de Souza Cascardo Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/disabled-features.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) --- a/arch/x86/include/asm/disabled-features.h +++ b/arch/x86/include/asm/disabled-features.h @@ -56,6 +56,13 @@ # define DISABLE_PTI (1 << (X86_FEATURE_PTI & 31)) #endif +#ifdef CONFIG_RETPOLINE +# define DISABLE_RETPOLINE 0 +#else +# define DISABLE_RETPOLINE ((1 << (X86_FEATURE_RETPOLINE & 31)) | \ + (1 << (X86_FEATURE_RETPOLINE_LFENCE & 31))) +#endif + /* Force disable because it's broken beyond repair */ #define DISABLE_ENQCMD (1 << (X86_FEATURE_ENQCMD & 31)) @@ -73,7 +80,7 @@ #define DISABLED_MASK8 0 #define DISABLED_MASK9 (DISABLE_SMAP) #define DISABLED_MASK10 0 -#define DISABLED_MASK11 0 +#define DISABLED_MASK11 (DISABLE_RETPOLINE) #define DISABLED_MASK12 0 #define DISABLED_MASK13 0 #define DISABLED_MASK14 0