From: Peter Zijlstra <peterz@infradead.org>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: "Josh Poimboeuf" <jpoimboe@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH] objtool/rust: add one more `noreturn` Rust function
Date: Mon, 20 Oct 2025 12:51:54 +0200 [thread overview]
Message-ID: <20251020105154.GR3419281@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20251020020714.2511718-1-ojeda@kernel.org>
On Mon, Oct 20, 2025 at 04:07:14AM +0200, Miguel Ojeda wrote:
> Between Rust 1.79 and 1.86, under `CONFIG_RUST_KERNEL_DOCTESTS=y`,
> `objtool` may report:
>
> rust/doctests_kernel_generated.o: warning: objtool:
> rust_doctest_kernel_alloc_kbox_rs_13() falls through to next
> function rust_doctest_kernel_alloc_kvec_rs_0()
>
> (as well as in rust_doctest_kernel_alloc_kvec_rs_0) due to calls to the
> `noreturn` symbol:
>
> core::option::expect_failed
>
> from code added in commits 779db37373a3 ("rust: alloc: kvec: implement
> AsPageIter for VVec") and 671618432f46 ("rust: alloc: kbox: implement
> AsPageIter for VBox").
>
> Thus add the mangled one to the list so that `objtool` knows it is
> actually `noreturn`.
>
> This can be reproduced as well in other versions by tweaking the code,
> such as the latest stable Rust (1.90.0).
>
> Stable does not have code that triggers this, but it could have it in
> the future. Downstream forks could too. Thus tag it for backport.
>
> See commit 56d680dd23c3 ("objtool/rust: list `noreturn` Rust functions")
> for more details.
>
> Cc: stable@vger.kernel.org # Needed in 6.12.y and later.
> Cc: Josh Poimboeuf <jpoimboe@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
> ---
> tools/objtool/check.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index a5770570b106..3c7ab910b189 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -217,6 +217,7 @@ static bool is_rust_noreturn(const struct symbol *func)
> * these come from the Rust standard library).
> */
> return str_ends_with(func->name, "_4core5sliceSp15copy_from_slice17len_mismatch_fail") ||
> + str_ends_with(func->name, "_4core6option13expect_failed") ||
> str_ends_with(func->name, "_4core6option13unwrap_failed") ||
> str_ends_with(func->name, "_4core6result13unwrap_failed") ||
> str_ends_with(func->name, "_4core9panicking5panic") ||
>
I'll go stick it in tip/objtool/core; but I gotta ask, where are we with
the toolchain support for noreturn?
next prev parent reply other threads:[~2025-10-21 17:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 2:07 [PATCH] objtool/rust: add one more `noreturn` Rust function Miguel Ojeda
2025-10-20 8:17 ` Alice Ryhl
2025-10-20 10:51 ` Peter Zijlstra [this message]
2025-10-21 17:25 ` Miguel Ojeda
2025-10-22 8:13 ` Peter Zijlstra
-- strict thread matches above, loose matches on Subject: below --
2026-02-06 20:43 Miguel Ojeda
2026-02-10 10:03 ` Miguel Ojeda
2025-04-13 0:23 Miguel Ojeda
2025-04-14 14:07 ` Alice Ryhl
2025-04-14 15:08 ` Miguel Ojeda
2025-01-12 14:39 Miguel Ojeda
2025-01-12 14:47 ` Miguel Ojeda
2025-01-12 14:54 ` Greg KH
2025-01-15 19:25 ` Gary Guo
2025-02-12 22:28 ` Miguel Ojeda
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=20251020105154.GR3419281@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmgross@umich.edu \
/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