From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D74EF324B16; Wed, 1 Apr 2026 11:46:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043975; cv=none; b=s3UgFMSLAF6O4xEm71hbAT7gz5+IS6jZkhdcNdlyO6jC0mRPl38ITChOyO2xcRLZnrRNGJxGUx1vSFNFwk4U1hCYEIBl+5EtGyRx78TXK25boMzUCG+DK+yXudhsCo/COJHhuKZeCyKHl0V/oFtCqVFcbfaAa70m4DIH3tAUmUM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043975; c=relaxed/simple; bh=ee9ui+LCdpJHl0TldbW+Hj1cIbucU9apUqrPLbY+gwA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s+sCX8EtTW6ef9bu1G5Ixyxh9LMkXepSqOdhZheUrcFr4HFscDibKGS0Ygy97o4Wm5yDxg1bteH/i54Zzwt/03zxDkVO7RInukdMb4JlWyque8u2pWhaRSzZAzYr9rP/NvcXXG45yXcGQg63jWSHgVDzttgJ64BBBPEwmogTlbY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KRqDupu+; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KRqDupu+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 314CBC4CEF7; Wed, 1 Apr 2026 11:46:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775043975; bh=ee9ui+LCdpJHl0TldbW+Hj1cIbucU9apUqrPLbY+gwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KRqDupu+DKvNmwW+4j5ymsnMQyV8FjWKLKLMuRfJUaFNjjRl8TChFt1O49A4LriR4 aCxNadQPRYWuZCjWbo1G44JNcreCgipEpTp25HG8+WRGEQpYq7kENnhi95ZvkothfB 1r+PascAFPeFUZ3UdnavVyKxTrY5sFckDghBLAV95wFV/7g0t8aY2T6Fli7cVnPYN5 rkQQwfKcvN45XkZT1HU8FQsC/R0ookEadJs+Fu2CukxnkXqGoBe7jjSw5pUxfGmltp jaO17kwZAxx2dXVmEEDxPcOzWr8F1PnIUzJ/2t3S/iYg3yjijoVzP0yNPKxQ0FAq8T OxPArPyTGQbbQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 01/33] rust: bump Rust minimum supported version to 1.85.0 (Debian Trixie) Date: Wed, 1 Apr 2026 13:45:08 +0200 Message-ID: <20260401114540.30108-2-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As proposed in the past in e.g. LPC 2025 and the Maintainers Summit [1], we are going to follow Debian Stable's Rust versions as our minimum supported version. Debian Trixie was released with a Rust 1.85.0 toolchain [2], which it still uses to this day [3] (i.e. no update to Rust 1.85.1). Debian Trixie's release happened on 2025-08-09 [4], which means that a fair amount of time has passed since its release for kernel developers to upgrade. Thus bump the minimum to the new version. Then, in later commits, clean up most of the workarounds and other bits that this upgrade of the minimum allows us. pin-init was left as-is since the patches come from upstream. And the vendored crates are unmodified, since we do not want to change those. Note that the minimum LLVM major version for Rust 1.85.0 is LLVM 18 (the Rust upstream binaries use LLVM 19.1.7), thus e.g. `RUSTC_LLVM_VERSION` tests can also be updated, but there are no suitable ones to simplify. Ubuntu 25.10 also has a recent enough Rust toolchain [5], and they also provide versioned packages with a Rust 1.85.1 toolchain even back to Ubuntu 22.04 LTS [6]. Link: https://lwn.net/Articles/1050174/ [1] Link: https://www.debian.org/releases/trixie/release-notes/whats-new.en.htm= l#desktops-and-well-known-packages [2] Link: https://packages.debian.org/trixie/rustc [3] Link: https://www.debian.org/releases/trixie/ [4] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Drustc [5] Link: https://launchpad.net/ubuntu/+source/rustc-1.85 [6] Signed-off-by: Miguel Ojeda Acked-by: Alice Ryhl Acked-by: Benno Lossin Acked-by: Danilo Krummrich Acked-by: Gary Guo --- Documentation/process/changes.rst | 2 +- scripts/min-tool-version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/chan= ges.rst index 6b373e193548..474594bd4831 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -31,7 +31,7 @@ you probably needn't concern yourself with pcmciautils. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D GNU C 8.1 gcc --version Clang/LLVM (optional) 15.0.0 clang --version -Rust (optional) 1.78.0 rustc --version +Rust (optional) 1.85.0 rustc --version bindgen (optional) 0.65.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index 99b5575c1ef7..a270ec761f64 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -31,7 +31,7 @@ llvm) fi ;; rustc) - echo 1.78.0 + echo 1.85.0 ;; bindgen) echo 0.65.1 --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ACC59346ADE; Wed, 1 Apr 2026 11:46:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043987; cv=none; b=RTDRlFU+Fc4wfrL1cT+HECNcxgj+NPQ59P1t+UHQGGV747eYcXCF1zv/tU5ICifALKBHvgoDNHllKr9TI4V0w7iOaJ+SRLUx7mZ9JVoRpG7DfpsSuyyN4vo3OvsvUnq945wv9iEnt8+WRyKZdnSqqd3KjqJGLmc55Ugdbn/9Xoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043987; c=relaxed/simple; bh=bANzQfGdC4IAbhvKXuBQNZWwfHWEIkonTSD/l3eSFWo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t/k/rfH0kBJqnxDHZkufsDt/BKzcvNRsG1DqMebejY/fr7YKBHv9AoEGmePKLGJIcNOWnL37kw3h/MGfSYBzgrTzD1gjEA0p8yge1eGMl8Elt1BtmBrwPs51ueoqmiZAGQQpkLVJBPsYl20Km4aoNUNhnmRCj6rhWVwk0+lSaoE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hL4sHbvE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hL4sHbvE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 065A7C4CEF7; Wed, 1 Apr 2026 11:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775043987; bh=bANzQfGdC4IAbhvKXuBQNZWwfHWEIkonTSD/l3eSFWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hL4sHbvEsNWJiay38u1aNlo7H43VBJ1sQkn95Zz3Zvo78hQs4urrxoY3PVbkzKt0l lwmTMIaJi+qiU2KMGU6vLKoGsiBAHAkiLOEOtbt9u9OHlSIILM04QabgoVY8JAqGM2 ktOh+LvLdSPlD4TAGMErsb3sfuWdamUxchSdksVBIJ38zHPuP7Z3j73xQdW7tKiEjL 3P1B2oMo9xQQOERf8nSXdYHlAeXuO4SJJzjQaIXxzPUJD3XBzD1RAtErQhOQJcGTnV k195Z2x0u87K/wOQvxUzbhoRq0DOWDo6GjE0Ys09MiK0M4d5vrYQEjsZvmtaKni/FB Nn2gr6YtVmP8w== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 02/33] rust: bump Clippy's MSRV and clean `incompatible_msrv` allows Date: Wed, 1 Apr 2026 13:45:09 +0200 Message-ID: <20260401114540.30108-3-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the Rust compiler bump, we can now update Clippy's MSRV we set in the configuration, which will improve the diagnostics it generates. Thus do so and clean a few of the `allow`s that are not needed anymore. Signed-off-by: Miguel Ojeda Acked-by: Danilo Krummrich Reviewed-by: Gary Guo --- .clippy.toml | 2 +- drivers/gpu/nova-core/gsp/cmdq.rs | 6 +----- rust/kernel/ptr.rs | 1 - rust/kernel/transmute.rs | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index a51de9a46380..b0a78cc8be20 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 =20 -msrv =3D "1.78.0" +msrv =3D "1.85.0" =20 check-private-items =3D true =20 diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/= cmdq.rs index 46819a82a51a..d9f69366642a 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -281,7 +281,6 @@ fn allocate_command(&mut self, size: usize) -> Result> { let (slice_1, slice_2) =3D { let (slice_1, slice_2) =3D self.driver_write_area(); =20 - #[allow(clippy::incompatible_msrv)] (slice_1.as_flattened_mut(), slice_2.as_flattened_mut()) }; =20 @@ -572,10 +571,7 @@ fn wait_for_msg(&self, timeout: Delta) -> Result> { Delta::from_millis(1), timeout, ) - .map(|(slice_1, slice_2)| { - #[allow(clippy::incompatible_msrv)] - (slice_1.as_flattened(), slice_2.as_flattened()) - })?; + .map(|(slice_1, slice_2)| (slice_1.as_flattened(), slice_2.as_flat= tened()))?; =20 // Extract the `GspMsgElement`. let (header, slice_1) =3D GspMsgElement::from_bytes_prefix(slice_1= ).ok_or(EIO)?; diff --git a/rust/kernel/ptr.rs b/rust/kernel/ptr.rs index 512e2eabe3ad..bd669e74e1cc 100644 --- a/rust/kernel/ptr.rs +++ b/rust/kernel/ptr.rs @@ -81,7 +81,6 @@ pub const fn new_checked(align: usize) -> Option { /// This is equivalent to [`align_of`], but with the return value prov= ided as an [`Alignment`]. #[inline(always)] pub const fn of() -> Self { - #![allow(clippy::incompatible_msrv)] // This cannot panic since alignments are always powers of two. // // We unfortunately cannot use `new` as it would require the `gene= ric_const_exprs` feature. diff --git a/rust/kernel/transmute.rs b/rust/kernel/transmute.rs index 5711580c9f9b..b9e6eadc08f5 100644 --- a/rust/kernel/transmute.rs +++ b/rust/kernel/transmute.rs @@ -49,7 +49,6 @@ fn from_bytes(bytes: &[u8]) -> Option<&Self> let slice_ptr =3D bytes.as_ptr().cast::(); let size =3D size_of::(); =20 - #[allow(clippy::incompatible_msrv)] if bytes.len() =3D=3D size && slice_ptr.is_aligned() { // SAFETY: Size and alignment were just checked. unsafe { Some(&*slice_ptr) } @@ -92,7 +91,6 @@ fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self> let slice_ptr =3D bytes.as_mut_ptr().cast::(); let size =3D size_of::(); =20 - #[allow(clippy::incompatible_msrv)] if bytes.len() =3D=3D size && slice_ptr.is_aligned() { // SAFETY: Size and alignment were just checked. unsafe { Some(&mut *slice_ptr) } --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C7CF401A06; Wed, 1 Apr 2026 11:46:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043999; cv=none; b=Qqlx6r5odYAzw1qSTXzi04OgW8m/22XeBYNDORqvamHpLwXYu8uio1s5Ag6d/p8tC85brEZMcapUX7WyFgfCsYCjeNo3gxGnpwRW+C8JpVUPFiQ1Ifk3AzJvnx4lBqcg/Hp9mk8jDhPfDHEjFte1OkkJZhTgLCN2zfjZWI2m9Dw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775043999; c=relaxed/simple; bh=mx6ZzwYZD/l+CT6smdZwRkePe/ogwpikx6oQbCZtXnE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D9vKQDKSRCoiPkvnTwUCJIIev1UBxsG1fUqsgPXALgIcJ8PhCf9Q6ycxF4Jyi24aRjhpewavzssHh5rqmrsb55E1wlwPx/F6ADqKJbr2IsqveLsv12gwHdLZpDlUEATlx7JtQs+V2Zw2K/UTTB0dDdFRUIi0fuN0pv11wRmClFM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IC7ucAQn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IC7ucAQn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA9D4C116C6; Wed, 1 Apr 2026 11:46:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775043999; bh=mx6ZzwYZD/l+CT6smdZwRkePe/ogwpikx6oQbCZtXnE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IC7ucAQnVkndR7ChPPc0lrrY93rjZt8+FXlKYow5FhPAUcgRIJ6vkDf1B97slIFSF rjhuIH7tqMm7bMjMtan4SHkTNIYJO4WYYQsOdwTJQaA2JEj8puX36B/Jv6MvnDT+Jj FyETPXeepd1WLVhdSUOO/mLj/ukokooeVmCujRO5BPBFgA6K3rftlGfEbR+ZOgh8iX diigcnBbQUlQcWklv2ABotZPDZct8rOw9kSKePGAwqiC89bbfWfMFV3jp29aCp47R0 sWWBc17mT0LMstHWxRcNniaUHF/vI1dTtIZL59bASZjnri6+Om3XyWc14QOHjUyxZQ o2GgSZLrfRn/A== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 03/33] rust: simplify `RUSTC_VERSION` Kconfig conditions Date: Wed, 1 Apr 2026 13:45:10 +0200 Message-ID: <20260401114540.30108-4-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With the Rust version bump in place, several Kconfig conditions based on `RUSTC_VERSION` are always true. Thus simplify them. The minimum supported major LLVM version by our new Rust minimum version is now LLVM 18, instead of LLVM 16. However, there are no possible cleanups for `RUSTC_LLVM_VERSION`. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- arch/Kconfig | 3 +-- arch/arm64/Kconfig | 8 -------- arch/riscv/Kconfig | 3 --- init/Kconfig | 2 -- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 102ddbd4298e..84089e80584b 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -968,10 +968,9 @@ config HAVE_CFI_ICALL_NORMALIZE_INTEGERS config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC def_bool y depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS - depends on RUSTC_VERSION >=3D 107900 depends on ARM64 || X86_64 # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pul= l/129373 - depends on (RUSTC_LLVM_VERSION >=3D 190103 && RUSTC_VERSION >=3D 108200) = || \ + depends on RUSTC_LLVM_VERSION >=3D 190103 || \ (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS) =20 config CFI_PERMISSIVE diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 38dba5f7e4d2..c91130c7fba1 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -291,14 +291,6 @@ config ARM64 config RUSTC_SUPPORTS_ARM64 def_bool y depends on CPU_LITTLE_ENDIAN - # Shadow call stack is only supported on certain rustc versions. - # - # When using the UNWIND_PATCH_PAC_INTO_SCS option, rustc version 1.80+ is - # required due to use of the -Zfixed-x18 flag. - # - # Otherwise, rustc version 1.82+ is required due to use of the - # -Zsanitizer=3Dshadow-call-stack flag. - depends on !SHADOW_CALL_STACK || RUSTC_VERSION >=3D 108200 || RUSTC_VERSI= ON >=3D 108000 && UNWIND_PATCH_PAC_INTO_SCS =20 config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS def_bool CC_IS_CLANG diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 90c531e6abf5..ddc534402400 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -232,9 +232,6 @@ config RISCV config RUSTC_SUPPORTS_RISCV def_bool y depends on 64BIT - # Shadow call stack requires rustc version 1.82+ due to use of the - # -Zsanitizer=3Dshadow-call-stack flag. - depends on !SHADOW_CALL_STACK || RUSTC_VERSION >=3D 108200 =20 config CLANG_SUPPORTS_DYNAMIC_FTRACE def_bool CC_IS_CLANG diff --git a/init/Kconfig b/init/Kconfig index 36d32ea44594..b8a1ab0d49d4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2193,9 +2193,7 @@ config RUST depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC select CFI_ICALL_NORMALIZE_INTEGERS if CFI - depends on !CALL_PADDING || RUSTC_VERSION >=3D 108100 depends on !KASAN_SW_TAGS - depends on !(MITIGATION_RETHUNK && KASAN) || RUSTC_VERSION >=3D 108300 help Enables Rust support in the kernel. =20 --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E670324B16; Wed, 1 Apr 2026 11:46:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044011; cv=none; b=pH3V4ck5LdCoexCbwWTS7tExcbGukFlWvnDnxzNb62iO/ITZThFqfe6fVE4/D4RToy0q20EJu0z0M5pLMC4MFPXNvp4tT3xelLApsKGbfPhHC/u8xAjPks9+xyDcn3BYPX+ufNunTYT8USuDFEeCmc7qsLwqkXXM55v/oEffI14= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044011; c=relaxed/simple; bh=e8DhGnWyulpeNMl4zQDOtzs8M6k0lQwkocXJf8Znql4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NaGanF02o4RoL328QSK54zaacB8WeKzXO5+0u8d47APx4imXYGgHSsHIdUgeDFgFfv492sEwf+wvxHqcioozgmdct+ymnw+o5x9Xu2HymfOllHjg3d+DhM07giWc8jGmXHeLnEWgmhegemcSUYwuy8p06TXuOPwIqQ5RsrDMZPI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CndxmCi7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CndxmCi7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E848C4AF0C; Wed, 1 Apr 2026 11:46:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044010; bh=e8DhGnWyulpeNMl4zQDOtzs8M6k0lQwkocXJf8Znql4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CndxmCi7THhrnhCFzhqy6KvbAgEkGaA5pYgccV/CQjuh3yuwhgtAGKi7YOptKJvyo kqULk/HwSV6RulLc0BWsv4O79mDs8iMcZCf91sdFQFz50VKP0sjsIyfBh+0qQeCTdo rCvPjk9C4McT1wKkvlhKcCB4WTzc75OK8oXNtoIsN5ZrjbB14gsu4pP4ZuffkXa6E+ GnVppQRnM/P0zARZDYa4UbsPlNPZHeWHpRT83O3pCygzfG7boiRlqXD0Fx8HTVqGdP fptMVM7dF4BLILbhiF62wWFdnCWOMxzNVvxybKbvshYWAqQq96KPt5nO0sw2WFo9Bf 3EKqN9cfSKgzA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 04/33] rust: remove `RUSTC_HAS_SLICE_AS_FLATTENED` and simplify code Date: Wed, 1 Apr 2026 13:45:11 +0200 Message-ID: <20260401114540.30108-5-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With the Rust version bump in place, the `RUSTC_HAS_SLICE_AS_FLATTENED` Kconfig (automatic) option is always true. Thus remove the option and simplify the code. In particular, this includes removing the `slice` module which contained the temporary slice helpers, i.e. the `AsFlattened` extension trait and its `impl`s. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- init/Kconfig | 3 --- rust/kernel/lib.rs | 1 - rust/kernel/prelude.rs | 3 --- rust/kernel/slice.rs | 49 ------------------------------------------ 4 files changed, 56 deletions(-) delete mode 100644 rust/kernel/slice.rs diff --git a/init/Kconfig b/init/Kconfig index b8a1ab0d49d4..c38f49228157 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -178,9 +178,6 @@ config LD_CAN_USE_KEEP_IN_OVERLAY # https://github.com/llvm/llvm-project/pull/130661 def_bool LD_IS_BFD || LLD_VERSION >=3D 210000 =20 -config RUSTC_HAS_SLICE_AS_FLATTENED - def_bool RUSTC_VERSION >=3D 108000 - config RUSTC_HAS_COERCE_POINTEE def_bool RUSTC_VERSION >=3D 108400 =20 diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 138d846f798d..621cae75030c 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -140,7 +140,6 @@ pub mod security; pub mod seq_file; pub mod sizes; -pub mod slice; #[cfg(CONFIG_SOC_BUS)] pub mod soc; #[doc(hidden)] diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index 6a54597fa0a2..1cf051b83394 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -53,6 +53,3 @@ pub use super::current; =20 pub use super::uaccess::UserPtr; - -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -pub use super::slice::AsFlattened; diff --git a/rust/kernel/slice.rs b/rust/kernel/slice.rs deleted file mode 100644 index ca2cde135061..000000000000 --- a/rust/kernel/slice.rs +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -//! Additional (and temporary) slice helpers. - -/// Extension trait providing a portable version of [`as_flattened`] and -/// [`as_flattened_mut`]. -/// -/// In Rust 1.80, the previously unstable `slice::flatten` family of metho= ds -/// have been stabilized and renamed from `flatten` to `as_flattened`. -/// -/// This creates an issue for as long as the MSRV is < 1.80, as the same f= unctionality is provided -/// by different methods depending on the compiler version. -/// -/// This extension trait solves this by abstracting `as_flatten` and calli= ng the correct method -/// depending on the Rust version. -/// -/// This trait can be removed once the MSRV passes 1.80. -/// -/// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#m= ethod.as_flattened -/// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slice.ht= ml#method.as_flattened_mut -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -pub trait AsFlattened { - /// Takes a `&[[T; N]]` and flattens it to a `&[T]`. - /// - /// This is an portable layer on top of [`as_flattened`]; see its docu= mentation for details. - /// - /// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.ht= ml#method.as_flattened - fn as_flattened(&self) -> &[T]; - - /// Takes a `&mut [[T; N]]` and flattens it to a `&mut [T]`. - /// - /// This is an portable layer on top of [`as_flattened_mut`]; see its = documentation for details. - /// - /// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slic= e.html#method.as_flattened_mut - fn as_flattened_mut(&mut self) -> &mut [T]; -} - -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -impl AsFlattened for [[T; N]] { - #[allow(clippy::incompatible_msrv)] - fn as_flattened(&self) -> &[T] { - self.flatten() - } - - #[allow(clippy::incompatible_msrv)] - fn as_flattened_mut(&mut self) -> &mut [T] { - self.flatten_mut() - } -} --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F366324B16; Wed, 1 Apr 2026 11:47:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044023; cv=none; b=PKfjfAZT7V1qjQ5LRVHztJME0uajZXBqFW4LsRLvm5A28Ap+WvR/UubCUkIKalYarn1/PK6Ctwv6bMsmdnbDeJVstpJHMBNEpiKR4ZOHXUc/t6BuJSTtx3PBmACLV6l3v03OoC08kC0o01nGDQ8BGVGi8WOEMSs/65ZYY+76mFM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044023; c=relaxed/simple; bh=Mw52drxgGUxVV9g2ax+bN00+Y+DwaOQAPKLe9BmgAy4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F8Cc8z0CZ4zM37MExkDCppZ05hU0EOfG4zPxFtH/6cRaIUCE7symOyEosLqkiLVxhEvPuHH9wY1WYPMm1bTdGvTYdONUt7MtZTgJBtJFv/KMxlBYfE9gruDj3zztZcSwgEsLW7IDLNbeRZgu3hv3XU7dcaKUJzIWK0CL51tkX7c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ugWT6S5R; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ugWT6S5R" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74DC6C4CEF7; Wed, 1 Apr 2026 11:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044022; bh=Mw52drxgGUxVV9g2ax+bN00+Y+DwaOQAPKLe9BmgAy4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ugWT6S5Rks7JPny9Cbv3J54JQDqN0ZafIZl0tQRG/BsxkABfq5N56hz+HGTTf4QwF WiRyg2jtIsN33RPoZYMpId+EKAU/CCVoqlxQN7bAyCsVHubJ+dATwyolmxDU4YviB4 CD485eQ2RG865GItyQC+jO2K13LW0xStFtW/2mDspeDXwll7+7RMFrp7wAJVqIvOPB 3yxUZk54m4wYSUVjV/ZpEBfRxXXEMB2aVcfp87afwcWiqgJaFe1PFleNMQyyYcnIuO K6iyTtLE89a2gaj8ngxnXrUkrvnmoIUYwXrtSpIRfgZzJ33g4NEK+z4JXxJ7jUr7kd C+bsywMkeukpg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 05/33] rust: remove `RUSTC_HAS_COERCE_POINTEE` and simplify code Date: Wed, 1 Apr 2026 13:45:12 +0200 Message-ID: <20260401114540.30108-6-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With the Rust version bump in place, the `RUSTC_HAS_COERCE_POINTEE` Kconfig (automatic) option is always true. Thus remove the option and simplify the code. In particular, this includes removing our use of the predecessor unstable features we used with Rust < 1.84.0 (`coerce_unsized`, `dispatch_from_dyn` and `unsize`). Signed-off-by: Miguel Ojeda Acked-by: Danilo Krummrich Reviewed-by: Gary Guo --- init/Kconfig | 3 --- rust/kernel/alloc/kbox.rs | 29 ++--------------------------- rust/kernel/lib.rs | 8 +------- rust/kernel/list/arc.rs | 22 +--------------------- rust/kernel/sync/arc.rs | 21 ++------------------- 5 files changed, 6 insertions(+), 77 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index c38f49228157..f9fac458e4d4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -178,9 +178,6 @@ config LD_CAN_USE_KEEP_IN_OVERLAY # https://github.com/llvm/llvm-project/pull/130661 def_bool LD_IS_BFD || LLD_VERSION >=3D 210000 =20 -config RUSTC_HAS_COERCE_POINTEE - def_bool RUSTC_VERSION >=3D 108400 - config RUSTC_HAS_SPAN_FILE def_bool RUSTC_VERSION >=3D 108800 =20 diff --git a/rust/kernel/alloc/kbox.rs b/rust/kernel/alloc/kbox.rs index 622b3529edfc..bd6da02c7ab8 100644 --- a/rust/kernel/alloc/kbox.rs +++ b/rust/kernel/alloc/kbox.rs @@ -77,33 +77,8 @@ /// `self.0` is always properly aligned and either points to memory alloca= ted with `A` or, for /// zero-sized types, is a dangling, well aligned pointer. #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] -pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?S= ized, A: Allocator>( - NonNull, - PhantomData, -); - -// This is to allow coercion from `Box` to `Box` if `T` can be= converted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::CoerceUnsized> for Box -where - T: ?Sized + core::marker::Unsize, - U: ?Sized, - A: Allocator, -{ -} - -// This is to allow `Box` to be dispatched on when `Box` can b= e coerced into `Box`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::DispatchFromDyn> for Box -where - T: ?Sized + core::marker::Unsize, - U: ?Sized, - A: Allocator, -{ -} +#[derive(core::marker::CoercePointee)] +pub struct Box<#[pointee] T: ?Sized, A: Allocator>(NonNull, PhantomData= ); =20 /// Type alias for [`Box`] with a [`Kmalloc`] allocator. /// diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 621cae75030c..66a09d77a2c4 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -39,17 +39,11 @@ // // Expected to become stable. #![feature(arbitrary_self_types)] +#![feature(derive_coerce_pointee)] // // To be determined. #![feature(used_with_arg)] // -// `feature(derive_coerce_pointee)` is expected to become stable. Before R= ust -// 1.84.0, it did not exist, so enable the predecessor features. -#![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee= ))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(coerce_unsized))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(dispatch_from_dy= n))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(unsize))] -// // `feature(file_with_nul)` is expected to become stable. Before Rust 1.89= .0, it did not exist, so // enable it conditionally. #![cfg_attr(CONFIG_RUSTC_HAS_FILE_WITH_NUL, feature(file_with_nul))] diff --git a/rust/kernel/list/arc.rs b/rust/kernel/list/arc.rs index e1082423909c..a9a2b0178f65 100644 --- a/rust/kernel/list/arc.rs +++ b/rust/kernel/list/arc.rs @@ -160,7 +160,7 @@ fn try_new_list_arc(&self) -> bool { /// /// [`List`]: crate::list::List #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct ListArc where T: ListArcSafe + ?Sized, @@ -443,26 +443,6 @@ fn as_ref(&self) -> &Arc { } } =20 -// This is to allow coercion from `ListArc` to `ListArc` if `T` can = be converted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::CoerceUnsized> for Lis= tArc -where - T: ListArcSafe + core::marker::Unsize + ?Sized, - U: ListArcSafe + ?Sized, -{ -} - -// This is to allow `ListArc` to be dispatched on when `ListArc` can= be coerced into -// `ListArc`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::DispatchFromDyn> for L= istArc -where - T: ListArcSafe + core::marker::Unsize + ?Sized, - U: ListArcSafe + ?Sized, -{ -} - /// A utility for tracking whether a [`ListArc`] exists using an atomic. /// /// # Invariants diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 921e19333b89..18d6c0d62ce0 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -128,7 +128,7 @@ /// # Ok::<(), Error>(()) /// ``` #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct Arc { ptr: NonNull>, // NB: this informs dropck that objects of type `ArcInner` may be u= sed in ` as @@ -182,15 +182,6 @@ unsafe fn container_of(ptr: *const T) -> NonNull> { } } =20 -// This is to allow coercion from `Arc` to `Arc` if `T` can be conve= rted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::CoerceUnsi= zed> for Arc {} - -// This is to allow `Arc` to be dispatched on when `Arc` can be coer= ced into `Arc`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::DispatchFr= omDyn> for Arc {} - // SAFETY: It is safe to send `Arc` to another thread when the underlyi= ng `T` is `Sync` because // it effectively means sharing `&T` (which is safe because `T` is `Sync`)= ; additionally, it needs // `T` to be `Send` because any thread that has an `Arc` may ultimately= access `T` using a @@ -547,20 +538,12 @@ fn from(item: Pin>) -> Self { /// # Ok::<(), Error>(()) /// ``` #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct ArcBorrow<'a, T: ?Sized + 'a> { inner: NonNull>, _p: PhantomData<&'a ()>, } =20 -// This is to allow `ArcBorrow` to be dispatched on when `ArcBorrow`= can be coerced into -// `ArcBorrow`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::DispatchFr= omDyn> - for ArcBorrow<'_, T> -{ -} - impl Clone for ArcBorrow<'_, T> { fn clone(&self) -> Self { *self --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0BCB324B16; Wed, 1 Apr 2026 11:47:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044034; cv=none; b=XLBOFgl6jTGu/dzASG7SJ/Z59j+ZOcpVy7KAlzFwYys6GWjX88vMj3+NBZD3Z8dzHZEyh6GzUp1hluqVtnqM60sNIcMtmPGc6+rAO3BCWfB+pVDfYE/zHh27lUhz8EwHt7KqHjWRoUpkzeq6NXGC9r6mdn+DhyCP/MmDb3jZoHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044034; c=relaxed/simple; bh=4gM8Ng4dI5voGspd2MW/G8qAzYExygP7OS8buaoRZDg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rsekS2W0BRtVHZky3zdzksU1FFSS/kBPfpb0bv072yDRl8bdc8ovCaG3vLrxbKygp+hnc4I3ao6aB71E54DDthVM04vaHCO2OEjA+AUwIeJPqzI9kkVqKUeuYg2Dkskx8iGxOsKIN+VBqW0vfY12CWEUGyn7Z6R0WFXU/Fof9VE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ht/pJf8b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ht/pJf8b" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 439C6C4CEF7; Wed, 1 Apr 2026 11:47:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044034; bh=4gM8Ng4dI5voGspd2MW/G8qAzYExygP7OS8buaoRZDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ht/pJf8bo8MwxgismJjbcH0DxRn7Lj//fl6ay0HnlmCjRYtIgG8EVgO1pndmfJvmX knXYuXYh9VlrrWlM4STAZn3sQOBumFGD85l8NUcLqK6B4M8x67BxO2fXILzhN4B2BU awW9tkXIImmGo6T6kf3CMLsydwKRFrCShSbshmJZdMTwdZlS8hx070+c6T0k/sjoJA qrli+3YzdEjOuYYWmi7/eX+fS3nR0X9qLxqa7lkA0sqbxR7ZpQRP16hFBijOa7+Glw UKfSOaXg7JBTS7dRCgMgcJxLilLRa8EraZkF2TMfGDuB2LngUIWnuMKHmQ5S0tMkkv QSVzdTlSUbKJw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 06/33] rust: kbuild: remove skipping of `-Wrustdoc::unescaped_backticks` Date: Wed, 1 Apr 2026 13:45:13 +0200 Message-ID: <20260401114540.30108-7-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Back in Rust 1.82.0, I cleaned the `rustdoc::unescaped_backticks` lint in upstream Rust and added tests so that hopefully it would not regress [1]. Thus we can remove it from our side given the Rust minimum version bump. Link: https://github.com/rust-lang/rust/pull/128307 [1] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 5eca6a817966..212759b5eb7d 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -75,8 +75,7 @@ core-edition :=3D $(if $(call rustc-min-version,108700),2= 024,2021) =20 core-skip_flags :=3D \ --edition=3D2021 \ - -Wunreachable_pub \ - -Wrustdoc::unescaped_backticks + -Wunreachable_pub =20 core-flags :=3D \ --edition=3D$(core-edition) \ @@ -213,8 +212,6 @@ rustdoc-macros: $(src)/macros/lib.rs rustdoc-clean rust= doc-proc_macro2 \ rustdoc-quote rustdoc-syn FORCE +$(call if_changed,rustdoc) =20 -# Starting with Rust 1.82.0, skipping `-Wrustdoc::unescaped_backticks` sho= uld -# not be needed -- see https://github.com/rust-lang/rust/pull/128307. rustdoc-core: private skip_flags =3D $(core-skip_flags) rustdoc-core: private rustc_target_flags =3D $(core-flags) rustdoc-core: $(RUST_LIB_SRC)/core/src/lib.rs rustdoc-clean FORCE --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A1C973F9F30; Wed, 1 Apr 2026 11:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044046; cv=none; b=mLxQWNcAqNYsbnK0oTInQlaO7EFOhvkvU6knxgZ1862KuUnJdKrFKnvxSI24RkcUxSwe4z4nqTkb6R04jic1k4qGFEIqmmjIp5LKv0+I9KPvzUNqeBtYWRV6Gf1U8kwbH3vcpSGdNax4lHOKKCfMrw7JVL3BG05LULfPxyeyl3g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044046; c=relaxed/simple; bh=iwZQRTkxE8SQciPkkFIQK+sANJEDd5bGQ1OGAUaLfG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZxzTWiFalXmqsP0NrfluOUgC//wEvg0TB7I0omov/FmiljnY7fQCeOjwydMPGHbeDMDRtgr3v5f4U2JlN7gM0zPIiwP/bLtQsx++aA1HMWRGnn07TnHGL1jw6kPpjWmP3hFQ81KPg8L5KxCIZI1SRl7KL42zcPwu8nUTroJyMaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GlBQ6KPS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GlBQ6KPS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 118C5C2BCB2; Wed, 1 Apr 2026 11:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044046; bh=iwZQRTkxE8SQciPkkFIQK+sANJEDd5bGQ1OGAUaLfG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlBQ6KPSTWHT4VISiYn97ivYhVXKefSUh2Q6bRU8+77PgyLwWn4NjnF93DIByady8 9SycbuA1ixu1mts+5r+nkNfbaww5zykSVdLdjv0lucrgKWqE4LAJ/QBIU+Cn4gwg0z bCuzNQUeDVBg3CE437u5n2f4ONxdL5gjciyeyJ3Mv40G41XzXthovIXxTWAenLWWh0 dfBE9IaiPg3o/GFFlOAh2uMAxZCD1G5wgyJMXmyO54m6lEhFY+P8aMpO3le2CgbKCU lSBH/R9RSHx/v6cF2EdoL2fKcEK9jg29eFoS1fliq8sw58kmNUYk+Y6sTjQIl0q2Mr LdUgb8hbudc9A== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 07/33] rust: kbuild: remove `feature(...)`s that are now stable Date: Wed, 1 Apr 2026 13:45:14 +0200 Message-ID: <20260401114540.30108-8-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that the Rust minimum version is 1.85.0, there is no need to enable certain features that are stable. Thus clean them up. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/Makefile | 2 -- rust/kernel/lib.rs | 21 --------------------- scripts/Makefile.build | 6 +----- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 212759b5eb7d..193cf06eea64 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -86,10 +86,8 @@ proc_macro2-cfgs :=3D \ wrap_proc_macro \ $(if $(call rustc-min-version,108800),proc_macro_span_file proc_macro_= span_location) =20 -# Stable since Rust 1.79.0: `feature(proc_macro_byte_character,proc_macro_= c_str_literals)`. proc_macro2-flags :=3D \ --cap-lints=3Dallow \ - -Zcrate-attr=3D'feature(proc_macro_byte_character,proc_macro_c_str_lit= erals)' \ $(call cfgs-to-flags,$(proc_macro2-cfgs)) =20 quote-cfgs :=3D \ diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 66a09d77a2c4..b48221a5b4ec 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -16,27 +16,6 @@ // Please see https://github.com/Rust-for-Linux/linux/issues/2 for details= on // the unstable features in use. // -// Stable since Rust 1.79.0. -#![feature(generic_nonzero)] -#![feature(inline_const)] -#![feature(pointer_is_aligned)] -// -// Stable since Rust 1.80.0. -#![feature(slice_flatten)] -// -// Stable since Rust 1.81.0. -#![feature(lint_reasons)] -// -// Stable since Rust 1.82.0. -#![feature(raw_ref_op)] -// -// Stable since Rust 1.83.0. -#![feature(const_maybe_uninit_as_mut_ptr)] -#![feature(const_mut_refs)] -#![feature(const_option)] -#![feature(const_ptr_write)] -#![feature(const_refs_to_cell)] -// // Expected to become stable. #![feature(arbitrary_self_types)] #![feature(derive_coerce_pointee)] diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a6d1a2b210aa..d71193a45e1c 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -310,17 +310,13 @@ $(obj)/%.lst: $(obj)/%.c FORCE =20 # The features in this list are the ones allowed for non-`rust/` code. # -# - Stable since Rust 1.79.0: `feature(inline_const)`. -# - Stable since Rust 1.81.0: `feature(lint_reasons)`. -# - Stable since Rust 1.82.0: `feature(asm_const)`, -# `feature(offset_of_nested)`, `feature(raw_ref_op)`. # - Stable since Rust 1.87.0: `feature(asm_goto)`. # - Expected to become stable: `feature(arbitrary_self_types)`. # - To be determined: `feature(used_with_arg)`. # # Please see https://github.com/Rust-for-Linux/linux/issues/2 for details = on # the unstable features in use. -rust_allowed_features :=3D asm_const,asm_goto,arbitrary_self_types,inline_= const,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg +rust_allowed_features :=3D arbitrary_self_types,asm_goto,used_with_arg =20 # `--out-dir` is required to avoid temporaries being created by `rustc` in= the # current working directory, which may be not accessible in the out-of-tree --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B0C73F9F30; Wed, 1 Apr 2026 11:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044058; cv=none; b=W5rTyHohFGfOqc0DioDa3NjHAQx3Vs2/9NnoSPiQlRQS+FEw3qqwVbtfHIjF44vURSr7DE2rUfq/AkmArvn+VHgiY0bj+EuWCpQKEWPFsuc/I8OjoFJlDy6EKp1fAAT0B4k0hv2JGW+1+2a05vA+DEliIxVoO2cO7ox2p2fIud0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044058; c=relaxed/simple; bh=ry8aHALQKoUAVgl8vkVGGnGKhW3biqQ3zE20M4qwJgI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bx8u+0CMZ/X8hgDO4r3rfkxnQJ63a/WuV+iCJSIPfSyQJeMUI5yaCJbvM8jtRWl38aRr5T0rcizTLUwbaqB3GPDbMINMUKRD+OazZDzTWGKL5u5fzFsEQqxokV0b4RyRTvqxGxamoZMfgDS1bwLhtOFUxRWbjKVqmUnZQuithrM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sflZSueu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sflZSueu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0309C4CEF7; Wed, 1 Apr 2026 11:47:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044058; bh=ry8aHALQKoUAVgl8vkVGGnGKhW3biqQ3zE20M4qwJgI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sflZSueuLuu1bWL2KEvq3OCBI7g2AOgQPjJLOPksg31c1MoUcPjU3PoOhqsrY78NL qLTZ5oOs5TEYly4ggal/VwhAsfF451NsyaNr6GAdAbOY/JzOwZeaDZ9elT0AfNQS7D mARg0SQMYwQv2vNVOe3YsrTYDZEK2B9QqRmx5l0suW3yJQKno/WpxtQkmgksvMwzck Ma796ZKDd5Ou4YuvDUAv86QHFr3dqOr1gMbbh0EOfUXAbhTkB6IantJJ9aOIrNopN8 GeHT6XQFerRjV/gPrSVDV7wN8GmQU1oXsIBd7ARAcLgUwzDJtoq//xQFaYbBbif1av AKvnVswAymJZg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 08/33] rust: kbuild: simplify `--remap-path-prefix` workaround Date: Wed, 1 Apr 2026 13:45:15 +0200 Message-ID: <20260401114540.30108-9-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With the minimum version bump in place, `rustdoc` now always recognizes the `--remap-path-prefix` flag. In addition, the Internal Compiler Error that the comment mentions [1] was fixed in Rust 1.87.0 [2], so we still need to skip the flag for the normal `rustdoc` case, but not for `--test` since the ICE does not reproduce there -- please see commit 2c8725c1dca3 ("rust: kbuild: skip `--remap-path-prefix` for `rustdoc`"). Thus update the comment and remove the skipping of the flag for the `--test` case. Note that commit dda135077ecc ("rust: build: remap path to avoid absolute path") re-landed the `--remap-path-prefix` flag (together with `--remap-path-scope`), so we keep the workaround, i.e. an alternative could have been to simply delete the skip entirely, but since we still have it and it will be needed when this gets merged, let's keep it. Link: https://github.com/rust-lang/rust/issues/138520 [1] Link: https://github.com/rust-lang/rust/pull/138556 [2] Signed-off-by: Miguel Ojeda --- rust/Makefile | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 193cf06eea64..708530ee3613 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -142,10 +142,9 @@ rustdoc_modifiers_workaround :=3D $(if $(call rustc-mi= n-version,108800),-Cunsafe-a # Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465= ). doctests_modifiers_workaround :=3D $(rustdoc_modifiers_workaround)$(if $(c= all rustc-min-version,109100),$(comma)sanitizer) =20 -# `rustc` recognizes `--remap-path-prefix` since 1.26.0, but `rustdoc` only -# since Rust 1.81.0. Moreover, `rustdoc` ICEs on out-of-tree builds since = Rust -# 1.82.0 (https://github.com/rust-lang/rust/issues/138520). Thus workaroun= d both -# issues skipping the flag. The former also applies to `RUSTDOC TK`. +# `rustdoc` ICEs on out-of-tree builds in Rust < 1.87.0 +# (https://github.com/rust-lang/rust/issues/138520). Thus workaround the +# issue skipping the flag. quiet_cmd_rustdoc =3D RUSTDOC $(if $(rustdoc_host),H, ) $< cmd_rustdoc =3D \ OBJTREE=3D$(abspath $(objtree)) \ @@ -333,7 +332,7 @@ quiet_cmd_rustdoc_test_kernel =3D RUSTDOC TK $< rm -rf $(objtree)/$(obj)/test/doctests/kernel; \ mkdir -p $(objtree)/$(obj)/test/doctests/kernel; \ OBJTREE=3D$(abspath $(objtree)) \ - $(RUSTDOC) --test $(filter-out --remap-path-prefix=3D%,$(rust_flags)) \ + $(RUSTDOC) --test $(rust_flags) \ -L$(objtree)/$(obj) --extern ffi --extern pin_init \ --extern kernel --extern build_error --extern macros \ --extern bindings --extern uapi \ --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3FACE3FB7FA; Wed, 1 Apr 2026 11:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044070; cv=none; b=sFFWUAF7BJLIobcne8p0MvEL4cRzN31UDZ3zck4aDuUn27Btoh5VL19MYh8e81V7WMpTuIPnrBeo2mW6GcKhqjYxPboS4YibVixj/KJVQk95TmJQszIheZJxBPfDLVyQYlqrxGy/jcfODyi9dXK6iccqKr5e/a1n+I3c8THvCYY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044070; c=relaxed/simple; bh=xsU9IffmhOUWeURxd1cBn+xx+oWcdYdxyuUvVgPmku0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c6o9KKC2CcZ3PhTyWIsjzpe3Y41onXsf70y6PioLlt2p96E7JyPT24cdHCzVFQ4U7+N+se68aN5xjTof5Q4eRpaXm/dwzplTN05tccnhifS1IZ0PnuKJJ6QVaUy3CN5llxjH/xvZkeqvBHtfAbINef/NMMJNVAAwP+Jet84gD/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bw0XQFM9; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bw0XQFM9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98766C116C6; Wed, 1 Apr 2026 11:47:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044069; bh=xsU9IffmhOUWeURxd1cBn+xx+oWcdYdxyuUvVgPmku0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bw0XQFM9BtXzltVVfX1cRyS5Ny7916Ny6Nrc3TLq9KJZYh0JtBh+ukTFEyx8Z85t8 /vt7Jbc/zq1y9bQ1shJhG3VR8TxOtBZF4NjJHMa7mU/xZAlefh37LD+NPTu+Ydfi49 JZ53a+OUpRjXBEozckaDoUhJgDDxIg+j6uv+ZggEvUq3It6rUqjdZ6bh+lQmBq+fnd qgyPYo7kcXdNsMmw1yjq21a8J89cwAmGQvzQVu5nFumVK/lfkLoYnqg7V/B3EDnv2S Uy6UH8O6mHui9UIcrilZWtiKbbK/WhNF71Bx912WmOVg7CuvV4vNq3M2vlDeu6Xlr9 RAOV3bDFHx0ZA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 09/33] rust: kbuild: make `--remap-path-prefix` workaround conditional Date: Wed, 1 Apr 2026 13:45:16 +0200 Message-ID: <20260401114540.30108-10-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Internal Compiler Error that the comment mentions [1] was fixed in Rust 1.87.0 [2]. And, for other workarounds, we plan on limiting where we apply them [3]. Thus limit the ICE one too. This will help to make sure the workaround is not needed anymore on newer versions. Link: https://github.com/rust-lang/rust/issues/138520 [1] Link: https://github.com/rust-lang/rust/pull/138556 [2] Link: https://lore.kernel.org/rust-for-linux/20260205131815.2943152-2-mlksv= ender@gmail.com/ [3] Signed-off-by: Miguel Ojeda --- rust/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rust/Makefile b/rust/Makefile index 708530ee3613..163d2258e93f 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -145,10 +145,12 @@ doctests_modifiers_workaround :=3D $(rustdoc_modifier= s_workaround)$(if $(call rust # `rustdoc` ICEs on out-of-tree builds in Rust < 1.87.0 # (https://github.com/rust-lang/rust/issues/138520). Thus workaround the # issue skipping the flag. +rustdoc_remap_workaround :=3D $(if $(call rustc-min-version,108700),,--rem= ap-path-prefix=3D%) + quiet_cmd_rustdoc =3D RUSTDOC $(if $(rustdoc_host),H, ) $< cmd_rustdoc =3D \ OBJTREE=3D$(abspath $(objtree)) \ - $(RUSTDOC) $(filter-out $(skip_flags) --remap-path-prefix=3D%,$(if $(rust= doc_host),$(rust_common_flags),$(rust_flags))) \ + $(RUSTDOC) $(filter-out $(skip_flags) $(rustdoc_remap_workaround),$(if $(= rustdoc_host),$(rust_common_flags),$(rust_flags))) \ $(rustc_target_flags) -L$(objtree)/$(obj) \ -Zunstable-options --generate-link-to-definition \ --output $(rustdoc_output) \ --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CEFBB3E7172; Wed, 1 Apr 2026 11:48:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044081; cv=none; b=cEoXMp62PKRfyd7itFESuIoRLQSM3ANfIv1Hh55L/rGkkMUUgFOF4Tix1mEVJxq7UiWh4MdJT6ZTpVDb/7+3YNQTpZ8tYNEcTJqJ9z3FFnRjwXpijCbpfr//kQHwvI28zEaQ7xU04OYeaeudtIosdINX+bAvDb2gyI6ygde37S8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044081; c=relaxed/simple; bh=adABYvIqd3NTguvnrLCuC9umM1YlmwtHIfAtv/sMMlY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P0JZ/AD/SsFuKmpexO+ddzZi8dOdM/UFwVWuyjJwYLQRdViN1KkSvqKQzCYsvb8l1gzoQqt+d24yDK+G/SDWOX0cclHmjBjd9HoeXFlbtZ2EmdskZjxPko6LVxJpnzAh5xpziFHfKOpMghepUnGQ+sD8hQ7ZxDO9ccxGNiq81h4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=W7RUQV2H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="W7RUQV2H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60409C4CEF7; Wed, 1 Apr 2026 11:47:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044081; bh=adABYvIqd3NTguvnrLCuC9umM1YlmwtHIfAtv/sMMlY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7RUQV2HZDvpt7cb2QLkpsSjIXygeJXHzglkI2wvWnPnI2M1b6re/EbnmI0XwokyF wrrwYxN+/b+ugyMYmH9z5Umd525lrDMMtI1jgyazypmGOGTbjEKg2Uf67p5z3f9Bmg c6SqSWS5dXNcFVk9QuiGQs+D+hKuqndvN5lUWvCrCbINYOm3WsPZfDOtxulUNeWqbM y89bDoxVl41VBEb3zkJMUAunBi8T9StVC/clbVAz8kgUAUUzxcNf8AJj/euaS7+TKs GxDpNxLDh92OcnV4pmrI+T0sPk26QqFNokBc1fpaibHISln0xBEqZ/Iba9ePZXRZ+o QQE6E4BNPh56g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 10/33] rust: transmute: simplify code with Rust 1.80.0 `split_at_*checked()` Date: Wed, 1 Apr 2026 13:45:17 +0200 Message-ID: <20260401114540.30108-11-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `feature(split_at_checked)` [1] has been stabilized in Rust 1.80.0 [2], which is beyond our new minimum Rust version (Rust 1.85.0). Thus simplify the code using `split_at_*checked()`. Link: https://github.com/rust-lang/rust/issues/119128 [1] Link: https://github.com/rust-lang/rust/pull/124678 [2] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/kernel/transmute.rs | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/rust/kernel/transmute.rs b/rust/kernel/transmute.rs index b9e6eadc08f5..654b5ede2fe2 100644 --- a/rust/kernel/transmute.rs +++ b/rust/kernel/transmute.rs @@ -66,16 +66,9 @@ fn from_bytes_prefix(bytes: &[u8]) -> Option<(&Self, &[u= 8])> where Self: Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at` cannot - // panic. - // TODO: replace with `split_at_checked` once the MSRV is >=3D= 1.80. - let (prefix, remainder) =3D bytes.split_at(size_of::()); + let (prefix, remainder) =3D bytes.split_at_checked(size_of::= ())?; =20 - Self::from_bytes(prefix).map(|s| (s, remainder)) - } + Self::from_bytes(prefix).map(|s| (s, remainder)) } =20 /// Converts a mutable slice of bytes to a reference to `Self`. @@ -108,16 +101,9 @@ fn from_bytes_mut_prefix(bytes: &mut [u8]) -> Option<(= &mut Self, &mut [u8])> where Self: AsBytes + Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at_mut` cannot - // panic. - // TODO: replace with `split_at_mut_checked` once the MSRV is = >=3D 1.80. - let (prefix, remainder) =3D bytes.split_at_mut(size_of::= ()); + let (prefix, remainder) =3D bytes.split_at_mut_checked(size_of::())?; =20 - Self::from_bytes_mut(prefix).map(|s| (s, remainder)) - } + Self::from_bytes_mut(prefix).map(|s| (s, remainder)) } =20 /// Creates an owned instance of `Self` by copying `bytes`. @@ -147,16 +133,9 @@ fn from_bytes_copy_prefix(bytes: &[u8]) -> Option<(Sel= f, &[u8])> where Self: Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at` cannot - // panic. - // TODO: replace with `split_at_checked` once the MSRV is >=3D= 1.80. - let (prefix, remainder) =3D bytes.split_at(size_of::()); + let (prefix, remainder) =3D bytes.split_at_checked(size_of::= ())?; =20 - Self::from_bytes_copy(prefix).map(|s| (s, remainder)) - } + Self::from_bytes_copy(prefix).map(|s| (s, remainder)) } } =20 --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF76E3A380D; Wed, 1 Apr 2026 11:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044093; cv=none; b=A4bu9C2gLhlnnYfmejohDl5Ab+A9mPPCv8J8f2LB+P/O/ZALDztu3eIRiALygZYSRnHbYPdEzUg0gOIdAM4Ar4JZu4FvDrBS3ETmnhUhSWeH1joeXLjBpWcAfyynigSbjJudWs28UK8GJZ6zqSySrTtXRTX0i33hGNgmt8JPg6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044093; c=relaxed/simple; bh=Pc5ewSafnPFxKHksepcgeyeiYuBuOzddWiUYOLo44fc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hZnusRmSCoAsNr09RvlbEP22aLd4/SqFoQbAPvl/+07rFvu825GPmfL55HSVV4Gbh39W7iOG/5l1N1yAW0mvmAq5NpOui2Q4VTMmHiNXqzgq2ttli9QuC9ZgCJac5Tx6pT7sy7CissEoEG8CyhWnrQB3EVRN9rz5pNXnUsRlnf8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BctafedQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BctafedQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30F73C4CEF7; Wed, 1 Apr 2026 11:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044093; bh=Pc5ewSafnPFxKHksepcgeyeiYuBuOzddWiUYOLo44fc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BctafedQl739LjER8MXut5f/UHQmwOMgY8eiBY9GPjZTa6UhwF33xTqKAsv/k9Jpr UXZVhOtcmmlzZOYf7Vb8QT5b+Sj/g3QrIBGXZxTM3uNlk/xWwz3doBmOs5UrfpKtV3 BYeIBH88Jfn81A8lOQUe/b7L+LFkxTKWrdN5PeuA4bvB3G5atuDiVtTQLpJHRcGIi8 078hXEr/7kYFNT7XsI7KvwhnIDxnv/Nf9IHI6ZwVq+LPtCR1GNMcpgdXOerf3ytBI9 Tm7z4+ydsRwNHDCQkzUS7eKrnLuo9suwO47RZoBJZ7m1nD1AfOYKE0TTcQdbVpDSUj Rk7BTlqek9WZw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 11/33] rust: alloc: simplify with `NonNull::add()` now that it is stable Date: Wed, 1 Apr 2026 13:45:18 +0200 Message-ID: <20260401114540.30108-12-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently we need to go through raw pointers and then re-create the `NonNull` from the result of offsetting the raw pointer. Thus, now that we bump the Rust minimum version, simplify using `NonNull::add()` and clean the TODO note. Signed-off-by: Miguel Ojeda Acked-by: Danilo Krummrich Reviewed-by: Gary Guo --- rust/kernel/alloc/allocator/iter.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rust/kernel/alloc/allocator/iter.rs b/rust/kernel/alloc/alloca= tor/iter.rs index 5759f86029b7..e0a70b7a744a 100644 --- a/rust/kernel/alloc/allocator/iter.rs +++ b/rust/kernel/alloc/allocator/iter.rs @@ -42,15 +42,9 @@ fn next(&mut self) -> Option { return None; } =20 - // TODO: Use `NonNull::add()` instead, once the minimum supported = compiler version is - // bumped to 1.80 or later. - // // SAFETY: `offset` is in the interval `[0, (self.page_count() - 1= ) * page::PAGE_SIZE]`, // hence the resulting pointer is guaranteed to be within the same= allocation. - let ptr =3D unsafe { self.buf.as_ptr().add(offset) }; - - // SAFETY: `ptr` is guaranteed to be non-null given that it is der= ived from `self.buf`. - let ptr =3D unsafe { NonNull::new_unchecked(ptr) }; + let ptr =3D unsafe { self.buf.add(offset) }; =20 // SAFETY: // - `ptr` is a valid pointer to a `Vmalloc` allocation. --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74E4B3F9F3E; Wed, 1 Apr 2026 11:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044105; cv=none; b=dZxTOiEb55/zwAun2oqZUe0UBH3vLDshCazDn+pDhiBYnPMWkzk6/ZHv7sECidNQR30RX6cRK7N72vWiNHNNT6VGuJlr4Thg6SgBEJOhJ0GqwZThbFEy3Zeep6xY26NCKoT40KwG9xV1O40beJdauFT32Pg3SL4p1lW/7rd98f0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044105; c=relaxed/simple; bh=oCOOGcyyszcaXC31455V0be0QqdPMZoxWheuEK3ZCSA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GchUD7l6Wy2cMsWhAGfSUiw8wsHXN3/eae8quDR822vjnlUVaAodPcV2p45K3VSL9fvd8grpQb6iSl5InRqYlD5dOYhZBjsWMAPR2jlIAhDZfgbzC8T7x+pP6zCzJxEWct2plw4gscXKiZSBH+rFb0I9XGIpe0TMj+5L8KlQNLY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GoxIk+02; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GoxIk+02" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F04AFC4CEF7; Wed, 1 Apr 2026 11:48:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044105; bh=oCOOGcyyszcaXC31455V0be0QqdPMZoxWheuEK3ZCSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GoxIk+02vJe18xjAgrD81txVK4wtRlTfUWrhHLGDRSQiV+me/fjnLC+7phHDlesuL J7Hq1xhTdOPfCfF8DlMkdOt8rrbVHMirjmXItItYHfBPD25cX4fMo/GBYwdrbRu7fZ 0AkU4tct54K8WMu16YFOTGOQcGE3qx2fKQnsmkDzl/vyf61S0QPF9vcb0C1gkRPnMR e+5uOE14VQelGq2Cq0xHw4LUMkQ9WlkXANUH0HKCMdNXt3l1xPhuNuUmuYpg9lJb/A TRD5Link8UuZH9tLBuJ6KDPuIvaQ52PV5omvSLGJvk5BLHki1ajJnBJ5vuJsGi1ltQ c73r0TDlYXWnA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 12/33] rust: macros: update `extract_if` MSRV TODO comment Date: Wed, 1 Apr 2026 13:45:19 +0200 Message-ID: <20260401114540.30108-13-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `feature(extract_if)` was stabilized in Rust 1.87.0 [1]. Thus update the comment to reflect that. Alternatively, we could use it unstably already. Link: https://github.com/rust-lang/rust/pull/137109 [1] Signed-off-by: Miguel Ojeda --- rust/macros/kunit.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/macros/kunit.rs b/rust/macros/kunit.rs index 6be880d634e2..6f6d746b8dbb 100644 --- a/rust/macros/kunit.rs +++ b/rust/macros/kunit.rs @@ -87,7 +87,7 @@ pub(crate) fn kunit_tests(test_suite: Ident, mut module: = ItemMod) -> Result=3D 1.87.0. let before_len =3D f.attrs.len(); f.attrs.retain(|attr| !attr.path().is_ident("test")); if f.attrs.len() =3D=3D before_len { --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BCE23F9F30; Wed, 1 Apr 2026 11:48:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044117; cv=none; b=ORfCDdgEW7c9T2dbj8yG56I/8/8FlVcjc2reAHR6RMmtEn1mP9YRkGrV5tJ10gbkJjx8lt0K6GndjzDd7GLGm843ueA6VHiBhGYM9tK9X76FfqJJRAhejyJWF9q8Cv1qcFnIqg13zXm09oMP6QjKkaBEzgNgAP9K4dtOI07XIbI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044117; c=relaxed/simple; bh=ljnXuX5HwPO9n952btUletHJHOtBVyk1Xf5y47SLQh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=haVXyJuGz28xw7DOoA6hvZGe4TIHWUSYXu8lp0itH6Sp9rT1G+my3aI0a6qf35/IE/E4Lp1W4o4exe3GVPXF/7vSZn4xs2TIIad7XyshmYn8nnhYfsb3dI7dFtpuUSY3vhR7wBuOeiFGnChr//N0d4GkhwvTEyRNVPotWBjIiFs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D7CRYS4I; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D7CRYS4I" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADE8FC4CEF7; Wed, 1 Apr 2026 11:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044116; bh=ljnXuX5HwPO9n952btUletHJHOtBVyk1Xf5y47SLQh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7CRYS4IETw0CEZ0NBFJ9NJ7Srw9Q9SJGBqB5dx9NagMuyqc8NAQ7QI2LNuDqTtsU cXTdniFrOXotXLNiYoIzv8/FMc6rjp6Y9iXHw6ytzNYDyy7kY3i5pz5PnDeYZJ42+q k2jEvdGxqyQrAlfbok54A0BLe7rt8A0yaS6MmErdKMwP/VqrnqKQrd3eneqJSPBmjc I22A+exN4GmReO/dkLfFCgCVorndbUnr4Y8X3K18TdefNFRwsg0z/MSWzMqqu0Ugjm 4uwsza3aByQxj2gKMRIC+jyTTFP8zqXpD23dJHCcbI0oNlhL7k6OePQoJ+l2j/j1NC vn7gNIS5m0nxg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 13/33] rust: block: update `const_refs_to_static` MSRV TODO comment Date: Wed, 1 Apr 2026 13:45:20 +0200 Message-ID: <20260401114540.30108-14-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" `feature(const_refs_to_static)` was stabilized in Rust 1.83.0 [1]. Thus update the comment to reflect that. Link: https://github.com/rust-lang/rust/pull/129759 [1] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/kernel/block/mq/gen_disk.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_di= sk.rs index c8b0ecb17082..912cb805caf5 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -140,9 +140,7 @@ pub fn build( devnode: None, alternative_gpt_sector: None, get_unique_id: None, - // TODO: Set to THIS_MODULE. Waiting for const_refs_to_static = feature to - // be merged (unstable in rustc 1.78 which is staged for linux= 6.10) - // + // TODO: Set to `THIS_MODULE`. owner: core::ptr::null_mut(), pr_ops: core::ptr::null_mut(), free_disk: None, --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D6EF3E6DEB; Wed, 1 Apr 2026 11:48:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044129; cv=none; b=NwsrHVO468k0edP3H8x+knsk3V28JJDO8V2H02t+oDD1QGs3KI0NR9iZiIgcUA1BmZN/cf7BlWWb5WqD+Xt1Nc9Wg9u1wdMgy/97QH2t3IG6PhFZNSUtGUDCWQ9AJ+etHB43IbmGh8Q2waRPSoq/6Z54ZqSvfmd+O4xfqBElGJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044129; c=relaxed/simple; bh=ARQPdLFNgLGMMD7Hlk1KS8FPcB6q/KuXKhlNKcpj/sM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mNH5RBGJivpuwa0UqXnjzGcpkRM49HdQBR5qa19UsRyyyTALwa5Gl8aso846PSHdUJ5+WQQj0Wi7ZouYNa8Akavy999p2sv2bznkK6hZrLGYKJ6BQQmRLwGJb+CSdrTVwl+9K/RHvAB5dBjMf5n9swb9bDy2wPioE7V8F38siv8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Sl4V3Ob2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Sl4V3Ob2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73A4EC4CEF7; Wed, 1 Apr 2026 11:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044128; bh=ARQPdLFNgLGMMD7Hlk1KS8FPcB6q/KuXKhlNKcpj/sM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sl4V3Ob2163+RRCKSkLp4ZUuMaSDTTdLiFNQWuFCXKv1Krlrxuela9RxhT+4wUwjt yhYttjDbZQxVHrAv8b/esKNF8VdheRCH3Oqdk/2NAgGn2nejx2h4jXPJbvv4jYQuaV TjMZ/sfmInsww6vddePv9CyGl3rBljLG5MSbIM1HplnFVuq2+FuvEOKtxe7XZRnNrz CMgzmsPy7rtZc6T52JJnndKutrM/pbY6DTPy3eV6rHBgOeGBKJj34eqEze+SU45zwb 4y3EKNzMX7CayXffABQD13PIYCldiSPMdtIKe0RW2wa3PA3X1DcERUC8zGiKtwfVVr pDCwDzyZt9PIQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 14/33] rust: bump `bindgen` minimum supported version to 0.71.1 (Debian Trixie) Date: Wed, 1 Apr 2026 13:45:21 +0200 Message-ID: <20260401114540.30108-15-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As proposed in the past in e.g. LPC 2025 and the Maintainers Summit [1], we are going to follow Debian Stable's `bindgen` versions as our minimum supported version. Debian Trixie was released with `bindgen` 0.71.1, which it still uses to this day [2]. Debian Trixie's release happened on 2025-08-09 [3], which means that a fair amount of time has passed since its release for kernel developers to upgrade. Thus bump the minimum to the new version. Then, in later commits, clean up most of the workarounds and other bits that this upgrade of the minimum allows us. Ubuntu 25.10 also has a recent enough `bindgen` [4] (even the already unsupported Ubuntu 25.04 had it), and they also provide versioned packages with `bindgen` 0.71.1 back to Ubuntu 24.04 LTS [5]. Link: https://lwn.net/Articles/1050174/ [1] Link: https://packages.debian.org/trixie/bindgen [2] Link: https://www.debian.org/releases/trixie/ [3] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbindgen [4] Link: https://launchpad.net/ubuntu/+source/rust-bindgen-0.71 [5] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Documentation/process/changes.rst | 2 +- scripts/min-tool-version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/chan= ges.rst index 474594bd4831..84156d031365 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -32,7 +32,7 @@ you probably needn't concern yourself with pcmciautils. GNU C 8.1 gcc --version Clang/LLVM (optional) 15.0.0 clang --version Rust (optional) 1.85.0 rustc --version -bindgen (optional) 0.65.1 bindgen --version +bindgen (optional) 0.71.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version binutils 2.30 ld -v diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index a270ec761f64..b96ec2d379b6 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -34,7 +34,7 @@ rustc) echo 1.85.0 ;; bindgen) - echo 0.65.1 + echo 0.71.1 ;; *) echo "$1: unknown tool" >&2 --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E68BC3E6DEB; Wed, 1 Apr 2026 11:49:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044141; cv=none; b=qtV259jIWnj7ODEtkwC4CMr0OV6K5hag36cjWcPpk0K4w08lYVd4Iea/8ET55YgWkObp4iHIz25aDpfQm++vu2PHJSXzkm8qB85AS916+NnQYhj5ARK/UWqGCKsvJ3CeARnywX6k2q99Qtbw1ANr+jeiQooeKLTq0vceeFDMOZw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044141; c=relaxed/simple; bh=ItfdI64Ks8gXoHtrpj58RCfjp1hysM7VxfqZvaewK7E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ttf7MFrZpLGmHiw4bDHVaD76OR2UFFWHMeBRfR3bW6Q0GODge4NWjjBbn9GtrSkjY5tyjjVz7z5dZMCWRO3voLEUutQG42oIPAYSmmAYEX3iweITluFjiWyMC+KLmzHY9yqhVfKtCnjY+1ZQz+sl2GB662XNN6Pwlxx4UrEg0+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=au78Fn5P; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="au78Fn5P" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C824C116C6; Wed, 1 Apr 2026 11:48:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044140; bh=ItfdI64Ks8gXoHtrpj58RCfjp1hysM7VxfqZvaewK7E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=au78Fn5P62QtKs+AJuvGHcFWbjilw5jy6hHRniP49H+mzNx6g15OrAt4rwU2g+0Bf tgBzQ7o2EUJfMYGsWaaiWncgiCJA8DMzQeG5Hxb97hWVuDNmyp7CXYxa9h9XPB0+72 HyKrGNgOra2twsMAAIbGarVaeaCvYqs9UnC3BNpHx/ooTRBNddV7XrpahshUBA5t4A bLhkkMuXgTC/ps+59WFJ9qjuX446UCiCI1TqDu41k8PyOf4qsSJ8c0PqM5AyOiXO5C sy02Wxq7FBpUPdnBPZ+g6kYQbEU5X+6ye5V4xHtrAdpwNgn4H15Rym/SXtIaEDW5wK btGTVejLETUPg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 15/33] rust: rust_is_available: remove warning for 0.66.[01] buggy versions Date: Wed, 1 Apr 2026 13:45:22 +0200 Message-ID: <20260401114540.30108-16-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is not possible anymore to fall into the issue that this warning was alerting about given the `bindgen` version bump. Thus simplify by removing the machinery behind it, including tests. Signed-off-by: Miguel Ojeda --- scripts/rust_is_available.sh | 13 ------------ scripts/rust_is_available_bindgen_0_66.h | 2 -- scripts/rust_is_available_test.py | 26 +++--------------------- 3 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 scripts/rust_is_available_bindgen_0_66.h diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index d2323de0692c..77896e31dab5 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -163,19 +163,6 @@ if [ "$rust_bindings_generator_cversion" -lt "$rust_bi= ndings_generator_min_cvers echo >&2 "***" exit 1 fi -if [ "$rust_bindings_generator_cversion" -eq 6600 ] || - [ "$rust_bindings_generator_cversion" -eq 6601 ]; then - # Distributions may have patched the issue (e.g. Debian did). - if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_0_66.h >/dev/null= ; then - echo >&2 "***" - echo >&2 "*** Rust bindings generator '$BINDGEN' versions 0.66.0 and 0.6= 6.1 may not" - echo >&2 "*** work due to a bug (https://github.com/rust-lang/rust-bindg= en/pull/2567)," - echo >&2 "*** unless patched (like Debian's)." - echo >&2 "*** Your version: $rust_bindings_generator_version" - echo >&2 "***" - warning=3D1 - fi -fi =20 # Check that the `libclang` used by the Rust bindings generator is suitabl= e. # diff --git a/scripts/rust_is_available_bindgen_0_66.h b/scripts/rust_is_ava= ilable_bindgen_0_66.h deleted file mode 100644 index c0431293421c..000000000000 --- a/scripts/rust_is_available_bindgen_0_66.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define A "\0" diff --git a/scripts/rust_is_available_test.py b/scripts/rust_is_available_= test.py index 4fcc319dea84..b66fa5933844 100755 --- a/scripts/rust_is_available_test.py +++ b/scripts/rust_is_available_test.py @@ -54,17 +54,12 @@ else: """) =20 @classmethod - def generate_bindgen(cls, version_stdout, libclang_stderr, version_0_6= 6_patched=3DFalse, libclang_concat_patched=3DFalse): + def generate_bindgen(cls, version_stdout, libclang_stderr, libclang_co= ncat_patched=3DFalse): if libclang_stderr is None: libclang_case =3D f"raise SystemExit({cls.bindgen_default_bind= gen_libclang_failure_exit_code})" else: libclang_case =3D f"print({repr(libclang_stderr)}, file=3Dsys.= stderr)" =20 - if version_0_66_patched: - version_0_66_case =3D "pass" - else: - version_0_66_case =3D "raise SystemExit(1)" - if libclang_concat_patched: libclang_concat_case =3D "print('pub static mut foofoo: ::std:= :os::raw::c_int;')" else: @@ -74,8 +69,6 @@ else: import sys if "rust_is_available_bindgen_libclang.h" in " ".join(sys.argv): {libclang_case} -elif "rust_is_available_bindgen_0_66.h" in " ".join(sys.argv): - {version_0_66_case} elif "rust_is_available_bindgen_libclang_concat.h" in " ".join(sys.argv): {libclang_concat_case} else: @@ -83,8 +76,8 @@ else: """) =20 @classmethod - def generate_bindgen_version(cls, stdout, version_0_66_patched=3DFalse= ): - return cls.generate_bindgen(stdout, cls.bindgen_default_bindgen_li= bclang_stderr, version_0_66_patched) + def generate_bindgen_version(cls, stdout): + return cls.generate_bindgen(stdout, cls.bindgen_default_bindgen_li= bclang_stderr) =20 @classmethod def generate_bindgen_libclang_failure(cls): @@ -245,19 +238,6 @@ else: result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) self.assertIn(f"Rust bindings generator '{bindgen}' is too old.", = result.stderr) =20 - def test_bindgen_bad_version_0_66_0_and_0_66_1(self): - for version in ("0.66.0", "0.66.1"): - with self.subTest(version=3Dversion): - bindgen =3D self.generate_bindgen_version(f"bindgen {versi= on}") - result =3D self.run_script(self.Expected.SUCCESS_WITH_WARN= INGS, { "BINDGEN": bindgen }) - self.assertIn(f"Rust bindings generator '{bindgen}' versio= ns 0.66.0 and 0.66.1 may not", result.stderr) - - def test_bindgen_bad_version_0_66_0_and_0_66_1_patched(self): - for version in ("0.66.0", "0.66.1"): - with self.subTest(version=3Dversion): - bindgen =3D self.generate_bindgen_version(f"bindgen {versi= on}", True) - result =3D self.run_script(self.Expected.SUCCESS, { "BINDG= EN": bindgen }) - def test_bindgen_libclang_failure(self): bindgen =3D self.generate_bindgen_libclang_failure() result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE2523E6DEB; Wed, 1 Apr 2026 11:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044152; cv=none; b=mbHYpQ2mSfpC2VF7CEVEEP0NO5ctL+yfDNPeyjfSeYIab23wHOqubP+YJvUj66m3MzQlwpT18zMyw9xlPAvvPvKAXcn2vCN5ABpOZZ0ZQfILEM5ILViI0vqdpm5SKyIE2DJikwH1X22k+/p4NwQ+7FJznm9888M6cWc2tgaoQeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044152; c=relaxed/simple; bh=AX5z3xpzFua6mAQIK+U/8xMTb4ZIuLJsG4n5Y91N4RI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fs4JGhsJp/841STBDmnK51RUOrhRVrfHlE7t0ZWkAMrYWrR0MKTcetSQu45UImh9OhEu0Dzpwsl/vAwCeNCEmJ2miV8yvR++p4rXn2WlZ7txzOXET8h3/IsqNoCml5MraZhqX0HasI7F4jZHw32HV2hxBhCww+mTnX6IIpbLJRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DVz4TB/V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DVz4TB/V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F511C4CEF7; Wed, 1 Apr 2026 11:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044152; bh=AX5z3xpzFua6mAQIK+U/8xMTb4ZIuLJsG4n5Y91N4RI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVz4TB/VU+zyZ2i/W6mzrSFi2feuGR6qmqoAvmg2H+aTnIrx+rI9QbMhxIGO0Fy4d XEUrIjhZb1p4mHwos1ynOfsPYSKde1p0FX+M1Sy2SPqq2wYJ6sjVhPoccfaZVduWbn wrrNGXFWfNEkrtdQ/i2hpujBUGZziz/KixuYY2LjLo97z5Dk4nuqnde2AEIcecPZq7 GaKGi955ChQdu/AiuzZxLwHqBt1S71Q7OAJpI2N3lXFXqySy73PaDukQke2WGFgjjS PONEdcAu9t8e6olmo0f30HBhqmyw+l+pebpQt/3V8sgHdUpeCZ8WS4h4OvaSsKvE0l 4LcqeuoQH8epQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 16/33] rust: rust_is_available: remove warning for < 0.69.5 && libclang >= 19.1 Date: Wed, 1 Apr 2026 13:45:23 +0200 Message-ID: <20260401114540.30108-17-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It is not possible anymore to fall into the issue that this warning was alerting about given the `bindgen` version bump. Thus simplify by removing the machinery behind it, including tests. Signed-off-by: Miguel Ojeda --- scripts/rust_is_available.sh | 15 -------- ...ust_is_available_bindgen_libclang_concat.h | 3 -- scripts/rust_is_available_test.py | 34 +------------------ 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 scripts/rust_is_available_bindgen_libclang_concat.h diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index 77896e31dab5..cefc456c2503 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -214,21 +214,6 @@ if [ "$bindgen_libclang_cversion" -lt "$bindgen_libcla= ng_min_cversion" ]; then exit 1 fi =20 -if [ "$bindgen_libclang_cversion" -ge 1900100 ] && - [ "$rust_bindings_generator_cversion" -lt 6905 ]; then - # Distributions may have patched the issue (e.g. Debian did). - if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang_concat.h= | grep -q foofoo; then - echo >&2 "***" - echo >&2 "*** Rust bindings generator '$BINDGEN' < 0.69.5 together with = libclang >=3D 19.1" - echo >&2 "*** may not work due to a bug (https://github.com/rust-lang/ru= st-bindgen/pull/2824)," - echo >&2 "*** unless patched (like Debian's)." - echo >&2 "*** Your bindgen version: $rust_bindings_generator_version" - echo >&2 "*** Your libclang version: $bindgen_libclang_version" - echo >&2 "***" - warning=3D1 - fi -fi - # If the C compiler is Clang, then we can also check whether its version # matches the `libclang` version used by the Rust bindings generator. # diff --git a/scripts/rust_is_available_bindgen_libclang_concat.h b/scripts/= rust_is_available_bindgen_libclang_concat.h deleted file mode 100644 index efc6e98d0f1d..000000000000 --- a/scripts/rust_is_available_bindgen_libclang_concat.h +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define F(x) int x##x -F(foo); diff --git a/scripts/rust_is_available_test.py b/scripts/rust_is_available_= test.py index b66fa5933844..d6d54b7ea42a 100755 --- a/scripts/rust_is_available_test.py +++ b/scripts/rust_is_available_test.py @@ -54,23 +54,16 @@ else: """) =20 @classmethod - def generate_bindgen(cls, version_stdout, libclang_stderr, libclang_co= ncat_patched=3DFalse): + def generate_bindgen(cls, version_stdout, libclang_stderr): if libclang_stderr is None: libclang_case =3D f"raise SystemExit({cls.bindgen_default_bind= gen_libclang_failure_exit_code})" else: libclang_case =3D f"print({repr(libclang_stderr)}, file=3Dsys.= stderr)" =20 - if libclang_concat_patched: - libclang_concat_case =3D "print('pub static mut foofoo: ::std:= :os::raw::c_int;')" - else: - libclang_concat_case =3D "pass" - return cls.generate_executable(f"""#!/usr/bin/env python3 import sys if "rust_is_available_bindgen_libclang.h" in " ".join(sys.argv): {libclang_case} -elif "rust_is_available_bindgen_libclang_concat.h" in " ".join(sys.argv): - {libclang_concat_case} else: print({repr(version_stdout)}) """) @@ -255,31 +248,6 @@ else: result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) self.assertIn(f"libclang (used by the Rust bindings generator '{bi= ndgen}') is too old.", result.stderr) =20 - def test_bindgen_bad_libclang_concat(self): - for (bindgen_version, libclang_version, expected_not_patched) in ( - ("0.69.4", "18.0.0", self.Expected.SUCCESS), - ("0.69.4", "19.1.0", self.Expected.SUCCESS_WITH_WARNINGS), - ("0.69.4", "19.2.0", self.Expected.SUCCESS_WITH_WARNINGS), - - ("0.69.5", "18.0.0", self.Expected.SUCCESS), - ("0.69.5", "19.1.0", self.Expected.SUCCESS), - ("0.69.5", "19.2.0", self.Expected.SUCCESS), - - ("0.70.0", "18.0.0", self.Expected.SUCCESS), - ("0.70.0", "19.1.0", self.Expected.SUCCESS), - ("0.70.0", "19.2.0", self.Expected.SUCCESS), - ): - with self.subTest(bindgen_version=3Dbindgen_version, libclang_= version=3Dlibclang_version): - cc =3D self.generate_clang(f"clang version {libclang_versi= on}") - libclang_stderr =3D f"scripts/rust_is_available_bindgen_li= bclang.h:2:9: warning: clang version {libclang_version} [-W#pragma-messages= ], err: false" - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr) - result =3D self.run_script(expected_not_patched, { "BINDGE= N": bindgen, "CC": cc }) - if expected_not_patched =3D=3D self.Expected.SUCCESS_WITH_= WARNINGS: - self.assertIn(f"Rust bindings generator '{bindgen}' < = 0.69.5 together with libclang >=3D 19.1", result.stderr) - - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr, libclang_concat_patched=3DTrue) - result =3D self.run_script(self.Expected.SUCCESS, { "BINDG= EN": bindgen, "CC": cc }) - def test_clang_matches_bindgen_libclang_different_bindgen(self): bindgen =3D self.generate_bindgen_libclang("scripts/rust_is_availa= ble_bindgen_libclang.h:2:9: warning: clang version 999.0.0 [-W#pragma-messa= ges], err: false") result =3D self.run_script(self.Expected.SUCCESS_WITH_WARNINGS, { = "BINDGEN": bindgen }) --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C3C8401A3B; Wed, 1 Apr 2026 11:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044164; cv=none; b=TjX4KYpnIR52mcGzD72R1M/Zc1BZyEhDjinXeqiVrk9kmhTQFDT5LsHuVOHowwroPJS4terfUlW15mg8V3U7572Sp7156hc/uS8r0Nq///ENboRcgIpJbXyR7k23pMj55W0vE3YEG9VM9HBOmRy+5DZloiE9awrY6UTCY84hSSM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044164; c=relaxed/simple; bh=6xM/90y2+9K2QK1MXod17VOVsEz3ItyuSJ/mYMv3Drg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f8NFQTjyQ79r7L7FCbfsr/HxFcqa7le4QYjQ1y9oYI3D/6Cap1WqcjUpGTbwgFR4Nd2aE1hdpS9dIdx6YlMSiB+JDKr5cpfrGI/lqxbrTimaM3s8yTs67xB9W9RPByreQHJyl8GGxcAVUAnkNKVOzDnFuuZIZoSG1v+G/ZHC8K4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V+OxZYCF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V+OxZYCF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC956C4CEF7; Wed, 1 Apr 2026 11:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044164; bh=6xM/90y2+9K2QK1MXod17VOVsEz3ItyuSJ/mYMv3Drg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V+OxZYCFK/c+WvN/8/uOPoU8cAIkSEfrgXW012jcw/dHW9HOkQ6wsGFDWswV5/fG3 B0v0LpVBICRBJRwhLcK22UNCpDeTVTz+otKNFY+bq42zA8C8SUT8eSa1TFfGqDTxZB nTODkVCQiBhlpeCieK0XT3k7C5zp8u0nP4rLD82LlBz9Y/xfcAU7TJG690uB/2PHds RK8eWxpPbkIam179mN9OeSs4s+oG15cb5Q0wUo46IzCRVHLWdbbP/e1PSThZYL6/sj B+l7o2/JFT40jMHsCpebNWLL1wHDkZfzANZ7s+SGh48/K8TUDw4qSBv5D/fytpVz03 jqBcyNZwn2UQA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 17/33] rust: kbuild: update `bindgen --rust-target` version and replace comment Date: Wed, 1 Apr 2026 13:45:24 +0200 Message-ID: <20260401114540.30108-18-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" As the comment in the `Makefile` explains, previously, we needed to limit ourselves to the list of Rust versions known by `bindgen` for its `--rust-target` option. In other words, we needed to consult the versions known by the minimum version of `bindgen` that we supported. Now that we bumped the minimum version of `bindgen`, that limitation does not apply anymore. Thus replace the comment and simply write our minimum supported Rust version there, which is much simpler. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/Makefile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 163d2258e93f..34f21b735993 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -446,22 +446,10 @@ endif # architecture instead of generating `usize`. bindgen_c_flags_final =3D $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__ =20 -# Each `bindgen` release may upgrade the list of Rust target versions. By -# default, the highest stable release in their list is used. Thus we need = to set -# a `--rust-target` to avoid future `bindgen` releases emitting code that -# `rustc` may not understand. On top of that, `bindgen` does not support p= assing -# an unknown Rust target version. -# -# Therefore, the Rust target for `bindgen` can be only as high as the mini= mum -# Rust version the kernel supports and only as high as the greatest stable= Rust -# target supported by the minimum `bindgen` version the kernel supports (t= hat -# is, if we do not test the actual `rustc`/`bindgen` versions running). -# -# Starting with `bindgen` 0.71.0, we will be able to set any future Rust v= ersion -# instead, i.e. we will be able to set here our minimum supported Rust ver= sion. +# `--rust-target` points to our minimum supported Rust version. quiet_cmd_bindgen =3D BINDGEN $@ cmd_bindgen =3D \ - $(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.68 \ + $(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.85 \ --use-core --with-derive-default --ctypes-prefix ffi --no-layout-tests \ --no-debug '.*' --enable-function-attribute-detection \ -o $@ -- $(bindgen_c_flags_final) -DMODULE \ --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D2F23E5599; Wed, 1 Apr 2026 11:49:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044176; cv=none; b=ICWSwxqCQtCcEUj/07z4pkushUHCnnew0xVCy+tgrj74KLIeVEXc2y4sH1JVVh9fL54pItd1SFws5wQw8ENszWCwIM02DCZKtQgl3QbpsXapttkU/RqprPDYyHcqN1msTvYRRj1nR7/S8kxF2QhxJwX+85H6cwu1c0cQ4854k+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044176; c=relaxed/simple; bh=xz1grsgb4QE1o4cHB9GesAE8qhJ6lQQFIqn/KID5vfw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sldnDw2dsEPHEGKDYoOw3BJoNW96lu7xQ0ENxAsDb0dHmu9lBccznSFBZt0sTSShbutY/ab2kb8ANjyCkAIf41YwR3Eksg/KHkegmEnH0Xua/Y5B6zQ/Qn/NkRKlPZY2dJ4vSwjxYX9KwmtF3n/L7DE0bk7yKxgrCWMrSgQzXEs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Tnllc7x6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Tnllc7x6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A46ECC4CEF7; Wed, 1 Apr 2026 11:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044175; bh=xz1grsgb4QE1o4cHB9GesAE8qhJ6lQQFIqn/KID5vfw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tnllc7x6zEKN9F7U+bg8ySDzkF9jSdpxTfoTnbvmk/kuzJ/sYG/NjwfDZ6inHO1Oc /EhJNuqVo+qFFcjj/fjTG4t7FvH7/73DVMk3rItWld3VOFc3hPShkq57juJbvm4yFK OuOjBa/ib79Lo40yyq9wodqBoUB9J2VLVSXnXzelLqcvbIhRvjrsNQYPkeVyJ/hhWe MR9qiIFeLCqngv8TClBhUW1JlJbS5mLTIFM9Ywbs9gwbFcQAsxgy9/WZUAoO8kcySG DH2hQ+Pe5WAD4+4iByp79KxYyFthjqcvoT6ilEd5BiUE6UVqgy7mAfJFJVA5UZvOT/ PKMFODChfa0KQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 18/33] rust: kbuild: remove "dummy parameter" workaround for `bindgen` < 0.71.1 Date: Wed, 1 Apr 2026 13:45:25 +0200 Message-ID: <20260401114540.30108-19-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Until the version bump of `bindgen`, we needed to pass a dummy parameter to avoid failing the `--version` call. Thus remove it. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- init/Kconfig | 7 +------ scripts/rust_is_available.sh | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index f9fac458e4d4..d9b795f70a38 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2211,12 +2211,7 @@ config RUSTC_VERSION_TEXT config BINDGEN_VERSION_TEXT string depends on RUST - # The dummy parameter `workaround-for-0.69.0` is required to support 0.69= .0 - # (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0 - # (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed - # when the minimum version is upgraded past the latter (0.69.1 and 0.71.1 - # both fixed the issue). - default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)" + default "$(shell,$(BINDGEN) --version 2>/dev/null)" =20 # # Place an empty function call at each tracepoint site. Can be diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index cefc456c2503..551f1ebd0dcb 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -121,14 +121,8 @@ fi # Check that the Rust bindings generator is suitable. # # Non-stable and distributions' versions may have a version suffix, e.g. `= -dev`. -# -# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0 -# (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0 -# (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed= when -# the minimum version is upgraded past the latter (0.69.1 and 0.71.1 both = fixed -# the issue). rust_bindings_generator_output=3D$( \ - LC_ALL=3DC "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null + LC_ALL=3DC "$BINDGEN" --version 2>/dev/null ) || rust_bindings_generator_code=3D$? if [ -n "$rust_bindings_generator_code" ]; then echo >&2 "***" --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F5233FE371; Wed, 1 Apr 2026 11:49:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044188; cv=none; b=YLAGGuDSaUEVJCtDLzOESUBomLs1G71nMgPERREQ4EjdbnH/WUy/fcw2aAtx/PiIuZ71C5wai4SQZbOkpYdtqTG2u5s/bmmvhATWzuvKyoJ+VitTkoTrC6MaK+jBvsHdGy4XEMdUS8CO7ZmsbPaXzl7K89/GohHgblZoD8oX/tI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044188; c=relaxed/simple; bh=F0SYtjFbh6kBuMGsAC3B+F39gCPSuEhNtbzMf6XGsWU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nxnvmGLdlZ9lasiLHB2rgMEUKDXA4OCdHxA1HMPYNAF6pQ/wTdgpQ6pMI2Nn33Frtod9IkEyube1lRYG1oUc4hJL8nwcjCT4v/X9N0R14GvlBrVdmwtUcg5CR6U9ZgHYaGkpqOIupADr4dLwNTK6Y30CD/CI0Ai/RzHbBoPz+xE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bjWiQDPS; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bjWiQDPS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 70ED1C4CEF7; Wed, 1 Apr 2026 11:49:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044187; bh=F0SYtjFbh6kBuMGsAC3B+F39gCPSuEhNtbzMf6XGsWU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bjWiQDPS7KU8dGTln8W81nRJSDxVd935z9qep1PRx54VbkqUXW/NAm70R8Hb3bcsR 8kFWrBfwoF6D3u90VQt9gfnLw+5MkYjBrLJXy59CfwzSQzbJ9ghvKmP0T6jqh07qPX nZgsxUNmMLQsOvMX+rmKU3cgAlYC8M5VsyLNlSoNCF1/ehwDrZSSxWO/ZDc9AkNKOl dYN2s9Ca/uJe6eLXRE8O15eARgij9XreonoLWpWBUt7AKmqzZWMSIV0sfB6T/jdTcH +x5bDQUczhl7SyXgJ6FO0IyhyMs4MyB6F3wzluhQW+3OP5KL9D3tvpD1rv5UJ4jY5I xOkZx8Uz53dQA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 19/33] rust: kbuild: remove "`try` keyword" workaround for `bindgen` < 0.59.2 Date: Wed, 1 Apr 2026 13:45:26 +0200 Message-ID: <20260401114540.30108-20-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is a workaround that has not been needed, even already after commit 08ab786556ff ("rust: bindgen: upgrade to 0.65.1"), but it does not hurt. Thus remove it. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/bindgen_parameters | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index fd2fd1c3cb9a..112ec197ef0a 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -15,10 +15,6 @@ --opaque-type x86_msi_data --opaque-type x86_msi_addr_lo =20 -# `try` is a reserved keyword since Rust 2018; solved in `bindgen` v0.59.2, -# commit 2aed6b021680 ("context: Escape the try keyword properly"). ---opaque-type kunit_try_catch - # If SMP is disabled, `arch_spinlock_t` is defined as a ZST which triggers= a Rust # warning. We don't need to peek into it anyway. --opaque-type spinlock --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E6413E7172; Wed, 1 Apr 2026 11:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044199; cv=none; b=JcQkEyuz/HTlGVe1mVKgiX/544K5WHQfxi04WegteVRYy1dTQnxU+fTG11w4l1k1Q3Eyu0BChocIxmYkZeJ+MgvhNf/2d0qE7HgMghhWKpwVnELCPoNlRO0SshtCwAqDfeOEBCNXoQg2CPSywJBRfZJP7G6Wtt3Nw4uENiC74Vk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044199; c=relaxed/simple; bh=wcbQRLM9qTKpTFYFEosr/1QG1mBAWkf0/gok9PQzPf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R5lRRbgTCrQ2my/D7SYYwFhsgmUxgNKJzrkNTJS9lcHI5jaY/9WX3H3uoDkSIREse7ARGQ9NQjlLQ5G9HVO9QxG6uXWYD3AT+wudJug1BTPTwr/ztI4t8CpJ8oQc1YR+0rjDBPB3+RfXn0hEjxj9SXM2efuXCjOxgbLOuPr9tRw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KLZvlL/X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KLZvlL/X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46A22C4CEF7; Wed, 1 Apr 2026 11:49:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044199; bh=wcbQRLM9qTKpTFYFEosr/1QG1mBAWkf0/gok9PQzPf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KLZvlL/XgCiazZjeX/Y8Xsx+YBTjea4SwD1HWIceKRTwgPjL3m8jDIKob1H4JBDVK Qv/gfay0rXXO8p6eOYCpHlnWtMyICts5OWSd/EChkJgjnopuAIv2sUN1fDAaxML48n 9TIoL+dFCzSt6wkaesp6HqT6gd69LLUqI/fxVyWnZIsvBy/1WzuOrn5BZUxz1qMYIo gaQDh06efSy/bIy5G9jpxAOh5JyNttJWHRH4Q+dopWG8qMbViy2UJZMZeohpUyx+Jz +RDMOn+Rr4uDTVxWPo738niiObo6baL76z0Nght9kLTnVeXGgAA20Xj4aKleoK+drH N2UWk3KxrLXug== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 20/33] rust: kbuild: remove unneeded old `allow`s for generated layout tests Date: Wed, 1 Apr 2026 13:45:27 +0200 Message-ID: <20260401114540.30108-21-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The issue that required `allow`s for `cfg(test)` code generated by `bindgen` for layout testing was fixed back in `bindgen` 0.60.0 [1], so it could have been removed even before the version bump, but it does not hurt. Thus remove it now. Link: https://github.com/rust-lang/rust-bindgen/pull/2203 [1] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- rust/bindings/lib.rs | 4 ---- rust/uapi/lib.rs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index 19f57c5b2fa2..e18c160dad17 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -9,10 +9,6 @@ //! using this crate. =20 #![no_std] -// See . -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( clippy::all, missing_docs, diff --git a/rust/uapi/lib.rs b/rust/uapi/lib.rs index 1d5fd9efb93e..821e286e0daa 100644 --- a/rust/uapi/lib.rs +++ b/rust/uapi/lib.rs @@ -8,10 +8,6 @@ //! userspace APIs. =20 #![no_std] -// See . -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( clippy::all, clippy::cast_lossless, --=20 2.53.0 From nobody Wed Apr 1 20:42:56 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7F2D3FF89D; Wed, 1 Apr 2026 11:50:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044211; cv=none; b=f1NYmZJduQblp+OGYCcJCuMMRHEOWyM412A+22eYTt1Lku88r5OCEZbz246urVF2YAjNjTU0BPnhkmg1a5KV/CzE4GQu6J2nZYg6XdnLc9tZId/pqvlJ9Xw0FSz7+SmwXvbUWL7uGJTbIffx8lScth85bZG/18Wr7yxf6fWEORA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044211; c=relaxed/simple; bh=iISLHJsJQiyE5V1a4iQF3ymUr2P6zTU39tNtCIX5lU0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EzS79giW6RPsn6vJTjQhNZxGmNfsmLMULaoWJpq1XY1gT07Il0IllBtwTeT5H+UposSeTJZeRv+TIHn4VaJU8Gw0ahHnF0iN8iJbsHWQZ3ccvW6cKkkbOZr53PcXqJ4u4ZCKd0W9r4FDXt8NMN6oehsx/Gti8jGlT3xJ1OyNAc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JwH43iMX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JwH43iMX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1A1EFC4AF09; Wed, 1 Apr 2026 11:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044211; bh=iISLHJsJQiyE5V1a4iQF3ymUr2P6zTU39tNtCIX5lU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JwH43iMXpXDQcRy4+AMfSoYea42pNLVjzuMUPXqV9lyKyZIS7rRAiS9cIgTsQsdyd j6B+J+/pu75uzOpJdnOhGJFNMudRyhbVI5dSzB4BiQVbTcwkXAFXR8xUeur9CaaAtt JILD8rNL8BETCD7dVZ00oT076Wj2GzJGGKGV6CXrVenq2zJx1Lq8ByMqTLw1UKAF4R wf7/Ah1lAE4c15DAF/slU0ZwiQvEKjx+rSuvc5YXtnnEw53F1u8bcFjkR9SONe1CBC +R4ZEzhNp4MYwVjW3Cv+ubljVX44Z9Rv2JtwQix1BCDgnfWCo1kCfKXLTfhQHkzxsH iTdb7Dl5K7QVw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 21/33] gpu: nova-core: bindings: remove unneeded `cfg_attr` Date: Wed, 1 Apr 2026 13:45:28 +0200 Message-ID: <20260401114540.30108-22-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" These were likely copied from the `bindings` and `uapi` crates, but are unneeded since there are no `cfg(test)`s in the bindings. In addition, the issue that triggered the addition in those crates originally is also fixed in `bindgen` (please see the previous commit). Thus remove them. Signed-off-by: Miguel Ojeda Acked-by: Danilo Krummrich Reviewed-by: Gary Guo --- drivers/gpu/nova-core/gsp/fw/r570_144.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/fw/r570_144.rs b/drivers/gpu/nova-co= re/gsp/fw/r570_144.rs index e99d315ae74c..2e6f0d298756 100644 --- a/drivers/gpu/nova-core/gsp/fw/r570_144.rs +++ b/drivers/gpu/nova-core/gsp/fw/r570_144.rs @@ -7,9 +7,6 @@ //! This module may not be directly used. Please abstract or re-export the= needed symbols in the //! parent module instead. =20 -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( dead_code, clippy::all, --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 74F743F99FB; Wed, 1 Apr 2026 11:50:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044223; cv=none; b=tNWC6278ZobjKTvV+hzF+QyYjn2BvwFfGPXoVp1VUkSTmfWB3STueBB4I+ByNn+DNJDHt3kyhcHOPaUwip0FYR12FiVhlvg1e7gT/G1SswMzYBt64+xwe/77ZBejPQmXZKIIWKMA3nXTD/OMCKPspG193jZbwLtMYDBRoLId1OM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044223; c=relaxed/simple; bh=PqI1bYJ4FCrbIrmuEKTmldqC0slnhQrUlTQ7imeH2Xw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dCDSWaCg2h6cd6oRZqitdYLYr0tHtVQXd0ekbH+FCqElmYkDBRuMlAkDrVSY5lsP7fEaUZshOcnC6E2simr87yrqPtUjjwOe7/8+Hi0PpFBBFVhDJ8x4GER911Teqp5u0CmqgatyiT3m2RE/vzzLY+BjE4keslJUZB0LTZjWI5c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ItR6p4/Y; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ItR6p4/Y" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DFE8C4CEF7; Wed, 1 Apr 2026 11:50:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044223; bh=PqI1bYJ4FCrbIrmuEKTmldqC0slnhQrUlTQ7imeH2Xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ItR6p4/Yc+nHji3wl3KUxbJ33NmAJHpvcFwT9PTjg2oSVZNOz37/llD5plurOUFoq Rj6XsVPjrS6u+JCfyT85bUeamLAjiNB1oNaiT+axluC0s7Pj+FYmYV9FQ/2oWjP4aF iGV+rsJMoa6gIkSBun+AUqT6C9iqAHuOVER7yU3112+mdIBnu+/20YfgG7i69Ez91E 1AIAC0coViVeE3+NwZ/w559DeJFlj8LnLoYci2Po4dRc4UCIPMEV4azENLjsOb2DOF P6Ab7+maJovrhEV9zROgky/+XmWAkK6Do+/7vX0TEA0Ll+1deRn2AEoMvHaLb4Y+sg MqtWGiRHh4hng== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 22/33] docs: rust: quick-start: openSUSE provides `rust-src` package nowadays Date: Wed, 1 Apr 2026 13:45:29 +0200 Message-ID: <20260401114540.30108-23-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Both openSUSE Tumbleweed and Slowroll provide the `rust-src` package nowadays [1]. Thus remove the version-specific one from the Quick Start guide. Link: https://software.opensuse.org/package/rust-src?search_term=3Drust-src= [1] Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 152289f0bed2..642efce04ee8 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -84,7 +84,7 @@ openSUSE openSUSE Slowroll and openSUSE Tumbleweed provide recent Rust releases and= thus they should generally work out of the box, e.g.:: =20 - zypper install rust rust1.79-src rust-bindgen clang + zypper install rust rust-src rust-bindgen clang =20 =20 Ubuntu --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7505340825C; Wed, 1 Apr 2026 11:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044235; cv=none; b=hkozp+5aHjKa/tp3K95nl6zj4l50CuINcOavDCXPRbTLlioa5XIELdXwrr0UPNMoVjzEdLPRvbkiSwza6K3c3iP51HOaXsj5mB//zCoVfyEpGf6fDeN47gHBO/fg6kCrdsdnGESSqew2mI7fcBwFOkhsC6qJKFY3OKw08KrqrRc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044235; c=relaxed/simple; bh=KXEoYDiY4tZg0azDFGHapuIK6YBUiFWm2HgKzXD3/qA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b9Fe8Zn3lYSVt1g1S+uQShjbnOoyP8ESicJj5fDbUw8jpHjxR6Gcmk2Jo/MdfKsv2QmDcyitgElu9v3y32MwTHXfOVNyEZm5I2z8xkGi2aj3kaIlAephnde8XAs0RsKpeDbwub7UpJdBYaM8FzuAvAk5cZqjTQH1KCEfv/XE0YM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z6epqT/3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z6epqT/3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC3B0C2BCB3; Wed, 1 Apr 2026 11:50:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044235; bh=KXEoYDiY4tZg0azDFGHapuIK6YBUiFWm2HgKzXD3/qA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6epqT/35SK/XW00qh/dGMEY8eQVcyHYx4INTRg3DGJwwZO2DEpfLPeoC6WbWMBWj fOBMfjA+2XvvlHd77JbpGAWDf4jvDSWUSLaonqCi4v/JbkT9B3AGle1XggFswn+a2w Ck4aCqW9LerCrHjefnrFVAcqf1Pvnb0JE9Mp4FXEvuvoBDMYEYvChLTBRxv5YFk+Yb XfA2+ROngYg8eVEzlQ/9BscCvvEDBa5fxhsFNA1Y29pdLbXSbNsilKjFii99Mi3RCN NKgUqcGQQxj72UVwLp60Qzyy8WMCyoqrtqAsDBb2a9muO/Ua87fRO8oi7B5V5/t/kE Bl6pQowZGrc8Q== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 23/33] docs: rust: quick-start: update Ubuntu versioned packages Date: Wed, 1 Apr 2026 13:45:30 +0200 Message-ID: <20260401114540.30108-24-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that the minimum supported Rust version is bumped, bump the versioned Rust packages [1][2][3][4] to that version for Ubuntu in the Quick Start guide. In addition, add "may" to the `RUST_LIB_SRC` line since it does not look like it is needed from a quick test in a Ubuntu 24.04 LTS container. Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Drustc [1] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbindgen [2] Link: https://launchpad.net/ubuntu/+source/rustc-1.85 [3] Link: https://launchpad.net/ubuntu/+source/rust-bindgen-0.71 [4] Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 642efce04ee8..54fe491deb7d 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -112,33 +112,33 @@ Though Ubuntu 24.04 LTS and older versions still prov= ide recent Rust releases, they require some additional configuration to be set, using the versioned packages, e.g.:: =20 - apt install rustc-1.80 rust-1.80-src bindgen-0.65 rustfmt-1.80 \ - rust-1.80-clippy - ln -s /usr/lib/rust-1.80/bin/rustfmt /usr/bin/rustfmt-1.80 - ln -s /usr/lib/rust-1.80/bin/clippy-driver /usr/bin/clippy-driver-1.80 + apt install rustc-1.85 rust-1.85-src bindgen-0.71 rustfmt-1.85 \ + rust-1.85-clippy + ln -s /usr/lib/rust-1.85/bin/rustfmt /usr/bin/rustfmt-1.85 + ln -s /usr/lib/rust-1.85/bin/clippy-driver /usr/bin/clippy-driver-1.85 =20 None of these packages set their tools as defaults; therefore they should = be specified explicitly, e.g.:: =20 - make LLVM=3D1 RUSTC=3Drustc-1.80 RUSTDOC=3Drustdoc-1.80 RUSTFMT=3Drustfmt= -1.80 \ - CLIPPY_DRIVER=3Dclippy-driver-1.80 BINDGEN=3Dbindgen-0.65 + make LLVM=3D1 RUSTC=3Drustc-1.85 RUSTDOC=3Drustdoc-1.85 RUSTFMT=3Drustfmt= -1.85 \ + CLIPPY_DRIVER=3Dclippy-driver-1.85 BINDGEN=3Dbindgen-0.71 =20 -Alternatively, modify the ``PATH`` variable to place the Rust 1.80 binaries +Alternatively, modify the ``PATH`` variable to place the Rust 1.85 binaries first and set ``bindgen`` as the default, e.g.:: =20 - PATH=3D/usr/lib/rust-1.80/bin:$PATH + PATH=3D/usr/lib/rust-1.85/bin:$PATH update-alternatives --install /usr/bin/bindgen bindgen \ - /usr/bin/bindgen-0.65 100 - update-alternatives --set bindgen /usr/bin/bindgen-0.65 + /usr/bin/bindgen-0.71 100 + update-alternatives --set bindgen /usr/bin/bindgen-0.71 =20 -``RUST_LIB_SRC`` needs to be set when using the versioned packages, e.g.:: +``RUST_LIB_SRC`` may need to be set when using the versioned packages, e.g= .:: =20 - RUST_LIB_SRC=3D/usr/src/rustc-$(rustc-1.80 --version | cut -d' ' -f2)/lib= rary + RUST_LIB_SRC=3D/usr/src/rustc-$(rustc-1.85 --version | cut -d' ' -f2)/lib= rary =20 For convenience, ``RUST_LIB_SRC`` can be exported to the global environmen= t. =20 -In addition, ``bindgen-0.65`` is available in newer releases (24.04 LTS and -24.10), but it may not be available in older ones (20.04 LTS and 22.04 LTS= ), +In addition, ``bindgen-0.71`` is available in newer releases (24.04 LTS), +but it may not be available in older ones (20.04 LTS and 22.04 LTS), thus ``bindgen`` may need to be built manually (please see below). =20 =20 --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 61B92405ACD; Wed, 1 Apr 2026 11:50:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044247; cv=none; b=h/ge4FqojgXlMZhRq0OUz5FSyB+ht4wvzoovtU1aBkZ2E98SIybOr0gX7sw26Yabt9x74C5EsmxMqOXUGjGPdsW6MV1H8qve0T5zSz8ywxaSi9KJfDxlUYqrBOBKlOgBagGJmKEAl+uLSXHiWpf8WNnrxY7uBKy1SkHk92f4Fjg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044247; c=relaxed/simple; bh=gdqep/CIy3f2tHlGVIduJ54heItiKNgLxJWrndWddZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r2qXi0PvexWWLmSaZun8h3k3pkCVAl1azbrCRFwUDvFtNpW/W5UUgod2uAA5nKH0PDYQAfci8VxW33AP0mJWSxR9A9EH/YqBOxx4kBotdHXDQuonGXiFsQ5mYA60gcb6HfDOD4w0TntzqwaESTMunWWEgfwBHkSBFU76Nzs8UtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O+Hhh1an; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="O+Hhh1an" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7DB0C4CEF7; Wed, 1 Apr 2026 11:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044247; bh=gdqep/CIy3f2tHlGVIduJ54heItiKNgLxJWrndWddZg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O+Hhh1anJc+19GFocBbrXlmEQQSkj943VY8/0XHji23fuRQZsWqQAH+1TSazaKmiL qIo6GTr7gQXcIVZ17+Mt5jLGu8cpZaFYiedii3pg0W6olOnWbfza9XhlEVRwZ98yx0 LcXVWwJgYRdsT/s5pj5faIm2xA8SiH42BTO7/qQTMkiUf3alp8Cdu8qqXXHghDJdG/ ZqKeehF27SbWaYSWGlBEsyIr+orFdLth2J7uIk+9AfP92IrtdGMKAQRdG/dhvr8O8B TOGYY/rqEnbd4s7uEUlRNJC+4aYbShoioRKpA/J5CM4OvzM/TxjoPZsAOk1Hqu0iFq UYI5ugbEIjfxg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 24/33] docs: rust: quick-start: update minimum Ubuntu version Date: Wed, 1 Apr 2026 13:45:31 +0200 Message-ID: <20260401114540.30108-25-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Ubuntu 25.04 is out of support [1], and Ubuntu 25.10 is the latest supported one. Moreover, Ubuntu 25.10 is the first that provides a recent enough Rust given the minimum bump -- they provide 1.85.1 [2]. Thus update it. Link: https://ubuntu.com/about/release-cycle [1] Link: https://packages.ubuntu.com/search?keywords=3Drustc&searchon=3Dnames&= exact=3D1&suite=3Dall§ion=3Dall [2] Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 54fe491deb7d..34c39f208333 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -90,7 +90,7 @@ they should generally work out of the box, e.g.:: Ubuntu ****** =20 -25.04 +25.10 ~~~~~ =20 The latest Ubuntu releases provide recent Rust releases and thus they shou= ld --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DAD54070F9; Wed, 1 Apr 2026 11:50:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044259; cv=none; b=ZHns8hhisxnkBkCk1H5EXBkUY8YKhjWe19TaO8v2OOMKfC9cliWCq+xuG3zQnLmdhbv7Vo6wsLxPrzzhkxIIebqBE3PwtlYgG+thybU/UzxpA9UhWXUSZqIP1rubRTO+F+7BecXB65NuINu0Jow6tKO3/abSVh7pV7vNc/7gcM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044259; c=relaxed/simple; bh=ZrS7YCyshnbs/lG/9j9L7W/ZUrAuF338JPwI0nwq6Ho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kxOe1TDL6hOW8pqozZANUPCg86D68IJ0kfDHClQ8z3J4kgK++6tuWQhqvwE/fRGgqNg+uP8bMdNKL+fJedhAKWep65ovOcuPShq0ZJIic/BhHe2rTS/ettGgnVf4RGDEzAstumXL45Vs7CPPeHeqX05M0CNTgkVZjUznrkKacIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fYUKktNt; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fYUKktNt" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8A793C4CEF7; Wed, 1 Apr 2026 11:50:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044258; bh=ZrS7YCyshnbs/lG/9j9L7W/ZUrAuF338JPwI0nwq6Ho=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fYUKktNtjBtnO2jEekVdFzAXCPxvMmq8cOZ/wimER2kJOuz26TYi2q5bk91NF6CFY V3uRQuToa4yd5/BlRrJuDUAvl/Ng8LmL71ojncQB2XFtcInSO8RsXWX1UcDolbNEKf Vr7CCsu4JLP8hJ8Kq7urO0JEocaF0r6VbZa+42Sdln5aiR3/s6R5CaAOkIYDTOBYFN jQ19XQq/9YUv1eHqK24bolOhTgYGxRPfjpfeAX42W17zK+3HMCGkzXRWdt2m3/51bF jzN98RjCjBcK57ESqOPlvU09ERPYNtXiyClFAHc+QnLlv5x2uSLTqHwOePbncyE2kZ tpwl4A5SNvXTg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 25/33] docs: rust: quick-start: add Ubuntu 26.04 LTS and remove subsection title Date: Wed, 1 Apr 2026 13:45:32 +0200 Message-ID: <20260401114540.30108-26-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Ubuntu 26.04 LTS (Resolute Raccoon) is scheduled to be released in a few weeks [1], and it has a recent enough Rust toolchain, just like Ubuntu 25.10 has [2][3]. We could update the title and the paragraph, but to simplify and to make it more consistent with the other distributions' sections, let's instead just remove that title. It will also reduce the differences later on to keep it updated. Eventually, when we remove the remaining subsection for older LTSs, Ubuntu should be a small section like the other distributions. Thus remove the title and add the mention of Ubuntu 26.04 LTS. Link: https://documentation.ubuntu.com/release-notes/26.04/schedule/#resolu= te-raccoon-schedule [1] Link: https://packages.ubuntu.com/search?keywords=3Drustc&searchon=3Dnames&= exact=3D1&suite=3Dall§ion=3Dall [2] Link: https://packages.ubuntu.com/search?keywords=3Dbindgen&searchon=3Dname= s&exact=3D1&suite=3Dall§ion=3Dall [3] Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 34c39f208333..db08c3a03a4f 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -90,10 +90,7 @@ they should generally work out of the box, e.g.:: Ubuntu ****** =20 -25.10 -~~~~~ - -The latest Ubuntu releases provide recent Rust releases and thus they shou= ld +Ubuntu 25.10 and 26.04 LTS provide recent Rust releases and thus they shou= ld generally work out of the box, e.g.:: =20 apt install rustc rust-src bindgen rustfmt rust-clippy --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59F7B3FCB2B; Wed, 1 Apr 2026 11:51:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044271; cv=none; b=G6E1XU9Y6DoPhfks68ictSUa5hXQsugMiGvnqITWaJUZiiEo92vz+nMHKs1HQN93fWT9+h0KtwCmJgN0biALMl8ATmZTSlHO89qXHf9ecrPbTJeV4LEcZCUuBdlcAv380OhL6Aj4gzOOAhGBnB+yJ/oCpIayiuIi5VVYMdnnFCM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044271; c=relaxed/simple; bh=iESh/PsAjDcxQq1FPvUHHfd+weV5KPEgRwQZ+Kj82r4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F5WHrMAMlTNnfr6L3yVP+1vKshge/CbKTeXX1bTsXZuxT7N8j7rJrrAKSBozGHu7vVALrnaHXe0wCoU/82nZ11YtA4fr80QNyfB5gB/2doTRaVTCzzz9h3JxeJ7EIqC8+dSPYzw1KDD0DD/2TVBSWSL6dizG2KIgr5c9fOV7QTM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MMSjHj3h; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MMSjHj3h" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57F5DC4CEF7; Wed, 1 Apr 2026 11:50:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044270; bh=iESh/PsAjDcxQq1FPvUHHfd+weV5KPEgRwQZ+Kj82r4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MMSjHj3hxQyMr3QOLPc9anPPOGIWvLjjfUs5B9icQA6qsTjz7U5bSiiQLz5Hoz/OZ 3YloS9ZOhT+qiN9KqpcVdJ/fLcbsTEZsVpLlIJR/p8UWfxVDZt/sNTHzb3Tb1udZ9E jYKb+IF68+AxkebN//+Bv/5FcswBwbEnYjMPl5q4E8tRf1uFO6MDGiu0giHqkZrPMZ B/JU0qy6HQc8IL0tBX9Pvko/kdINTPzrBMF75o1WUkXp4U9BqKKQmSf0bTLleTLfsz 9SSYwlPv8GbLy88Jt1O+HwrOoOXCjTR4QWXF2VgqHQ3s27vGf1rd5NqLc88kF63w+j heSTJSaAyigww== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 26/33] docs: rust: quick-start: remove Gentoo "testing" note Date: Wed, 1 Apr 2026 13:45:33 +0200 Message-ID: <20260401114540.30108-27-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Gentoo does not need the "testing" note, since its packages are recent enough even in the stable branch [1][2]. Thus remove it to simplify the documentation. Link: https://packages.gentoo.org/packages/dev-lang/rust [1] Link: https://packages.gentoo.org/packages/dev-util/bindgen [2] Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index db08c3a03a4f..1518367324fe 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -57,8 +57,8 @@ of the box, e.g.:: Gentoo Linux ************ =20 -Gentoo Linux (and especially the testing branch) provides recent Rust rele= ases -and thus it should generally work out of the box, e.g.:: +Gentoo Linux provides recent Rust releases and thus it should generally wo= rk out +of the box, e.g.:: =20 USE=3D'rust-src rustfmt clippy' emerge dev-lang/rust dev-util/bindgen =20 --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB5143E5599; Wed, 1 Apr 2026 11:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044282; cv=none; b=jzR3VhlgzPplRAjS/nzc7QKBU0EsDMc7W5nBosrS9fyw5zntBowPCFLsOywsU8Ck8/vXk0iS11rhNRaN35BOOKtEmVJ9jRRa8uHQ8pHtTYpjhTaP3gshLLWszhIK5341vo9Uk4S0N7T1GsERle/fLl+1dKSajhprmIi13forj2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044282; c=relaxed/simple; bh=zBRgkfbt3hF9WvqxM8XN0aG8ALClzrJ4tfRHlURA+/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TDricKcs9PivF/Ug9KmlPNXic9c9wH3b9fik9i1aFQFCbrS6pEUKBSBY3Q259GDB5aCLPM9Dy+FAzokjsTC65m5LO3DAqpKEmdlTbC29c/j/N56knB96bbrHrk0r5IoD2JDIdr7ndt7OHb9TeAIgh6AwCZ/BJyCk0nQkcQ9nzPA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iITjMsfh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iITjMsfh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AAF0C116C6; Wed, 1 Apr 2026 11:51:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044282; bh=zBRgkfbt3hF9WvqxM8XN0aG8ALClzrJ4tfRHlURA+/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iITjMsfhfcTYUWXW6qoQkraYuvMY0slG34Cknkq2VHyvat3oaJRuW0fZ+/koONznL SPdU99XrlrEP5k8CChuk0LAjmH1IitsUhLZv2gSSl2RW0XxgMpM2bkRAYRJAr4LAca lwlWeeG0+4pPPo3E5MWDbDXuJv07Vcm+IFEzC12fdTyQYiMlmOdOIBZyVwEYiVs+T0 mvSRJh8CrjRcRnyHxBcF/zH6E1feLSaQUx3OPc8l5NRdZGdjusjdGfUPQF6ij/n0KC eeR+DlUNUhIyF+MboRGXbUUdBuglvWFtU/G4DG9cD0Wrr6a6k9Twbor59rqsvwp1T4 2MDeXpey3+CMA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 27/33] docs: rust: quick-start: remove Nix "unstable channel" note Date: Wed, 1 Apr 2026 13:45:34 +0200 Message-ID: <20260401114540.30108-28-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Nix does not need the "unstable channel" note, since its packages are recent enough even in the stable channel [1][2]. Thus remove it to simplify the documentation. Link: https://search.nixos.org/packages?channel=3D25.11&query=3Drust [1] Link: https://search.nixos.org/packages?channel=3D25.11&query=3Dbindgen [2] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Documentation/rust/quick-start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 1518367324fe..5bbe059a8fa3 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -68,8 +68,8 @@ of the box, e.g.:: Nix *** =20 -Nix (unstable channel) provides recent Rust releases and thus it should -generally work out of the box, e.g.:: +Nix provides recent Rust releases and thus it should generally work out of= the +box, e.g.:: =20 { pkgs ? import {} }: pkgs.mkShell { --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A22CF407108; Wed, 1 Apr 2026 11:51:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044294; cv=none; b=RVND+hvkWsvcOWkWotOblCpqCzrwdR/4OcExfH/JTHZZmjHFY4qdx3pKpYXlH+wy980X5bTuOjItvvWjlmkx7sKKnOAEU3IARQxdfVyGU8LfZMC4WTo6e6MtG+4U+ieMeBv67uqficcdfyxJ7jwdYESwPET76YYVeB18kRA1LKk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044294; c=relaxed/simple; bh=yKvVVQSsm3ADeF9w4UcOYUs55+Yf5zunUU3xGxiWVJk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iaoP5s7T0f+qZ7jsfXKQlL5ikI5/dUVFLV38w7X6s4gJoVR4wv3N8sUmfPmAWaIg7XMjBKhAbR6L0GcO2T++459VGWR9lmG0rNzSCLA0osABkOVEmAYRQkpK+Wvd1Ze9yBDGdeCkOBXHuI1b+j9RnPym25XE0SVzirdXSpX33LQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qt9hgTLa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qt9hgTLa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09D57C116C6; Wed, 1 Apr 2026 11:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044294; bh=yKvVVQSsm3ADeF9w4UcOYUs55+Yf5zunUU3xGxiWVJk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qt9hgTLa2Us6ZAkjaDuidhhjBEvQbNdulZHZKXQzC+eR8wTzSc77xJJ4dkBB9WzzC 56So1K8x2lvFO5CwxaplRlWHIiDYAL2Mi584X4uRylEkZluCLgYJv7XA2Ib5lu3mp9 /0rASa7YRY69ivi92iRCKMtbZ8gRaxDbRECSS/jsbMr266RSERosPt+9kyn9IYS6PO /jrkgOh8JThQ7n5bruoE5xHV1QuoewRsBnEwccKdY1YZRxh5s2PfRgQiU1MSTkVgtN rJ2E7yTdsHe1fmPWtL3F7NSZDISppgJS77qEymsIzNL65GsE84OdkUOCPCwIz7gUv8 Z7Ygn1YR5NvuA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 28/33] docs: rust: quick-start: remove GDB/Binutils mention Date: Wed, 1 Apr 2026 13:45:35 +0200 Message-ID: <20260401114540.30108-29-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The versions provided nowadays by even a distribution like Debian Stable (and Debian Old Stable) are newer than those mentioned [1]. Thus remove the workaround. Note that the minimum binutils version in the kernel is still 2.30, so one could argue part of the note is still relevant, but it is unlikely a kernel developer using such an old binutils is enabling Rust on a modern kernel, especially when using distribution toolchains, e.g. the Rust minimum version is not satisfied by Debian Old Stable. So we are at the point where keeping the docs short and relevant for essentially everyone is probably the better trade-off. Link: https://packages.debian.org/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbinutils [1] Link: https://lore.kernel.org/all/CANiq72mCpc9=3D2TN_zC4NeDMpFQtPXAFvyiP+gR= Apg2vzspPWmw@mail.gmail.com/ Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Documentation/rust/quick-start.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 5bbe059a8fa3..a6ec3fa94d33 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -352,12 +352,3 @@ Hacking To dive deeper, take a look at the source code of the samples at ``samples/rust/``, the Rust support code under ``rust/`` and the ``Rust hacking`` menu under ``Kernel hacking``. - -If GDB/Binutils is used and Rust symbols are not getting demangled, the re= ason -is the toolchain does not support Rust's new v0 mangling scheme yet. -There are a few ways out: - -- Install a newer release (GDB >=3D 10.2, Binutils >=3D 2.36). - -- Some versions of GDB (e.g. vanilla GDB 10.1) are able to use - the pre-demangled names embedded in the debug info (``CONFIG_DEBUG_INFO`= `). --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A1C23DCDA9; Wed, 1 Apr 2026 11:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044306; cv=none; b=NWeRN6PMdF2YG0s9CnKwsR5Xx06tMl/dw7k0pQJ9jh+ZIQcnYRDVNmgnjvUafinL/PzdLYigN+6fGMzybuBSkKEgdM64S093lF+aZblreHTAUpwVqwbhg8UtaYjCgVqUJ1xoKqH8Kpp2PcBn88J8WHhoPr84dU4WlhP7Sl29V+o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044306; c=relaxed/simple; bh=hwrpFVeGAL5GC09atZjTVNJE6Ow3imO9X2morwqR56Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PgL3rUAkoMhV2AHwPKwpJgkyMOE7uWBZrFK+OxoQFpmHQIjgkcd8enrt10bkcSkrVMmFXt4jEY2sm5vicDXDdtgrRXsfmuT18yuEQEH3Ox+blpU5qsKI+suULakQ50S09jYmgyxWmcXWIkOt0ZkLD3xzYNV5YWmA6Hx9m0n7PjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Rzw1kaCE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Rzw1kaCE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC33FC4CEF7; Wed, 1 Apr 2026 11:51:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044306; bh=hwrpFVeGAL5GC09atZjTVNJE6Ow3imO9X2morwqR56Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rzw1kaCEQHUMV8e2JhQRZ0slowyGy7FMm4tP6h9JKv2f1/pjKA/CgbLPmqJSfwYW9 XpjqdVAQSA7tGhxbEGXHSOp/b4ykgFgY9+afWac2nDN+7rfydkcDZpWR8hxb/XS02j LNBRkTa0ZCJ8Ct7VSdEoSy0AjoAeVUdW2NIf9cHqHXqPRJVw10D2vW/WD8KAcd4+X9 adeYuW0+L8tLudnViZX5MEfIqqFc301C2pW4Ki+5taOqHHUTBnQwc2GJaFeET7o+/8 HquRyfA0XF2MWJo5hgtDXCWTUfmcnrUxW/us7Td3H6gTg1P4obsqnA35gxHSgJmIa7 NPNA/tvRJKfsA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 29/33] docs: rust: general-information: simplify Kconfig example Date: Wed, 1 Apr 2026 13:45:36 +0200 Message-ID: <20260401114540.30108-30-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is no need to use `def_bool y if ` -- one can simply write `def_bool `. In fact, the simpler form is how we actually use them in practice in `init/Kconfig`. Thus simplify the example. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Documentation/rust/general-information.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/general-information.rst b/Documentation/rus= t/general-information.rst index 6146b49b6a98..91535b2306ed 100644 --- a/Documentation/rust/general-information.rst +++ b/Documentation/rust/general-information.rst @@ -158,4 +158,4 @@ numerical comparisons, one may define a new Kconfig sym= bol: .. code-block:: kconfig =20 config RUSTC_VERSION_MIN_107900 - def_bool y if RUSTC_VERSION >=3D 107900 + def_bool RUSTC_VERSION >=3D 107900 --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3F73405AC3; Wed, 1 Apr 2026 11:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044318; cv=none; b=u9bQTyffptzxZKt0zmhZS3/zRg4LFFEKG6YNoQbSBXbrTLLaFzthuH6Wv9P4cnBKTH24HxeSos9AjJahk1CPC9XkckXC5sFniVb24uDrpDuIThnKzYv/CkyCxIblc5Zj0cy2wYGCIenqO9Gbx7x++7cCOerut0q+pNry8KJcu7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044318; c=relaxed/simple; bh=aZ7CkV02m73TgymHW6id2ohHebQcMp+UooNV/WCpxYw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CdS8WhRNmtJAJbcJDluWrJq2vCj0GWpsvDSHlnNqWxwWZ7/gxoaGRLfYuETBSG6d9jRf8kE82snsq/vIYLQmxD30oFIZyVprgUQyjn6DEPZ5C90R2rbA2gcg8oHrz0B2eJvcmPSBfMs7iZk3WKAbt30GY1FCTUiipxorXvQ0MCo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=a2tJ6c9W; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="a2tJ6c9W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C070C4CEF7; Wed, 1 Apr 2026 11:51:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044317; bh=aZ7CkV02m73TgymHW6id2ohHebQcMp+UooNV/WCpxYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a2tJ6c9W9iABHNjYNfL/0mBtFgGwAUtGo9jT4oJbjkTLOc0Yo+AEpPKIParMZ1LNj 0sANrmLte5HVlY/RSowfUU1n6HJVpsbzGcrRxFYwfBYM+mr5AsX8sQv1gk5sj4H7wt Dw7M4GzLoUzHr41RJA4HSozfVBTZlvmb01WCmT7Cpg4oqA0MoM9u8F3rYEJ84ZlHa/ l6ZHQwkSMoXTmsP6WHnxky2MzbKxBsA9VRTh/QtS8r/wLVDjLYI1nc1ywv3yacbrWe OUhyb3YotIxHBUCZq8fmNmrB8uzKk1sfz69jzjTz+KCMR7GzlinoB3zsZ7EklUMIKY cppDn06YQZSHg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 30/33] docs: rust: general-information: use real example Date: Wed, 1 Apr 2026 13:45:37 +0200 Message-ID: <20260401114540.30108-31-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently the example in the documentation shows a version-based name for the Kconfig example: RUSTC_VERSION_MIN_107900 The reason behind it was to possibly avoid repetition in case several features used the same minimum. However, we ended up preferring to give them a descriptive name for each feature added even if that could lead to some repetition. In practice, the repetition has not happened so far, and even if it does at some point, it is not a big deal. Thus replace the example in the documentation with one of our current examples (after removing previous ones from the bump), to show how they actually look like, and in case someone `grep`s for it. In addition, it has the advantage that it shows the `RUSTC_HAS_*` pattern we follow in `init/Kconfig`, similar to the C side. Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Documentation/rust/general-information.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/general-information.rst b/Documentation/rus= t/general-information.rst index 91535b2306ed..09234bed272c 100644 --- a/Documentation/rust/general-information.rst +++ b/Documentation/rust/general-information.rst @@ -157,5 +157,5 @@ numerical comparisons, one may define a new Kconfig sym= bol: =20 .. code-block:: kconfig =20 - config RUSTC_VERSION_MIN_107900 - def_bool RUSTC_VERSION >=3D 107900 + config RUSTC_HAS_SPAN_FILE + def_bool RUSTC_VERSION >=3D 108800 --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3EA1225791; Wed, 1 Apr 2026 11:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044329; cv=none; b=V6hYlOdMKDPr3GRlhzPlRVSR111mTIWaRebnNbB4AU8lZZIdMMeDdyWBKhwzwJ7UWiMCxI7w9V641EXgFldQIvEXo+M1Mu8MMMDcTlVyqUjv/GwwcT4UYePkxMmbnMq1WB2Y3/8yadWSDjCV0/a1p975aLrZBM473CTSdVVIXPc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044329; c=relaxed/simple; bh=p+eIRLsw7Ht2kqc3WxH3RBV0AlZGw5SEVt3OYrIrUc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HM3YzDjOQGu6++8ZwDg+BPdH2YHwilb+3qfv+OZ6Mpc5afuUg88vTu6UOMd75GJfI3+7cgdPlFdtpHpnExeQ5IRdKuO/LyZaalCSiR9zWU1HKd9onXo7jAc+FqumZV2N7IRK0ckNkdJEmMVrnLGqvQOJKfNMKQh4UwIub52/NVU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tnpTAw+z; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tnpTAw+z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67D7DC4CEF7; Wed, 1 Apr 2026 11:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044329; bh=p+eIRLsw7Ht2kqc3WxH3RBV0AlZGw5SEVt3OYrIrUc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tnpTAw+zyfpSqG/NYpAECXMF/A5Hs4KTeUHMny0KZf81sDUHcF6LI1WigdsMpEd7v 5ko9J802N3Ioa9jG1ez62+v8CsSMBcS6Tz/fLW4mlmL086Ky2uo3B+YSzBVdVhELad Y6Rjj7rOuWQYFGyk5X88UD3VUQK8upxhvz46HmbFojIDjJ84UUaSyLNDlYWdnqiIKy ewka9WzjgjPJEKp8GrLSJ3WixASKNMxgFIPOVljiGQlwFojffy5X1BJun/PpM3ypJ8 i08pl6ZR10hlLfVtHlHYRzo/sho85zmt7uTFKb+xkhIS0XKWtSlg3dtYQPqdW8e0ww agY9gqQJBOUuw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 31/33] rust: declare cfi_encoding for lru_status Date: Wed, 1 Apr 2026 13:45:38 +0200 Message-ID: <20260401114540.30108-32-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alice Ryhl By default bindgen will convert 'enum lru_status' into a typedef for an integer. For the most part, an integer of the same size as the enum results in the correct ABI, but in the specific case of CFI, that is not the case. The CFI encoding is supposed to be the same as a struct called 'lru_status' rather than the name of the underlying native integer type. To fix this, tell bindgen to generate a newtype and set the CFI type explicitly. Note that we need to set the CFI attribute explicitly as bindgen is using repr(transparent), which is otherwise identical to the inner type for ABI purposes. This allows us to remove the page range helper C function in Binder without risking a CFI failure when list_lru_walk calls the provided function pointer. The --with-attribute-custom-enum argument requires bindgen v0.71 or greater. [ In particular, the feature was added in 0.71.0 [1][2]. In addition, `feature(cfi_encoding)` has been available since Rust 1.71.0 [3]. Link: https://github.com/rust-lang/rust-bindgen/issues/2520 [1] Link: https://github.com/rust-lang/rust-bindgen/pull/2866 [2] Link: https://github.com/rust-lang/rust/pull/105452 [3] - Miguel ] My testing procedure was to add this to the android17-6.18 branch and verify that rust_shrink_free_page is successfully called without crash, and verify that it does in fact crash when the cfi_encoding is set to other values. Note that I couldn't test this on android16-6.12 as that branch uses a bindgen version that is too old. Signed-off-by: Alice Ryhl Link: https://patch.msgid.link/20260223-cfi-lru-status-v2-1-89c6448a63a4@go= ogle.com [ Rebased on top of the minimum Rust version bump series which provide the required `bindgen` version. - Miguel ] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- drivers/android/binder/Makefile | 3 +-- drivers/android/binder/page_range.rs | 6 +++--- drivers/android/binder/page_range_helper.c | 24 ---------------------- drivers/android/binder/page_range_helper.h | 15 -------------- rust/bindgen_parameters | 4 ++++ rust/bindings/bindings_helper.h | 1 - rust/bindings/lib.rs | 1 + rust/uapi/lib.rs | 1 + 8 files changed, 10 insertions(+), 45 deletions(-) delete mode 100644 drivers/android/binder/page_range_helper.c delete mode 100644 drivers/android/binder/page_range_helper.h diff --git a/drivers/android/binder/Makefile b/drivers/android/binder/Makef= ile index 09eabb527fa0..7e0cd9782a8b 100644 --- a/drivers/android/binder/Makefile +++ b/drivers/android/binder/Makefile @@ -5,5 +5,4 @@ obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) +=3D rust_binder.o rust_binder-y :=3D \ rust_binder_main.o \ rust_binderfs.o \ - rust_binder_events.o \ - page_range_helper.o + rust_binder_events.o diff --git a/drivers/android/binder/page_range.rs b/drivers/android/binder/= page_range.rs index fdd97112ef5c..8e9f5c4819d0 100644 --- a/drivers/android/binder/page_range.rs +++ b/drivers/android/binder/page_range.rs @@ -642,15 +642,15 @@ fn drop(self: Pin<&mut Self>) { unsafe { bindings::list_lru_walk( list_lru, - Some(bindings::rust_shrink_free_page_wrap), + Some(rust_shrink_free_page), ptr::null_mut(), nr_to_scan, ) } } =20 -const LRU_SKIP: bindings::lru_status =3D bindings::lru_status_LRU_SKIP; -const LRU_REMOVED_ENTRY: bindings::lru_status =3D bindings::lru_status_LRU= _REMOVED_RETRY; +const LRU_SKIP: bindings::lru_status =3D bindings::lru_status::LRU_SKIP; +const LRU_REMOVED_ENTRY: bindings::lru_status =3D bindings::lru_status::LR= U_REMOVED_RETRY; =20 /// # Safety /// Called by the shrinker. diff --git a/drivers/android/binder/page_range_helper.c b/drivers/android/b= inder/page_range_helper.c deleted file mode 100644 index 496887723ee0..000000000000 --- a/drivers/android/binder/page_range_helper.c +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -/* C helper for page_range.rs to work around a CFI violation. - * - * Bindgen currently pretends that `enum lru_status` is the same as an int= eger. - * This assumption is fine ABI-wise, but once you add CFI to the mix, it - * triggers a CFI violation because `enum lru_status` gets a different CFI= tag. - * - * This file contains a workaround until bindgen can be fixed. - * - * Copyright (C) 2025 Google LLC. - */ -#include "page_range_helper.h" - -unsigned int rust_shrink_free_page(struct list_head *item, - struct list_lru_one *list, - void *cb_arg); - -enum lru_status -rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *li= st, - void *cb_arg) -{ - return rust_shrink_free_page(item, list, cb_arg); -} diff --git a/drivers/android/binder/page_range_helper.h b/drivers/android/b= inder/page_range_helper.h deleted file mode 100644 index 18dd2dd117b2..000000000000 --- a/drivers/android/binder/page_range_helper.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2025 Google, Inc. - */ - -#ifndef _LINUX_PAGE_RANGE_HELPER_H -#define _LINUX_PAGE_RANGE_HELPER_H - -#include - -enum lru_status -rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *li= st, - void *cb_arg); - -#endif /* _LINUX_PAGE_RANGE_HELPER_H */ diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index 112ec197ef0a..6f02d9720ad2 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -19,6 +19,10 @@ # warning. We don't need to peek into it anyway. --opaque-type spinlock =20 +# enums that appear in indirect function calls should specify a cfi type +--newtype-enum lru_status +--with-attribute-custom-enum=3Dlru_status=3D'#[cfi_encoding=3D"10lru_statu= s"]' + # `seccomp`'s comment gets understood as a doctest --no-doc-comments =20 diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index 083cc44aa952..faf3ee634ced 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -149,5 +149,4 @@ const vm_flags_t RUST_CONST_HELPER_VM_NOHUGEPAGE =3D VM= _NOHUGEPAGE; #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST) #include "../../drivers/android/binder/rust_binder.h" #include "../../drivers/android/binder/rust_binder_events.h" -#include "../../drivers/android/binder/page_range_helper.h" #endif diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index e18c160dad17..854e7c471434 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -19,6 +19,7 @@ unreachable_pub, unsafe_op_in_unsafe_fn )] +#![feature(cfi_encoding)] =20 #[allow(dead_code)] #[allow(clippy::cast_lossless)] diff --git a/rust/uapi/lib.rs b/rust/uapi/lib.rs index 821e286e0daa..b8a515de31ca 100644 --- a/rust/uapi/lib.rs +++ b/rust/uapi/lib.rs @@ -24,6 +24,7 @@ unsafe_op_in_unsafe_fn )] #![cfg_attr(CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES, allow(unnecessary_tra= nsmutes))] +#![feature(cfi_encoding)] =20 // Manual definition of blocklisted types. type __kernel_size_t =3D usize; --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7A97421EEA; Wed, 1 Apr 2026 11:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044341; cv=none; b=pmVJKa7MHnPU1XdskoWN54l4I9pvLfvhgN+MEZ63+7Wb7Da0F2T1/OWi6no94axl1F2sAfcCaT+hhqqBUYfwuCA8qfxIqpmqLu79kkwu6PBsXhIO5Yd+POFIwWHleVrlEyrXoLEsVFzuXUBX10m9c7wg83LsC7OpIYmQ9mW95K8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044341; c=relaxed/simple; bh=rmbcm0lGdPnutdStnqg0waumItTikO0U9rMNdtnv3yc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Puot5NmiKlzST5EjfVGdkYikXoedd9EhHaWEt14fox1ieSP9Kd1ojhpl+3BOEz3dcfteJwSbQ2SO6RUHaaRnGI5Mqnwhc+tH8kmcKxbwmSI1gdaKoOhH0cmIsrpP9BUNdZMfNCOKQ+qIlYtWlfxytTaRpkjqDpiDVHq8/J6RUAs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TcBvoubs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TcBvoubs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 45C32C2BCB2; Wed, 1 Apr 2026 11:52:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044341; bh=rmbcm0lGdPnutdStnqg0waumItTikO0U9rMNdtnv3yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TcBvoubspcdQyo/6SD8RpK23KLdBlZmlyr+Q8oe4E3dFkmpEEorBsmt3GesO7Nl9q YWS4m1in4cZ+dOT++Q1J8Ig3gXZ3l/Hig5Eq0rMW9FYKtKQyhyMus1JqK0WZx6+cBF JUayEvXxkm9IOj16k6bywJiawbKZPnONK55YY01FSqb/NrgkEyVGWBIPdo/SvIYWic U4AVc/BrZqDX7suU+KqtSQ4Q52UqYwQ2LYV11NVcOdsn5R4QiS61WDhULH+KewBvAe /h+DQTiY+hPt11we7Vp7ycNYeVm2Tn/oACaSi3eP098GkbftxBkTZa4EkAWaXiFg9t Bec4c3Sfzej1A== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 32/33] rust: kbuild: support global per-version flags Date: Wed, 1 Apr 2026 13:45:39 +0200 Message-ID: <20260401114540.30108-33-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Sometimes it is useful to gate global Rust flags per compiler version. For instance, we may want to disable a lint that has false positives in a single version [1]. We already had helpers like `rustc-min-version` for that, which we use elsewhere, but we cannot currently use them for `rust_common_flags`, which contains the global flags for all Rust code (kernel and host), because `rustc-min-version` depends on `CONFIG_RUSTC_VERSION`, which does not exist when `rust_common_flags` is defined. Thus, to support that, introduce `rust_common_flags_per_version`, defined after the `include/config/auto.conf` inclusion (where `CONFIG_RUSTC_VERSION` becomes available), and append it to `rust_common_flags`, `KBUILD_HOSTRUSTFLAGS` and `KBUILD_RUSTFLAGS`. An alternative is moving all those three down, but that would mean separating them from the other `KBUILD_*` variables. Link: https://lore.kernel.org/rust-for-linux/CANiq72mWdFU11GcCZRchzhy0Gi1QZ= ShvZtyRkHV2O+WA2uTdVQ@mail.gmail.com/ [1] Link: https://patch.msgid.link/20260307170929.153892-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda --- Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Makefile b/Makefile index 1a219bf1c771..20c8179d96ee 100644 --- a/Makefile +++ b/Makefile @@ -834,6 +834,14 @@ endif # CONFIG_TRACEPOINTS =20 export WARN_ON_UNUSED_TRACEPOINTS =20 +# Per-version Rust flags. These are like `rust_common_flags`, but may +# depend on the Rust compiler version (e.g. using `rustc-min-version`). +rust_common_flags_per_version :=3D + +rust_common_flags +=3D $(rust_common_flags_per_version) +KBUILD_HOSTRUSTFLAGS +=3D $(rust_common_flags_per_version) +KBUILD_RUSTFLAGS +=3D $(rust_common_flags_per_version) + include $(srctree)/arch/$(SRCARCH)/Makefile =20 ifdef need-config --=20 2.53.0 From nobody Wed Apr 1 20:42:57 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0822423A62; Wed, 1 Apr 2026 11:52:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044354; cv=none; b=AS3PdwR8qa52ezhTI9OehUPBHm45GH2MjcOIWgF531JOb4RNnXMAArj8vdj/ooucmbOVsixSoluAqt68kiu23d93kSmcwXj4YAUUANUP/TELa+6WJCCm9ZYvw8+6cr81FlgXORJKk3aPw47aAv8KKr7KIJvhgTNgZo4jN4FQmCA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044354; c=relaxed/simple; bh=63eNaBb7HhBHNGZHs2ck4m5j8n+byLJscGHPx3NKsmQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EKHFY72YrY4qP3mToOVqJwJ2/ZF4AIu+QNBhJ6PGfn0IEsfUdYDTNjzXVXFEXo4gn+pAhDxRwaUSylnbhU8i21pW7EkZMF4Kxt0UR4QqLm2lcpwTOpGF4bv1/tWloeUTrK5cb8WErSBwTBkzOKxftjeRm+R6vtE0vdJecKYy13g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P4KiRkYx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P4KiRkYx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D18AC116C6; Wed, 1 Apr 2026 11:52:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044353; bh=63eNaBb7HhBHNGZHs2ck4m5j8n+byLJscGHPx3NKsmQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4KiRkYx+9pR8FcDn58eZ58Tl+l8DaXIaKnBFFMxFh3P+IXQUnqgEGZH8vAunNvs4 BLd1TybjNwHbXADCPR4z7Vj6dtmKy7ji1oU2bzwWLnPbbnFVZYCEMjSB2UQpls/Ouo pYPJfGFA7EPUSZecOxj+EVb7CtgpF1zN5Tw8IewblUNyc/Ie7LYX5Lt+C5FMZplSJ6 xbIWlfeyv6YRSlqqa7C9IoWKbjP/NbQH9T4QOWe/CgvypooqpdHo0TWO2wHyf2zcvI RVJtUt/y5WBbMgeocVhCwVhlVD3aiintQfQGjzicRa8XTpUjFXmucwr/KWim4JVpaV E6XIy24XYnOiA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 33/33] rust: kbuild: allow `clippy::precedence` for Rust < 1.86.0 Date: Wed, 1 Apr 2026 13:45:40 +0200 Message-ID: <20260401114540.30108-34-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Clippy `precedence` lint was extended in Rust 1.85.0 to include bitmasking and shift operations [1]. However, because it generated many hits, in Rust 1.86.0 it was split into a new `precedence_bits` lint which is not enabled by default [2]. In other words, only Rust 1.85 has a different behavior. For instance, it reports: warning: operator precedence can trip the unwary --> drivers/gpu/nova-core/fb/hal/ga100.rs:16:5 | 16 | / u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR::read(bar).adr= _39_08()) << FLUSH_SYSMEM_ADDR_SHIFT 17 | | | u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR_HI::read= (bar).adr_63_40()) 18 | | << FLUSH_SYSMEM_ADDR_SHIFT_HI | |_________________________________________^ | =3D help: for further information visit https://rust-lang.github.io/= rust-clippy/master/index.html#precedence =3D note: `-W clippy::precedence` implied by `-W clippy::all` =3D help: to override `-W clippy::all` add `#[allow(clippy::preceden= ce)]` help: consider parenthesizing your expression | 16 ~ (u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR::read(bar).adr_= 39_08()) << FLUSH_SYSMEM_ADDR_SHIFT) | (u64::from(regs::NV_PFB_NISO_FLUSH_S= YSMEM_ADDR_HI::read(bar).adr_63_40()) 17 + << FLUSH_SYSMEM_ADDR_SHIFT_HI) | warning: operator precedence can trip the unwary --> drivers/gpu/nova-core/vbios.rs:511:17 | 511 | / u32::from(data[29]) << 24 512 | | | u32::from(data[28]) << 16 513 | | | u32::from(data[27]) << 8 | |______________________________________________^ | =3D help: for further information visit https://rust-lang.github.io= /rust-clippy/master/index.html#precedence help: consider parenthesizing your expression | 511 ~ u32::from(data[29]) << 24 512 + | u32::from(data[28]) << 16 | (u32::from(data= [27]) << 8) | warning: operator precedence can trip the unwary --> drivers/gpu/nova-core/vbios.rs:511:17 | 511 | / u32::from(data[29]) << 24 512 | | | u32::from(data[28]) << 16 | |_______________________________________________^ help: consider = parenthesizing your expression: `(u32::from(data[29]) << 24) | (u32::from(d= ata[28]) << 16)` | =3D help: for further information visit https://rust-lang.github.io= /rust-clippy/master/index.html#precedence While so far we try our best to keep all versions Clippy-clean, the minimum (which is now Rust 1.85.0 after the bump) and the latest stable are the most important ones; and this may be considered "false positives" with respect to the behavior in other versions. Thus allow this lint for this version using the per-version flags mechanism introduced in the previous commit. Link: https://github.com/rust-lang/rust-clippy/issues/14097 [1] Link: https://github.com/rust-lang/rust-clippy/pull/14115 [2] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 20c8179d96ee..a0d6ed050c8a 100644 --- a/Makefile +++ b/Makefile @@ -836,7 +836,8 @@ export WARN_ON_UNUSED_TRACEPOINTS =20 # Per-version Rust flags. These are like `rust_common_flags`, but may # depend on the Rust compiler version (e.g. using `rustc-min-version`). -rust_common_flags_per_version :=3D +rust_common_flags_per_version :=3D \ + $(if $(call rustc-min-version,108600),,-Aclippy::precedence) =20 rust_common_flags +=3D $(rust_common_flags_per_version) KBUILD_HOSTRUSTFLAGS +=3D $(rust_common_flags_per_version) --=20 2.53.0