From: Josh Poimboeuf <jpoimboe@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: x86@kernel.org, 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>, Nicolas Schier <nsc@kernel.org>,
linux-kbuild@vger.kernel.org,
Huacai Chen <chenhuacai@kernel.org>
Subject: Re: [PATCH 12/27] kbuild: Defer running objtool to link time for all CFG features
Date: Fri, 28 Aug 2026 11:19:52 -0700 [thread overview]
Message-ID: <apHOMecu7SAWR2zG@jpoimboe> (raw)
In-Reply-To: <20260828175708.GA3403925@ax162>
On Fri, Aug 28, 2026 at 10:57:08AM -0700, Nathan Chancellor wrote:
> On Thu, Aug 27, 2026 at 09:51:41PM -0700, Josh Poimboeuf wrote:
> > diff --git a/scripts/Makefile.vmlinux_o b/scripts/Makefile.vmlinux_o
> > index 9bac917e8b819..df1e3584883e6 100644
> > --- a/scripts/Makefile.vmlinux_o
> > +++ b/scripts/Makefile.vmlinux_o
> > @@ -30,20 +30,12 @@ endif
> > # objtool for vmlinux.o
> > # ---------------------------------------------------------------------------
> > #
> > -# For CONFIG_OBJTOOL_DEFERRED (IBT or LTO), objtool doesn't run on individual
> > -# translation units. Instead it runs on vmlinux.o.
> > -#
> > -# For !CONFIG_OBJTOOL_DEFERRED + CONFIG_NOINSTR_VALIDATION, it runs on both
> > -# translation units and vmlinux.o, with the latter only used for noinstr/unret
> > -# validation.
> > +# For CONFIG_OBJTOOL_DEFERRED, objtool doesn't run on individual translation
> > +# units. Instead it runs on vmlinux.o.
> >
> > -objtool-enabled := $(or $(CONFIG_OBJTOOL_DEFERRED),$(CONFIG_NOINSTR_VALIDATION))
> > +objtool-enabled := $(CONFIG_OBJTOOL_DEFERRED)
> >
> > -ifeq ($(CONFIG_OBJTOOL_DEFERRED),y)
> > vmlinux-objtool-args-y += $(objtool-args-y)
> > -else
> > -vmlinux-objtool-args-$(CONFIG_OBJTOOL_WERROR) += --werror
>
> Did you mean to drop this line or did it accidentally get culled in
> cleaning up the conditional statements?
That was actually on purpose.
Before this patch, NOINSTR_VALIDATION was a weird special case, where
objtool ran on individual TUs (with all the objtool-args-y), and then
ran again on vmlinux.o (without objtool-args-y except for --werror).
This patch makes NOINSTR_VALIDATION just another OBJTOOL_DEFERRED
feature which runs deferred, and *not* on TUs, so now it gets all the
args like the others.
That was indeed non-obvious, I'll add it to the commit log for v2.
> > -endif
> >
> > vmlinux-objtool-args-$(CONFIG_NOINSTR_VALIDATION) += --noinstr \
> > $(if $(or $(CONFIG_MITIGATION_UNRET_ENTRY),$(CONFIG_MITIGATION_SRSO)), --unret)
--
Josh
next prev parent reply other threads:[~2026-08-28 18:19 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 4:51 [PATCH 00/27] objtool: dynamically detect noreturns Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 01/27] objtool: Remove obsolete noreturns.h entries Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 02/27] kbuild: Add CONFIG_OBJTOOL_DEFERRED Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 03/27] kbuild: Add CONFIG_OBJTOOL_CONTROL_FLOW Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 04/27] objtool: Fix dead end detection for sibling calls Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 05/27] objtool: Refactor the noreturn/dead-end detection Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 06/27] objtool: Ignore traps after noreturn calls in STT_CODE Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 07/27] objtool: Make .discard.stack_frame_non_standard non-allocatable Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 08/27] efi/libstub: Drop .discard.addressable from the stub objects Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 09/27] efi/loongarch: Mark loongarch efi_boot_kernel() non-standard for objtool Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 10/27] objtool: Add ANNOTATE_IGNORE_NORETURN() Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 11/27] LoongArch: Annotate reboot and kexec paths as returnable Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 12/27] kbuild: Defer running objtool to link time for all CFG features Josh Poimboeuf
2026-08-28 17:57 ` Nathan Chancellor
2026-08-28 18:19 ` Josh Poimboeuf [this message]
2026-08-28 19:27 ` Nathan Chancellor
2026-08-28 4:51 ` [PATCH 13/27] rust: Annotate the intrinsic stubs as returnable Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 14/27] panic: Mark abort() __noreturn Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 15/27] x86/xen: Ignore noreturn status of weak mem_map_via_hcall() Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 16/27] objtool: Detect noreturns in weak functions Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 17/27] x86/entry: Make rewind_stack_and_make_dead() a real function Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 18/27] x86/xen: Make xen_cpu_bringup_again() " Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 19/27] x86/xen: Make xen_start_kernel() noreturn Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 20/27] x86/boot: Rework how pi startup symbols get exposed to vmlinux Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 21/27] objtool: Fix noreturn detection for non-sibling jumps to SYM_CODE Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 22/27] objtool: Add options to write/read exported noreturns to/from a file Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 23/27] kbuild: Do the per-module objtool pass right before linking Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 24/27] kbuild: Generate the noreturn list and validate modules against it Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 25/27] objtool: Add ANNOTATE_EXPORTED_NORETURN() Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 26/27] objtool: Annotate all module-exported noreturns and remove noreturns.h Josh Poimboeuf
2026-08-28 4:51 ` [PATCH 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=apHOMecu7SAWR2zG@jpoimboe \
--to=jpoimboe@kernel.org \
--cc=ardb@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=gary@garyguo.net \
--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 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.