[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020105154.GR3419281@noisy.programming.kicks-ass.net>
Date: Mon, 20 Oct 2025 12:51:54 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Miguel Ojeda <ojeda@...nel.org>
Cc: Josh Poimboeuf <jpoimboe@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
stable@...r.kernel.org
Subject: Re: [PATCH] objtool/rust: add one more `noreturn` Rust function
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@...r.kernel.org # Needed in 6.12.y and later.
> Cc: Josh Poimboeuf <jpoimboe@...nel.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Signed-off-by: Miguel Ojeda <ojeda@...nel.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?
Powered by blists - more mailing lists