mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	keescook@chromium.org, hjl.tools@gmail.com,
	andrew.cooper3@citrix.com, mark.rutland@arm.com, will@kernel.org,
	ndesaulniers@google.com
Subject: [PATCH 1/3] x86: Move RETPOLINE*_CFLAGS to arch Makefile
Date: Fri, 19 Nov 2021 17:50:24 +0100	[thread overview]
Message-ID: <20211119165630.219152765@infradead.org> (raw)
In-Reply-To: <20211119165023.249607540@infradead.org>

Currently RETPOLINE*_CFLAGS are defined in the top-level Makefile but
only x86 makes use of them, move them there. If ever another
architecture finds the need, we can reconsider.

Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 Makefile          |   11 -----------
 arch/x86/Makefile |   11 +++++++++++
 2 files changed, 11 insertions(+), 11 deletions(-)

--- a/Makefile
+++ b/Makefile
@@ -688,17 +688,6 @@ ifdef CONFIG_FUNCTION_TRACER
   CC_FLAGS_FTRACE := -pg
 endif
 
-ifdef CONFIG_CC_IS_GCC
-RETPOLINE_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
-RETPOLINE_VDSO_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
-endif
-ifdef CONFIG_CC_IS_CLANG
-RETPOLINE_CFLAGS	:= -mretpoline-external-thunk
-RETPOLINE_VDSO_CFLAGS	:= -mretpoline
-endif
-export RETPOLINE_CFLAGS
-export RETPOLINE_VDSO_CFLAGS
-
 include $(srctree)/arch/$(SRCARCH)/Makefile
 
 ifdef need-config
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -12,6 +12,17 @@ else
         KBUILD_DEFCONFIG := $(ARCH)_defconfig
 endif
 
+ifdef CONFIG_CC_IS_GCC
+RETPOLINE_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
+RETPOLINE_VDSO_CFLAGS	:= $(call cc-option,-mindirect-branch=thunk-inline -mindirect-branch-register)
+endif
+ifdef CONFIG_CC_IS_CLANG
+RETPOLINE_CFLAGS	:= -mretpoline-external-thunk
+RETPOLINE_VDSO_CFLAGS	:= -mretpoline
+endif
+export RETPOLINE_CFLAGS
+export RETPOLINE_VDSO_CFLAGS
+
 # For gcc stack alignment is specified with -mpreferred-stack-boundary,
 # clang has the option -mstack-alignment for that purpose.
 ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)



  reply	other threads:[~2021-11-19 16:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 16:50 [PATCH 0/3] x86: Add GCC-12 features Peter Zijlstra
2021-11-19 16:50 ` Peter Zijlstra [this message]
2021-11-19 17:10   ` [PATCH 1/3] x86: Move RETPOLINE*_CFLAGS to arch Makefile Kees Cook
2021-11-19 19:02   ` Nick Desaulniers
2021-12-10 11:05   ` [tip: x86/core] " tip-bot2 for Peter Zijlstra
2021-11-19 16:50 ` [PATCH 2/3] x86: Use -mindirect-branch-cs-prefix for RETPOLINE builds Peter Zijlstra
2021-11-19 17:10   ` Kees Cook
2021-12-10 11:05   ` [tip: x86/core] " tip-bot2 for Peter Zijlstra
2021-11-19 16:50 ` [PATCH 3/3] x86: Add straight-line-speculation mitigation Peter Zijlstra
2021-11-19 17:15   ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119165630.219152765@infradead.org \
    --to=peterz@infradead.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=hjl.tools@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ndesaulniers@google.com \
    --cc=will@kernel.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®