Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1364334imi; Sat, 23 Jul 2022 03:44:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tehFEFT0f9SXDR7LFSCgf1jfNFXZd7rBII4QMM5g9c2UvY4gjQCzREUfSQnS5J96vWx75m X-Received: by 2002:a17:903:25cf:b0:16d:948:33eb with SMTP id jc15-20020a17090325cf00b0016d094833ebmr3712560plb.64.1658573058086; Sat, 23 Jul 2022 03:44:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658573058; cv=none; d=google.com; s=arc-20160816; b=gImb8EiUKW0/xuKvP0Ep3LVDWM69L5mLZQuyQGf3qPGnmFK8HqbKyNse0wxNwQVe5y F4ee1sSSGYW8blgKCPi8DjmL7xp7+1Y5n6U96NWJe9PhRVr3sbFo0OIuNjrBq1PjHlhD Au72akGt1djQef/oPiUYdXI/kdCx8+Y4rM/7b2kJAcRKwDT3W+C9ZdjutuGSUbSXNFsO dGKuvfe3e/aBym5c501J2XL8HD6Xhj7U78p4scV4XObaVM//52pH6FP0XrcszSUr2G+p VPddIgerWkKV7jVYKVpwJbZedl2Choc531WDkB3NuA6MA7Y/UEWmVdb4Q/JLI0r+AIZ7 XyZQ== 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=ogsQiogT4SEV3ZUM4yzSLpO2C0wMBcbTASuk7Vo7OAw=; b=JgBNXKrA+ZJwT+HmdZfG3Z382Oq6fKjw3bioNmAoFNhtsv6EZ0YTFp1lbvPCnbE5Vw aEktSa17xQsmDBMaUyrzOMXwT5Sntjzre4R3j3o0ncsrqJhYxXKEHbkDTJfJX2PlelwF UFWkxohjwQ+m6/OI9pcZ0iAvCO/7QGM0yJKOaVtUhdJBjfKoFVGeVVihobhB7MjFGNOj 3h4jKx+R4KDEu+YTAakAKqj6TwEphnHIJzs8mNIJjh5kDeocDFwcl05HUbBg40us12hL SN/Ilu8MjyGz7dqJWsXnOEewnXVHakUltFeAH3rKyGR4nYl0qCNcX87H8ZltMbfwChqJ C29g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZAgPHxQl; 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 d3-20020a631d03000000b003fae0c67055si8332465pgd.777.2022.07.23.03.44.02; Sat, 23 Jul 2022 03:44:18 -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=ZAgPHxQl; 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 S238951AbiGWKNR (ORCPT + 99 others); Sat, 23 Jul 2022 06:13:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239448AbiGWKMw (ORCPT ); Sat, 23 Jul 2022 06:12:52 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D226D3657; Sat, 23 Jul 2022 03:03:41 -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 sin.source.kernel.org (Postfix) with ESMTPS id 06985CE0B68; Sat, 23 Jul 2022 10:03:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB938C341C0; Sat, 23 Jul 2022 10:03:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658570602; bh=/rrw6F0rSsfVQqxOLNWBcDP28QbOYy6khI9EDel11R8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZAgPHxQlFmZuqi7ejQ7Wu+vPV19O5ug+d5u6BXY68ukis8GVRmjtb7jkGQrhH+Wat aTnFGUkuHz5LupAATJEkxMOvBskaXSHYHPBk1dXtgOqz4OhVDLLhmLPuDMBhU3PSo1 ZmDXPso14agA8ZESVgT7HdatpQMEXpN/rXfz5o1Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Peter Zijlstra (Intel)" , Borislav Petkov , Kees Cook , Nick Desaulniers Subject: [PATCH 5.10 144/148] x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds Date: Sat, 23 Jul 2022 11:55:56 +0200 Message-Id: <20220723095304.680881838@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220723095224.302504400@linuxfoundation.org> References: <20220723095224.302504400@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.8 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 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 68cf4f2a72ef8786e6b7af6fd9a89f27ac0f520d upstream. In order to further enable commit: bbe2df3f6b6d ("x86/alternative: Try inline spectre_v2=retpoline,amd") add the new GCC flag -mindirect-branch-cs-prefix: https://gcc.gnu.org/g:2196a681d7810ad8b227bf983f38ba716620545e https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102952 https://bugs.llvm.org/show_bug.cgi?id=52323 to RETPOLINE=y builds. This should allow fully inlining retpoline,amd for GCC builds. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Borislav Petkov Reviewed-by: Kees Cook Acked-by: Nick Desaulniers Link: https://lkml.kernel.org/r/20211119165630.276205624@infradead.org Signed-off-by: Greg Kroah-Hartman --- Makefile | 1 + 1 file changed, 1 insertion(+) --- a/Makefile +++ b/Makefile @@ -672,6 +672,7 @@ endif ifdef CONFIG_CC_IS_GCC RETPOLINE_CFLAGS := $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register) +RETPOLINE_CFLAGS += $(call cc-option,-mindirect-branch-cs-prefix) RETPOLINE_VDSO_CFLAGS := $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register) endif ifdef CONFIG_CC_IS_CLANG