All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Miroslav Benes <mbenes@suse.cz>
Subject: Re: [PATCH v2 00/25] objtool: Interface overhaul
Date: Tue, 19 Apr 2022 13:51:30 +0200	[thread overview]
Message-ID: <20220419115130.GT2731@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <cover.1650300597.git.jpoimboe@redhat.com>

On Mon, Apr 18, 2022 at 09:50:19AM -0700, Josh Poimboeuf wrote:

> Josh Poimboeuf (25):
>   objtool: Enable unreachable warnings for CLANG LTO
>   libsubcmd: Fix OPTION_GROUP sorting
>   x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline
>   x86/retpoline: Add ANNOTATE_ENDBR for retpolines
>   x86/uaccess: Add ENDBR to __put_user_nocheck*()
>   x86/xen: Add ANNOTATE_ENDBR to startup_xen()
>   objtool: Reorganize cmdline options
>   objtool: Ditch subcommands
>   objtool: Don't print parentheses in function addresses
>   objtool: Print data address for "!ENDBR" data warnings
>   objtool: Use offstr() to print address of missing ENDBR
>   objtool: Add option to print section addresses
>   scripts: Create objdump-func helper script
>   objtool: Make stack validation optional
>   objtool: Rework ibt and extricate from stack validation
>   objtool: Extricate sls from stack validation
>   objtool: Add CONFIG_OBJTOOL
>   objtool: Make stack validation frame-pointer-specific
>   objtool: Make static call annotation optional
>   objtool: Make jump label hack optional
>   objtool: Make noinstr hacks optional
>   objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION"
>   objtool: Add HAVE_NOINSTR_VALIDATION
>   objtool: Remove --lto and --vmlinux in favor of --link
>   objtool: Update documentation

I've taken the liberty of reordering it slightly:

   objtool: Enable unreachable warnings for CLANG LTO
   x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline
   x86/retpoline: Add ANNOTATE_ENDBR for retpolines
   x86/uaccess: Add ENDBR to __put_user_nocheck*()
   x86/xen: Add ANNOTATE_ENDBR to startup_xen()
   objtool: Print data address for "!ENDBR" data warnings
   objtool: Use offstr() to print address of missing ENDBR

Go into x86/urgent, and I've added Fixes: tags with various patches from
the IBT series, and then the rest goes into objtool/core.

As already indicated, there's going to be a few merge conflicts against
x86/core, but alas. Resolved as per the below.

---
diff --cc arch/x86/Kconfig
index 20c1dacd2baa,c8f560802bf2..000000000000
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
diff --cc scripts/Makefile.build
index 7e7aa1d030a6,ac8167227bc0..000000000000
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@@ -227,15 -227,19 +227,19 @@@ ifdef CONFIG_OBJTOO
  objtool := $(objtree)/tools/objtool/objtool
  
  objtool_args =								\
- 	$(if $(CONFIG_UNWINDER_ORC),orc generate,check)			\
- 	$(if $(part-of-module), --module)				\
- 	$(if $(CONFIG_X86_KERNEL_IBT), --lto --ibt)			\
- 	$(if $(CONFIG_FRAME_POINTER),, --no-fp)				\
- 	$(if $(CONFIG_GCOV_KERNEL)$(CONFIG_LTO_CLANG), --no-unreachable)\
+ 	$(if $(CONFIG_HAVE_JUMP_LABEL_HACK), --hacks=jump_label)	\
+ 	$(if $(CONFIG_HAVE_NOINSTR_HACK), --hacks=noinstr)		\
+ 	$(if $(CONFIG_X86_KERNEL_IBT), --ibt)				\
+ 	$(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount)		\
+ 	$(if $(CONFIG_UNWINDER_ORC), --orc)				\
  	$(if $(CONFIG_RETPOLINE), --retpoline)				\
+ 	$(if $(CONFIG_SLS), --sls)					\
+ 	$(if $(CONFIG_STACK_VALIDATION), --stackval)			\
+ 	$(if $(CONFIG_HAVE_STATIC_CALL_INLINE), --static-call)		\
 -	$(if $(CONFIG_X86_SMAP), --uaccess)				\
 +	--uaccess							\
- 	$(if $(CONFIG_FTRACE_MCOUNT_USE_OBJTOOL), --mcount)		\
- 	$(if $(CONFIG_SLS), --sls)
+ 	$(if $(linked-object), --link)					\
+ 	$(if $(part-of-module), --module)				\
+ 	$(if $(CONFIG_GCOV_KERNEL), --no-unreachable)
  
  cmd_objtool = $(if $(objtool-enabled), ; $(objtool) $(objtool_args) $@)
  cmd_gen_objtooldep = $(if $(objtool-enabled), { echo ; echo '$@: $$(wildcard $(objtool))' ; } >> $(dot-target).cmd)
