Rust for Linux List
 help / color / mirror / Atom feed
From: Julian Braha <julianbraha@gmail.com>
To: Josh Poimboeuf <jpoimboe@kernel.org>, x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Gary Guo <gary@garyguo.net>,
	rust-for-linux@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nsc@kernel.org>,
	linux-kbuild@vger.kernel.org, Huacai Chen <chenhuacai@kernel.org>
Subject: Re: [PATCH v2 02/27] kbuild: Add CONFIG_OBJTOOL_DEFERRED
Date: Thu, 10 Sep 2026 20:22:37 +0100	[thread overview]
Message-ID: <1506b117-6e79-4740-8e31-ce0d7a9c0d1b@gmail.com> (raw)
In-Reply-To: <166ab4ef8f062db45d5e4ab928f940d08dc465d5.1788899473.git.jpoimboe@kernel.org>

Hi Josh,

On 9/8/26 21:33, Josh Poimboeuf wrote:
> For LTO, IBT, and KLP builds, the running of objtool is deferred to
> vmlinux.o rather than individual translation units.  In preparation for
> deferring it in more cases, add a new config option.
> 
> No functional change.
> 
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
>  arch/x86/boot/startup/Makefile |  2 +-
>  lib/Kconfig.debug              |  7 +++++++
>  scripts/Makefile.build         |  4 ++--
>  scripts/Makefile.lib           |  4 +---
>  scripts/Makefile.vmlinux_o     | 13 +++++++------
>  scripts/link-vmlinux.sh        |  3 +--
>  6 files changed, 19 insertions(+), 14 deletions(-)
> 
> diff --git a/arch/x86/boot/startup/Makefile b/arch/x86/boot/startup/Makefile
> index 5e499cfb29b5c..ab6e9970d4f4e 100644
> --- a/arch/x86/boot/startup/Makefile
> +++ b/arch/x86/boot/startup/Makefile
> @@ -36,7 +36,7 @@ $(patsubst %.o,$(obj)/%.o,$(lib-y)): OBJECT_FILES_NON_STANDARD := y
>  # relocations, even if other objtool actions are being deferred.
>  #
>  $(pi-objs): objtool-enabled	= 1
> -$(pi-objs): objtool-args	= $(if $(delay-objtool),--dry-run,$(objtool-args-y)) --noabs
> +$(pi-objs): objtool-args	= $(if $(CONFIG_OBJTOOL_DEFERRED),--dry-run,$(objtool-args-y)) --noabs
>  
>  #
>  # Confine the startup code by prefixing all symbols with __pi_ (for position
> diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
> index 134b15a44625e..566e5be4c3f57 100644
> --- a/lib/Kconfig.debug
> +++ b/lib/Kconfig.debug
> @@ -588,6 +588,13 @@ config NOINSTR_VALIDATION
>  	select OBJTOOL
>  	default y
>  
> +# For when objtool defers its work to the linked image (vmlinux.o or module.o)
> +# rather than running on individual translation units.
> +config OBJTOOL_DEFERRED
> +	def_bool y
> +	depends on OBJTOOL
> +	depends on LTO_CLANG || X86_KERNEL_IBT || KLP_BUILD
> +

Just commenting: if you move this option OBJTOOL_DEFERRED (and
OBJTOOL_CONTROL_FLOW in the next patch) a few entries up in this Kconfig
file, menuconfig will render them as part of the OBJTOOL submenu because
of the dependency on OBJTOOL.

E.g. this ordering:

OBJTOOL
OBJTOOL_WERROR
OBJTOOL_DEFERRED
OBJTOOL_CONTROL_FLOW
STACK_VALIDATION
NOINSTR_VALIDATION

would render better.

But this is minor, I don't think it necessitates a v3 on its own.

- Julian Braha

  reply	other threads:[~2026-09-10 19:22 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-08 20:33 [PATCH v2 00/27] objtool: dynamically detect noreturns Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 01/27] objtool: Remove obsolete noreturns.h entries Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 02/27] kbuild: Add CONFIG_OBJTOOL_DEFERRED Josh Poimboeuf
2026-09-10 19:22   ` Julian Braha [this message]
2026-09-08 20:33 ` [PATCH v2 03/27] kbuild: Add CONFIG_OBJTOOL_CONTROL_FLOW Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 04/27] objtool: Fix dead end detection for sibling calls Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 05/27] objtool: Refactor the noreturn/dead-end detection Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 06/27] objtool: Ignore traps after noreturn calls in STT_CODE Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 07/27] objtool: Make .discard.stack_frame_non_standard non-allocatable Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 08/27] efi/libstub: Drop .discard.addressable from the stub objects Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 09/27] efi/loongarch: Mark loongarch efi_boot_kernel() non-standard for objtool Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 10/27] objtool: Add ANNOTATE_IGNORE_NORETURN() Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 11/27] LoongArch: Annotate reboot and kexec paths as returnable Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 12/27] kbuild: Defer running objtool to link time for all CFG features Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 13/27] rust: Annotate the intrinsic stubs as returnable Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 14/27] panic: Mark abort() __noreturn Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 15/27] x86/xen: Ignore noreturn status of weak mem_map_via_hcall() Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 16/27] objtool: Detect noreturns in weak functions Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 17/27] x86/entry: Make rewind_stack_and_make_dead() a real function Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 18/27] x86/xen: Make xen_cpu_bringup_again() " Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 19/27] x86/xen: Make xen_start_kernel() noreturn Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 20/27] x86/boot: Rework how pi startup symbols get exposed to vmlinux Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 21/27] objtool: Fix noreturn detection for non-sibling jumps to SYM_CODE Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 22/27] objtool: Add options to write/read exported noreturns to/from a file Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 23/27] kbuild: Do the per-module objtool pass right before linking Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 24/27] kbuild: Generate the noreturn list and validate modules against it Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 25/27] objtool: Add ANNOTATE_EXPORTED_NORETURN() Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 26/27] objtool: Annotate all module-exported noreturns and remove noreturns.h Josh Poimboeuf
2026-09-08 20:33 ` [PATCH v2 27/27] objtool: Warn about missing/stale ANNOTATE_EXPORTED_NORETURN() usage Josh Poimboeuf

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=1506b117-6e79-4740-8e31-ce0d7a9c0d1b@gmail.com \
    --to=julianbraha@gmail.com \
    --cc=ardb@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=gary@garyguo.net \
    --cc=jpoimboe@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rust-for-linux@vger.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