From: Ingo Molnar <mingo@kernel.org>
To: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Brendan Jackman <jackmanb@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 13/13] objtool: Add CONFIG_OBJTOOL_WERROR
Date: Sun, 16 Mar 2025 12:56:02 +0100 [thread overview]
Message-ID: <Z9a8Uign6ZBmWtZQ@gmail.com> (raw)
In-Reply-To: <isd5ptllbyya5rqzyr75w7b6vasnpyomnub22prdegr2jdodrv@75qx5eg5bppn>
* Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> On Sun, Mar 16, 2025 at 01:41:43AM +0100, Ingo Molnar wrote:
> > > +config OBJTOOL_WERROR
> > > + bool "Upgrade objtool warnings to errors"
> > > + default y
> > > + depends on OBJTOOL && !COMPILE_TEST
> > > + help
> > > + Fail the build on objtool warnings.
> >
> > This is *way* too aggressive: objtool false positives are still common,
>
> I'm not sure what false positives you'd be referring to, these days the
> vast majority of warnings I see are actual bugs.
I'm not sure we are reading the same kernel log :-)
A simple 'git log arch/x86/' followed by a search for objtool pointed
to the following recent commits:
#
# Included a fix for a false positive:
#
4e32645cd8f9 x86/smp: Fix mwait_play_dead() and acpi_processor_ffh_play_dead() noreturn behavior
#
# objtool poinpointed a problem that has no runtime effects,
# ie. it's a functional false positive and breaking the build
# for *that* would have been excessive:
#
73e8079be9e7 x86/ibt: Make cfi_bhi a constant for FINEIBT_BHI=n
#
# Commit works around an objtool false positive found during development:
#
b815f6877d80 x86/bhi: Add BHI stubs
#
# Commit works around what appears to be a objtool false positive
# about too aggressive code generation in function prologues:
# (An issue that does not seem to trigger in practice.)
#
4087e16b0331 x86/locking: Use ALT_OUTPUT_SP() for percpu_{,try_}cmpxchg{64,128}_op()
I literally tried to find the first *actual* bug that objtool prevented
and the first 4 appear to be struggles with objtool over false
positives or non-runtime-bugs.
At least in x86 architecture code a significant percentage of objtool
warnings isn't bugs - and to be fair that's maybe in part due to the
lockdep effect: developers notice warnings and prevent them, so only
traces of false positives trickle into the kernel. But lockdep too
tries to be rather benign and doesn't crash the kernel, it reports an
issue and turns itself off.
> > and an 'allmodconfig' should not fail the build IMO.
>
> In fact it doesn't: allmodconfig sets COMPILE_TEST which prevents
> OBJTOOL_WERROR.
Okay, I missed that bit. But the patch still has a 'default y' that
causes people who didn't have it to enable it by default, right?
> I've had complaints from people who spent days debugging a broken
> kernel only to discover it was related to an ignored objtool warning.
Same could be said about an ignored lockdep warnings, right?
As long as OBJTOOL_WERROR doesn't get turned on in the primary 8 build
modes:
all{mod|yes|no|def}config
and we don't turn it on via default-y I'm a happy camper.
Thanks,
Ingo
next prev parent reply other threads:[~2025-03-16 11:56 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-14 19:28 [PATCH 00/13] Fail the build on objtool warnings Josh Poimboeuf
2025-03-14 19:28 ` [PATCH 01/13] x86/traps: Make exc_double_fault() consistently noreturn Josh Poimboeuf
2025-03-17 8:26 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 10:47 ` [PATCH 01/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 02/13] objtool: Fix error handling inconsistencies in check() Josh Poimboeuf
2025-03-17 8:29 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 10:47 ` [PATCH 02/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 03/13] objtool: Improve __noreturn annotation warning Josh Poimboeuf
2025-03-17 8:31 ` Brendan Jackman
2025-03-17 10:36 ` Miroslav Benes
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-14 19:29 ` [PATCH 04/13] objtool: Update documentation Josh Poimboeuf
2025-03-17 8:47 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 10:46 ` [PATCH 04/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 05/13] objtool: Increase per-function WARN_FUNC() rate limit Josh Poimboeuf
2025-03-17 9:15 ` Brendan Jackman
2025-03-17 12:29 ` Miroslav Benes
2025-03-18 10:59 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-14 19:29 ` [PATCH 06/13] objtool: Remove --unret dependency on --rethunk Josh Poimboeuf
2025-03-14 19:38 ` Peter Zijlstra
2025-03-14 19:52 ` Josh Poimboeuf
2025-03-14 19:58 ` Peter Zijlstra
2025-03-17 12:33 ` Miroslav Benes
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-14 19:29 ` [PATCH 07/13] objtool: Consolidate option validation Josh Poimboeuf
2025-03-17 9:19 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 12:35 ` [PATCH 07/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 08/13] objtool: Upgrade "Linked object detected" warning to error Josh Poimboeuf
2025-03-17 9:21 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 12:38 ` [PATCH 08/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 09/13] objtool: Add --output option Josh Poimboeuf
2025-03-17 9:40 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 12:48 ` [PATCH 09/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 10/13] objtool: Add --Werror option Josh Poimboeuf
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 12:53 ` [PATCH 10/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 11/13] objtool: Change "warning:" to "error:" for --Werror Josh Poimboeuf
2025-03-17 9:42 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 13:04 ` [PATCH 11/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 12/13] objtool: Create backup on error and print args Josh Poimboeuf
2025-03-17 9:53 ` Brendan Jackman
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 14:09 ` [PATCH 12/13] " Miroslav Benes
2025-03-14 19:29 ` [PATCH 13/13] objtool: Add CONFIG_OBJTOOL_WERROR Josh Poimboeuf
2025-03-16 0:41 ` Ingo Molnar
2025-03-16 1:49 ` Josh Poimboeuf
2025-03-16 11:56 ` Ingo Molnar [this message]
2025-03-18 4:55 ` Josh Poimboeuf
2025-03-17 10:46 ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-03-17 11:07 ` tip-bot2 for Josh Poimboeuf
2025-03-17 21:27 ` Ingo Molnar
2025-03-18 0:05 ` Josh Poimboeuf
2025-03-20 17:10 ` Steven Rostedt
2025-03-18 11:51 ` Ingo Molnar
2025-03-18 14:26 ` Josh Poimboeuf
2025-03-20 8:51 ` Ingo Molnar
2025-03-18 0:27 ` Josh Poimboeuf
2025-03-18 4:59 ` Josh Poimboeuf
2025-03-17 14:14 ` [PATCH 13/13] " Miroslav Benes
2025-03-23 7:50 ` 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=Z9a8Uign6ZBmWtZQ@gmail.com \
--to=mingo@kernel.org \
--cc=jackmanb@google.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.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