diff --cc scripts/link-vmlinux.sh
index 3a2fffdf49d4,eb9324f07f3d..000000000000
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@@ -126,34 -132,46 +132,44 @@@ objtool_link(
  		if is_enabled CONFIG_FTRACE_MCOUNT_USE_OBJTOOL; then
  			objtoolopt="${objtoolopt} --mcount"
  		fi
- 	fi
  
- 	if is_enabled CONFIG_VMLINUX_VALIDATION; then
- 		objtoolopt="${objtoolopt} --noinstr"
- 	fi
+ 		if is_enabled CONFIG_UNWINDER_ORC; then
+ 			objtoolopt="${objtoolopt} --orc"
+ 		fi
  
- 	if [ -n "${objtoolopt}" ]; then
- 		if [ -z "${objtoolcmd}" ]; then
- 			objtoolcmd="check"
+ 		if is_enabled CONFIG_RETPOLINE; then
+ 			objtoolopt="${objtoolopt} --retpoline"
  		fi
- 		objtoolopt="${objtoolopt} --vmlinux"
- 		if ! is_enabled CONFIG_FRAME_POINTER; then
- 			objtoolopt="${objtoolopt} --no-fp"
+ 
+ 		if is_enabled CONFIG_SLS; then
+ 			objtoolopt="${objtoolopt} --sls"
  		fi
- 		if is_enabled CONFIG_GCOV_KERNEL || is_enabled CONFIG_LTO_CLANG; then
- 			objtoolopt="${objtoolopt} --no-unreachable"
+ 
+ 		if is_enabled CONFIG_STACK_VALIDATION; then
+ 			objtoolopt="${objtoolopt} --stackval"
  		fi
- 		if is_enabled CONFIG_RETPOLINE; then
- 			objtoolopt="${objtoolopt} --retpoline"
+ 
+ 		if is_enabled CONFIG_HAVE_STATIC_CALL_INLINE; then
+ 			objtoolopt="${objtoolopt} --static-call"
  		fi
  
 -		if is_enabled CONFIG_X86_SMAP; then
 -			objtoolopt="${objtoolopt} --uaccess"
 -		fi
 +		objtoolopt="${objtoolopt} --uaccess"
+ 	fi
  
- 		if is_enabled CONFIG_SLS; then
- 			objtoolopt="${objtoolopt} --sls"
+ 	if is_enabled CONFIG_NOINSTR_VALIDATION; then
+ 		objtoolopt="${objtoolopt} --noinstr"
+ 	fi
+ 
+ 	if [ -n "${objtoolopt}" ]; then
+ 
+ 		if is_enabled CONFIG_GCOV_KERNEL; then
+ 			objtoolopt="${objtoolopt} --no-unreachable"
  		fi
+ 
+ 		objtoolopt="${objtoolopt} --link"
+ 
  		info OBJTOOL ${1}
- 		tools/objtool/objtool ${objtoolcmd} ${objtoolopt} ${1}
+ 		tools/objtool/objtool ${objtoolopt} ${1}
  	fi
  }
  

  parent reply	other threads:[~2022-04-19 11:51 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 16:50 [PATCH v2 00/25] objtool: Interface overhaul Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 01/25] objtool: Enable unreachable warnings for CLANG LTO Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 02/25] libsubcmd: Fix OPTION_GROUP sorting Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 03/25] x86/static_call: Add ANNOTATE_NOENDBR to static call trampoline Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 04/25] x86/retpoline: Add ANNOTATE_ENDBR for retpolines Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] x86/retpoline: Add ANNOTATE_NOENDBR " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 05/25] x86/uaccess: Add ENDBR to __put_user_nocheck*() Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 06/25] x86/xen: Add ANNOTATE_ENDBR to startup_xen() Josh Poimboeuf
2022-04-19 11:42   ` Andrew Cooper
2022-04-19 11:57     ` Peter Zijlstra
2022-04-19 12:06       ` Juergen Gross
2022-04-19 12:12       ` Andrew Cooper
2022-04-19 13:10         ` Peter Zijlstra
2022-04-19 14:25           ` Andrew Cooper
2022-04-19 20:08   ` [tip: x86/urgent] x86/xen: Add ANNOTATE_NOENDBR " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 07/25] objtool: Reorganize cmdline options Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 08/25] objtool: Ditch subcommands Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 09/25] objtool: Don't print parentheses in function addresses Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 10/25] objtool: Print data address for "!ENDBR" data warnings Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 11/25] objtool: Use offstr() to print address of missing ENDBR Josh Poimboeuf
2022-04-19 20:08   ` [tip: x86/urgent] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 12/25] objtool: Add option to print section addresses Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 13/25] scripts: Create objdump-func helper script Josh Poimboeuf
2022-04-19 11:15   ` Peter Zijlstra
2022-04-19 16:09     ` Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 14/25] objtool: Make stack validation optional Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 15/25] objtool: Rework ibt and extricate from stack validation Josh Poimboeuf
2022-04-20 17:25   ` Miroslav Benes
2022-04-22 10:50     ` Peter Zijlstra
2022-04-22 15:17       ` Josh Poimboeuf
2022-04-25  6:27       ` Miroslav Benes
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 16/25] objtool: Extricate sls " Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 17/25] objtool: Add CONFIG_OBJTOOL Josh Poimboeuf
2022-04-19 11:22   ` Peter Zijlstra
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 18/25] objtool: Make stack validation frame-pointer-specific Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 19/25] objtool: Make static call annotation optional Josh Poimboeuf
2022-04-22 10:35   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 20/25] objtool: Make jump label hack optional Josh Poimboeuf
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 21/25] objtool: Make noinstr hacks optional Josh Poimboeuf
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 22/25] objtool: Rename "VMLINUX_VALIDATION" -> "NOINSTR_VALIDATION" Josh Poimboeuf
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 23/25] objtool: Add HAVE_NOINSTR_VALIDATION Josh Poimboeuf
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 24/25] objtool: Remove --lto and --vmlinux in favor of --link Josh Poimboeuf
2022-04-20 17:25   ` Miroslav Benes
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-18 16:50 ` [PATCH v2 25/25] objtool: Update documentation Josh Poimboeuf
2022-04-22 10:34   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2022-04-19 11:51 ` Peter Zijlstra [this message]
2022-04-19 15:36   ` [PATCH v2 00/25] objtool: Interface overhaul Josh Poimboeuf
2022-04-19 16:43     ` Peter Zijlstra
2022-04-20 17:27 ` Miroslav Benes

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=20220419115130.GT2731@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.