All of lore.kernel.org
 help / color / mirror / Atom feed
From: <gregkh@linuxfoundation.org>
To: aliceryhl@google.com,benno.lossin@proton.me,dakr@kernel.org,gary@garyguo.net,gregkh@linuxfoundation.org,hi@alyssa.is,noisycoil@disroot.org,ojeda@kernel.org,patches@lists.linux.dev,sashal@kernel.org
Cc: <stable-commits@vger.kernel.org>
Subject: Patch "rust: alloc: implement kernel `Box`" has been added to the 6.12-stable tree
Date: Sun, 09 Mar 2025 10:46:49 +0100	[thread overview]
Message-ID: <2025030949-strict-designed-56b6@gregkh> (raw)
In-Reply-To: <20250307225008.779961-31-ojeda@kernel.org>


This is a note to let you know that I've just added the patch titled

    rust: alloc: implement kernel `Box`

to the 6.12-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rust-alloc-implement-kernel-box.patch
and it can be found in the queue-6.12 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


From stable+bounces-121485-greg=kroah.com@vger.kernel.org Fri Mar  7 23:52:12 2025
From: Miguel Ojeda <ojeda@kernel.org>
Date: Fri,  7 Mar 2025 23:49:37 +0100
Subject: rust: alloc: implement kernel `Box`
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>, stable@vger.kernel.org
Cc: Danilo Krummrich <dakr@kernel.org>, Alice Ryhl <aliceryhl@google.com>, Alyssa Ross <hi@alyssa.is>, NoisyCoil <noisycoil@disroot.org>, patches@lists.linux.dev, Miguel Ojeda <ojeda@kernel.org>
Message-ID: <20250307225008.779961-31-ojeda@kernel.org>

From: Danilo Krummrich <dakr@kernel.org>

commit c8cfa8d0c0b10be216861fe904ea68978b1dcc97 upstream.

`Box` provides the simplest way to allocate memory for a generic type
with one of the kernel's allocators, e.g. `Kmalloc`, `Vmalloc` or
`KVmalloc`.

In contrast to Rust's `Box` type, the kernel `Box` type considers the
kernel's GFP flags for all appropriate functions, always reports
allocation failures through `Result<_, AllocError>` and remains
independent from unstable features.

Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241004154149.93856-12-dakr@kernel.org
[ Added backticks, fixed typos. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 rust/kernel/alloc.rs      |    6 
 rust/kernel/alloc/kbox.rs |  456 ++++++++++++++++++++++++++++++++++++++++++++++
 rust/kernel/prelude.rs    |    2 
 3 files changed, 463 insertions(+), 1 deletion(-)
 create mode 100644 rust/kernel/alloc/kbox.rs

--- a/rust/kernel/alloc.rs
+++ b/rust/kernel/alloc.rs
@@ -5,6 +5,7 @@
 #[cfg(not(any(test, testlib)))]
 pub mod allocator;
 pub mod box_ext;
+pub mod kbox;
 pub mod vec_ext;
 
 #[cfg(any(test, testlib))]
@@ -13,6 +14,11 @@ pub mod allocator_test;
 #[cfg(any(test, testlib))]
 pub use self::allocator_test as allocator;
 
+pub use self::kbox::Box;
+pub use self::kbox::KBox;
+pub use self::kbox::KVBox;
+pub use self::kbox::VBox;
+
 /// Indicates an allocation error.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub struct AllocError;
--- /dev/null
+++ b/rust/kernel/alloc/kbox.rs
@@ -0,0 +1,456 @@
+// SPDX-License-Identifier: GPL-2.0
+
+//! Implementation of [`Box`].
+
+#[allow(unused_imports)] // Used in doc comments.
+use super::allocator::{KVmalloc, Kmalloc, Vmalloc};
+use super::{AllocError, Allocator, Flags};
+use core::alloc::Layout;
+use core::fmt;
+use core::marker::PhantomData;
+use core::mem::ManuallyDrop;
+use core::mem::MaybeUninit;
+use core::ops::{Deref, DerefMut};
+use core::pin::Pin;
+use core::ptr::NonNull;
+use core::result::Result;
+
+use crate::init::{InPlaceInit, InPlaceWrite, Init, PinInit};
+use crate::types::ForeignOwnable;
+
+/// The kernel's [`Box`] type -- a heap allocation for a single value of type `T`.
+///
+/// This is the kernel's version of the Rust stdlib's `Box`. There are several differences,
+/// for example no `noalias` attribute is emitted and partially moving out of a `Box` is not
+/// supported. There are also several API differences, e.g. `Box` always requires an [`Allocator`]
+/// implementation to be passed as generic, page [`Flags`] when allocating memory and all functions
+/// that may allocate memory are fallible.
+///
+/// `Box` works with any of the kernel's allocators, e.g. [`Kmalloc`], [`Vmalloc`] or [`KVmalloc`].
+/// There are aliases for `Box` with these allocators ([`KBox`], [`VBox`], [`KVBox`]).
+///
+/// When dropping a [`Box`], the value is also dropped and the heap memory is automatically freed.
+///
+/// # Examples
+///
+/// ```
+/// let b = KBox::<u64>::new(24_u64, GFP_KERNEL)?;
+///
+/// assert_eq!(*b, 24_u64);
+/// # Ok::<(), Error>(())
+/// ```
+///
+/// ```
+/// # use kernel::bindings;
+/// const SIZE: usize = bindings::KMALLOC_MAX_SIZE as usize + 1;
+/// struct Huge([u8; SIZE]);
+///
+/// assert!(KBox::<Huge>::new_uninit(GFP_KERNEL | __GFP_NOWARN).is_err());
+/// ```
+///
+/// ```
+/// # use kernel::bindings;
+/// const SIZE: usize = bindings::KMALLOC_MAX_SIZE as usize + 1;
+/// struct Huge([u8; SIZE]);
+///
+/// assert!(KVBox::<Huge>::new_uninit(GFP_KERNEL).is_ok());
+/// ```
+///
+/// # Invariants
+///
+/// `self.0` is always properly aligned and either points to memory allocated with `A` or, for
+/// zero-sized types, is a dangling, well aligned pointer.
+#[repr(transparent)]
+pub struct Box<T: ?Sized, A: Allocator>(NonNull<T>, PhantomData<A>);
+
+/// Type alias for [`Box`] with a [`Kmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let b = KBox::new(24_u64, GFP_KERNEL)?;
+///
+/// assert_eq!(*b, 24_u64);
+/// # Ok::<(), Error>(())
+/// ```
+pub type KBox<T> = Box<T, super::allocator::Kmalloc>;
+
+/// Type alias for [`Box`] with a [`Vmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let b = VBox::new(24_u64, GFP_KERNEL)?;
+///
+/// assert_eq!(*b, 24_u64);
+/// # Ok::<(), Error>(())
+/// ```
+pub type VBox<T> = Box<T, super::allocator::Vmalloc>;
+
+/// Type alias for [`Box`] with a [`KVmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let b = KVBox::new(24_u64, GFP_KERNEL)?;
+///
+/// assert_eq!(*b, 24_u64);
+/// # Ok::<(), Error>(())
+/// ```
+pub type KVBox<T> = Box<T, super::allocator::KVmalloc>;
+
+// SAFETY: `Box` is `Send` if `T` is `Send` because the `Box` owns a `T`.
+unsafe impl<T, A> Send for Box<T, A>
+where
+    T: Send + ?Sized,
+    A: Allocator,
+{
+}
+
+// SAFETY: `Box` is `Sync` if `T` is `Sync` because the `Box` owns a `T`.
+unsafe impl<T, A> Sync for Box<T, A>
+where
+    T: Sync + ?Sized,
+    A: Allocator,
+{
+}
+
+impl<T, A> Box<T, A>
+where
+    T: ?Sized,
+    A: Allocator,
+{
+    /// Creates a new `Box<T, A>` from a raw pointer.
+    ///
+    /// # Safety
+    ///
+    /// For non-ZSTs, `raw` must point at an allocation allocated with `A` that is sufficiently
+    /// aligned for and holds a valid `T`. The caller passes ownership of the allocation to the
+    /// `Box`.
+    ///
+    /// For ZSTs, `raw` must be a dangling, well aligned pointer.
+    #[inline]
+    pub const unsafe fn from_raw(raw: *mut T) -> Self {
+        // INVARIANT: Validity of `raw` is guaranteed by the safety preconditions of this function.
+        // SAFETY: By the safety preconditions of this function, `raw` is not a NULL pointer.
+        Self(unsafe { NonNull::new_unchecked(raw) }, PhantomData)
+    }
+
+    /// Consumes the `Box<T, A>` and returns a raw pointer.
+    ///
+    /// This will not run the destructor of `T` and for non-ZSTs the allocation will stay alive
+    /// indefinitely. Use [`Box::from_raw`] to recover the [`Box`], drop the value and free the
+    /// allocation, if any.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let x = KBox::new(24, GFP_KERNEL)?;
+    /// let ptr = KBox::into_raw(x);
+    /// // SAFETY: `ptr` comes from a previous call to `KBox::into_raw`.
+    /// let x = unsafe { KBox::from_raw(ptr) };
+    ///
+    /// assert_eq!(*x, 24);
+    /// # Ok::<(), Error>(())
+    /// ```
+    #[inline]
+    pub fn into_raw(b: Self) -> *mut T {
+        ManuallyDrop::new(b).0.as_ptr()
+    }
+
+    /// Consumes and leaks the `Box<T, A>` and returns a mutable reference.
+    ///
+    /// See [`Box::into_raw`] for more details.
+    #[inline]
+    pub fn leak<'a>(b: Self) -> &'a mut T {
+        // SAFETY: `Box::into_raw` always returns a properly aligned and dereferenceable pointer
+        // which points to an initialized instance of `T`.
+        unsafe { &mut *Box::into_raw(b) }
+    }
+}
+
+impl<T, A> Box<MaybeUninit<T>, A>
+where
+    A: Allocator,
+{
+    /// Converts a `Box<MaybeUninit<T>, A>` to a `Box<T, A>`.
+    ///
+    /// It is undefined behavior to call this function while the value inside of `b` is not yet
+    /// fully initialized.
+    ///
+    /// # Safety
+    ///
+    /// Callers must ensure that the value inside of `b` is in an initialized state.
+    pub unsafe fn assume_init(self) -> Box<T, A> {
+        let raw = Self::into_raw(self);
+
+        // SAFETY: `raw` comes from a previous call to `Box::into_raw`. By the safety requirements
+        // of this function, the value inside the `Box` is in an initialized state. Hence, it is
+        // safe to reconstruct the `Box` as `Box<T, A>`.
+        unsafe { Box::from_raw(raw.cast()) }
+    }
+
+    /// Writes the value and converts to `Box<T, A>`.
+    pub fn write(mut self, value: T) -> Box<T, A> {
+        (*self).write(value);
+
+        // SAFETY: We've just initialized `b`'s value.
+        unsafe { self.assume_init() }
+    }
+}
+
+impl<T, A> Box<T, A>
+where
+    A: Allocator,
+{
+    /// Creates a new `Box<T, A>` and initializes its contents with `x`.
+    ///
+    /// New memory is allocated with `A`. The allocation may fail, in which case an error is
+    /// returned. For ZSTs no memory is allocated.
+    pub fn new(x: T, flags: Flags) -> Result<Self, AllocError> {
+        let b = Self::new_uninit(flags)?;
+        Ok(Box::write(b, x))
+    }
+
+    /// Creates a new `Box<T, A>` with uninitialized contents.
+    ///
+    /// New memory is allocated with `A`. The allocation may fail, in which case an error is
+    /// returned. For ZSTs no memory is allocated.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let b = KBox::<u64>::new_uninit(GFP_KERNEL)?;
+    /// let b = KBox::write(b, 24);
+    ///
+    /// assert_eq!(*b, 24_u64);
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn new_uninit(flags: Flags) -> Result<Box<MaybeUninit<T>, A>, AllocError> {
+        let layout = Layout::new::<MaybeUninit<T>>();
+        let ptr = A::alloc(layout, flags)?;
+
+        // INVARIANT: `ptr` is either a dangling pointer or points to memory allocated with `A`,
+        // which is sufficient in size and alignment for storing a `T`.
+        Ok(Box(ptr.cast(), PhantomData))
+    }
+
+    /// Constructs a new `Pin<Box<T, A>>`. If `T` does not implement [`Unpin`], then `x` will be
+    /// pinned in memory and can't be moved.
+    #[inline]
+    pub fn pin(x: T, flags: Flags) -> Result<Pin<Box<T, A>>, AllocError>
+    where
+        A: 'static,
+    {
+        Ok(Self::new(x, flags)?.into())
+    }
+
+    /// Forgets the contents (does not run the destructor), but keeps the allocation.
+    fn forget_contents(this: Self) -> Box<MaybeUninit<T>, A> {
+        let ptr = Self::into_raw(this);
+
+        // SAFETY: `ptr` is valid, because it came from `Box::into_raw`.
+        unsafe { Box::from_raw(ptr.cast()) }
+    }
+
+    /// Drops the contents, but keeps the allocation.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let value = KBox::new([0; 32], GFP_KERNEL)?;
+    /// assert_eq!(*value, [0; 32]);
+    /// let value = KBox::drop_contents(value);
+    /// // Now we can re-use `value`:
+    /// let value = KBox::write(value, [1; 32]);
+    /// assert_eq!(*value, [1; 32]);
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn drop_contents(this: Self) -> Box<MaybeUninit<T>, A> {
+        let ptr = this.0.as_ptr();
+
+        // SAFETY: `ptr` is valid, because it came from `this`. After this call we never access the
+        // value stored in `this` again.
+        unsafe { core::ptr::drop_in_place(ptr) };
+
+        Self::forget_contents(this)
+    }
+
+    /// Moves the `Box`'s value out of the `Box` and consumes the `Box`.
+    pub fn into_inner(b: Self) -> T {
+        // SAFETY: By the type invariant `&*b` is valid for `read`.
+        let value = unsafe { core::ptr::read(&*b) };
+        let _ = Self::forget_contents(b);
+        value
+    }
+}
+
+impl<T, A> From<Box<T, A>> for Pin<Box<T, A>>
+where
+    T: ?Sized,
+    A: Allocator,
+{
+    /// Converts a `Box<T, A>` into a `Pin<Box<T, A>>`. If `T` does not implement [`Unpin`], then
+    /// `*b` will be pinned in memory and can't be moved.
+    ///
+    /// This moves `b` into `Pin` without moving `*b` or allocating and copying any memory.
+    fn from(b: Box<T, A>) -> Self {
+        // SAFETY: The value wrapped inside a `Pin<Box<T, A>>` cannot be moved or replaced as long
+        // as `T` does not implement `Unpin`.
+        unsafe { Pin::new_unchecked(b) }
+    }
+}
+
+impl<T, A> InPlaceWrite<T> for Box<MaybeUninit<T>, A>
+where
+    A: Allocator + 'static,
+{
+    type Initialized = Box<T, A>;
+
+    fn write_init<E>(mut self, init: impl Init<T, E>) -> Result<Self::Initialized, E> {
+        let slot = self.as_mut_ptr();
+        // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
+        // slot is valid.
+        unsafe { init.__init(slot)? };
+        // SAFETY: All fields have been initialized.
+        Ok(unsafe { Box::assume_init(self) })
+    }
+
+    fn write_pin_init<E>(mut self, init: impl PinInit<T, E>) -> Result<Pin<Self::Initialized>, E> {
+        let slot = self.as_mut_ptr();
+        // SAFETY: When init errors/panics, slot will get deallocated but not dropped,
+        // slot is valid and will not be moved, because we pin it later.
+        unsafe { init.__pinned_init(slot)? };
+        // SAFETY: All fields have been initialized.
+        Ok(unsafe { Box::assume_init(self) }.into())
+    }
+}
+
+impl<T, A> InPlaceInit<T> for Box<T, A>
+where
+    A: Allocator + 'static,
+{
+    type PinnedSelf = Pin<Self>;
+
+    #[inline]
+    fn try_pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Pin<Self>, E>
+    where
+        E: From<AllocError>,
+    {
+        Box::<_, A>::new_uninit(flags)?.write_pin_init(init)
+    }
+
+    #[inline]
+    fn try_init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E>
+    where
+        E: From<AllocError>,
+    {
+        Box::<_, A>::new_uninit(flags)?.write_init(init)
+    }
+}
+
+impl<T: 'static, A> ForeignOwnable for Box<T, A>
+where
+    A: Allocator,
+{
+    type Borrowed<'a> = &'a T;
+
+    fn into_foreign(self) -> *const core::ffi::c_void {
+        Box::into_raw(self) as _
+    }
+
+    unsafe fn from_foreign(ptr: *const core::ffi::c_void) -> Self {
+        // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous
+        // call to `Self::into_foreign`.
+        unsafe { Box::from_raw(ptr as _) }
+    }
+
+    unsafe fn borrow<'a>(ptr: *const core::ffi::c_void) -> &'a T {
+        // SAFETY: The safety requirements of this method ensure that the object remains alive and
+        // immutable for the duration of 'a.
+        unsafe { &*ptr.cast() }
+    }
+}
+
+impl<T: 'static, A> ForeignOwnable for Pin<Box<T, A>>
+where
+    A: Allocator,
+{
+    type Borrowed<'a> = Pin<&'a T>;
+
+    fn into_foreign(self) -> *const core::ffi::c_void {
+        // SAFETY: We are still treating the box as pinned.
+        Box::into_raw(unsafe { Pin::into_inner_unchecked(self) }) as _
+    }
+
+    unsafe fn from_foreign(ptr: *const core::ffi::c_void) -> Self {
+        // SAFETY: The safety requirements of this function ensure that `ptr` comes from a previous
+        // call to `Self::into_foreign`.
+        unsafe { Pin::new_unchecked(Box::from_raw(ptr as _)) }
+    }
+
+    unsafe fn borrow<'a>(ptr: *const core::ffi::c_void) -> Pin<&'a T> {
+        // SAFETY: The safety requirements for this function ensure that the object is still alive,
+        // so it is safe to dereference the raw pointer.
+        // The safety requirements of `from_foreign` also ensure that the object remains alive for
+        // the lifetime of the returned value.
+        let r = unsafe { &*ptr.cast() };
+
+        // SAFETY: This pointer originates from a `Pin<Box<T>>`.
+        unsafe { Pin::new_unchecked(r) }
+    }
+}
+
+impl<T, A> Deref for Box<T, A>
+where
+    T: ?Sized,
+    A: Allocator,
+{
+    type Target = T;
+
+    fn deref(&self) -> &T {
+        // SAFETY: `self.0` is always properly aligned, dereferenceable and points to an initialized
+        // instance of `T`.
+        unsafe { self.0.as_ref() }
+    }
+}
+
+impl<T, A> DerefMut for Box<T, A>
+where
+    T: ?Sized,
+    A: Allocator,
+{
+    fn deref_mut(&mut self) -> &mut T {
+        // SAFETY: `self.0` is always properly aligned, dereferenceable and points to an initialized
+        // instance of `T`.
+        unsafe { self.0.as_mut() }
+    }
+}
+
+impl<T, A> fmt::Debug for Box<T, A>
+where
+    T: ?Sized + fmt::Debug,
+    A: Allocator,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, f)
+    }
+}
+
+impl<T, A> Drop for Box<T, A>
+where
+    T: ?Sized,
+    A: Allocator,
+{
+    fn drop(&mut self) {
+        let layout = Layout::for_value::<T>(self);
+
+        // SAFETY: The pointer in `self.0` is guaranteed to be valid by the type invariant.
+        unsafe { core::ptr::drop_in_place::<T>(self.deref_mut()) };
+
+        // SAFETY:
+        // - `self.0` was previously allocated with `A`.
+        // - `layout` is equal to the `Layout´ `self.0` was allocated with.
+        unsafe { A::free(self.0.cast(), layout) };
+    }
+}
--- a/rust/kernel/prelude.rs
+++ b/rust/kernel/prelude.rs
@@ -14,7 +14,7 @@
 #[doc(no_inline)]
 pub use core::pin::Pin;
 
-pub use crate::alloc::{box_ext::BoxExt, flags::*, vec_ext::VecExt};
+pub use crate::alloc::{box_ext::BoxExt, flags::*, vec_ext::VecExt, KBox, KVBox, VBox};
 
 #[doc(no_inline)]
 pub use alloc::{boxed::Box, vec::Vec};


Patches currently in stable-queue which might be from ojeda@kernel.org are

queue-6.12/drm-panic-avoid-reimplementing-iterator-find.patch
queue-6.12/documentation-rust-add-coding-guidelines-on-lints.patch
queue-6.12/rust-provide-proper-code-documentation-titles.patch
queue-6.12/rust-alloc-make-allocator-module-public.patch
queue-6.12/rust-alloc-remove-vecext-extension.patch
queue-6.12/rust-alloc-implement-reallocfunc.patch
queue-6.12/rust-alloc-separate-aligned_size-from-krealloc_aligned.patch
queue-6.12/rust-enable-clippy-unnecessary_safety_comment-lint.patch
queue-6.12/rust-alloc-update-module-comment-of-alloc.rs.patch
queue-6.12/rust-kbuild-expand-rusttest-target-for-macros.patch
queue-6.12/rust-error-use-core-alloc-layouterror.patch
queue-6.12/rust-str-test-replace-alloc-format.patch
queue-6.12/loongarch-use-asm_reachable.patch
queue-6.12/rust-alloc-implement-allocator-for-kmalloc.patch
queue-6.12/rust-alloc-implement-collect-for-intoiter.patch
queue-6.12/rust-alloc-introduce-arraylayout.patch
queue-6.12/rust-alloc-implement-vmalloc-allocator.patch
queue-6.12/documentation-rust-discuss-in-the-guidelines.patch
queue-6.12/rust-error-check-for-config-test-in-error-name.patch
queue-6.12/rust-enable-clippy-ignored_unit_patterns-lint.patch
queue-6.12/rust-enable-clippy-unnecessary_safety_doc-lint.patch
queue-6.12/rust-alloc-add-box-to-prelude.patch
queue-6.12/kbuild-rust-remove-the-alloc-crate-and-globalalloc.patch
queue-6.12/rust-alloc-add-allocator-trait.patch
queue-6.12/rust-treewide-switch-to-our-kernel-box-type.patch
queue-6.12/rust-introduce-.clippy.toml.patch
queue-6.12/rust-alloc-rename-kernelallocator-to-kmalloc.patch
queue-6.12/rust-alloc-implement-cmalloc-in-module-allocator_test.patch
queue-6.12/drm-panic-allow-verbose-version-check.patch
queue-6.12/rust-map-__kernel_size_t-and-friends-also-to-usize-isize.patch
queue-6.12/rust-alloc-add-module-allocator_test.patch
queue-6.12/rust-replace-clippy-dbg_macro-with-disallowed_macros.patch
queue-6.12/rust-alloc-add-__gfp_nowarn-to-flags.patch
queue-6.12/rust-enable-clippy-s-check-private-items.patch
queue-6.12/rust-error-make-conversion-functions-public.patch
queue-6.12/rust-sort-global-rust-flags.patch
queue-6.12/rust-alloc-implement-contains-for-flags.patch
queue-6.12/rust-init-remove-unneeded.patch
queue-6.12/rust-use-custom-ffi-integer-types.patch
queue-6.12/rust-sync-remove-unneeded.patch
queue-6.12/rust-treewide-switch-to-the-kernel-vec-type.patch
queue-6.12/rust-alloc-implement-kvmalloc-allocator.patch
queue-6.12/drm-panic-correctly-indent-continuation-of-line-in-list-item.patch
queue-6.12/rust-alloc-implement-kernel-vec-type.patch
queue-6.12/rust-workqueue-remove-unneeded.patch
queue-6.12/rust-error-optimize-error-type-to-use-nonzero.patch
queue-6.12/drm-panic-remove-unnecessary-borrow-in-alignment_pattern.patch
queue-6.12/rust-alloc-remove-extension-of-std-s-box.patch
queue-6.12/rust-block-fix-formatting-in-gendisk-doc.patch
queue-6.12/rust-enable-rustdoc-unescaped_backticks-lint.patch
queue-6.12/rust-fix-size_t-in-bindgen-prototypes-of-c-builtins.patch
queue-6.12/rust-enable-clippy-undocumented_unsafe_blocks-lint.patch
queue-6.12/rust-alloc-add-vec-to-prelude.patch
queue-6.12/rust-alloc-implement-intoiterator-for-vec.patch
queue-6.12/rust-alloc-implement-kernel-box.patch
queue-6.12/drm-panic-remove-redundant-field-when-assigning-value.patch
queue-6.12/rust-types-avoid-repetition-in-as-from-bytes-impls.patch
queue-6.12/rust-start-using-the-attribute.patch
queue-6.12/drm-panic-allow-verbose-boolean-for-clarity.patch
queue-6.12/maintainers-add-entry-for-the-rust-alloc-module.patch
queue-6.12/rust-alloc-fix-arraylayout-allocations.patch
queue-6.12/drm-panic-prefer-eliding-lifetimes.patch

  reply	other threads:[~2025-03-09  9:49 UTC|newest]

Thread overview: 134+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-07 22:49 [PATCH 6.12.y 00/60] `alloc`, `#[expect]` and "Custom FFI" Miguel Ojeda
2025-03-07 22:49 ` [PATCH 6.12.y 01/60] rust: workqueue: remove unneeded ``#[allow(clippy::new_ret_no_self)]` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: workqueue: remove unneeded ``#[allow(clippy::new_ret_no_self)]`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 02/60] rust: sort global Rust flags Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: sort global Rust flags" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 03/60] rust: types: avoid repetition in `{As,From}Bytes` impls Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: types: avoid repetition in `{As,From}Bytes` impls" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 04/60] rust: enable `clippy::undocumented_unsafe_blocks` lint Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable `clippy::undocumented_unsafe_blocks` lint" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 05/60] rust: enable `clippy::unnecessary_safety_comment` lint Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable `clippy::unnecessary_safety_comment` lint" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 06/60] rust: enable `clippy::unnecessary_safety_doc` lint Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable `clippy::unnecessary_safety_doc` lint" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 07/60] rust: enable `clippy::ignored_unit_patterns` lint Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable `clippy::ignored_unit_patterns` lint" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 08/60] rust: enable `rustdoc::unescaped_backticks` lint Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable `rustdoc::unescaped_backticks` lint" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 09/60] rust: init: remove unneeded `#[allow(clippy::disallowed_names)]` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: init: remove unneeded `#[allow(clippy::disallowed_names)]`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 10/60] rust: sync: remove unneeded `#[allow(clippy::non_send_fields_in_send_ty)]` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: sync: remove unneeded `#[allow(clippy::non_send_fields_in_send_ty)]`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 11/60] rust: introduce `.clippy.toml` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: introduce `.clippy.toml`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 12/60] rust: replace `clippy::dbg_macro` with `disallowed_macros` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: replace `clippy::dbg_macro` with `disallowed_macros`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 13/60] rust: provide proper code documentation titles Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: provide proper code documentation titles" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 14/60] rust: enable Clippy's `check-private-items` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: enable Clippy's `check-private-items`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 15/60] Documentation: rust: add coding guidelines on lints Miguel Ojeda
2025-03-09  9:46   ` Patch "Documentation: rust: add coding guidelines on lints" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 16/60] rust: start using the `#[expect(...)]` attribute Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: start using the `#[expect(...)]` attribute" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 17/60] Documentation: rust: discuss `#[expect(...)]` in the guidelines Miguel Ojeda
2025-03-09  9:46   ` Patch "Documentation: rust: discuss `#[expect(...)]` in the guidelines" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 18/60] rust: error: make conversion functions public Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: error: make conversion functions public" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 19/60] rust: error: optimize error type to use nonzero Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: error: optimize error type to use nonzero" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 20/60] rust: alloc: add `Allocator` trait Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: add `Allocator` trait" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 21/60] rust: alloc: separate `aligned_size` from `krealloc_aligned` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: separate `aligned_size` from `krealloc_aligned`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 22/60] rust: alloc: rename `KernelAllocator` to `Kmalloc` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: rename `KernelAllocator` to `Kmalloc`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 23/60] rust: alloc: implement `ReallocFunc` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `ReallocFunc`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 24/60] rust: alloc: make `allocator` module public Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: make `allocator` module public" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 25/60] rust: alloc: implement `Allocator` for `Kmalloc` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `Allocator` for `Kmalloc`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 26/60] rust: alloc: add module `allocator_test` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: add module `allocator_test`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 27/60] rust: alloc: implement `Vmalloc` allocator Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `Vmalloc` allocator" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 28/60] rust: alloc: implement `KVmalloc` allocator Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `KVmalloc` allocator" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 29/60] rust: alloc: add __GFP_NOWARN to `Flags` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: add __GFP_NOWARN to `Flags`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 30/60] rust: alloc: implement kernel `Box` Miguel Ojeda
2025-03-09  9:46   ` gregkh [this message]
2025-03-07 22:49 ` [PATCH 6.12.y 31/60] rust: treewide: switch to our kernel `Box` type Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: treewide: switch to our kernel `Box` type" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 32/60] rust: alloc: remove extension of std's `Box` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: remove extension of std's `Box`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 33/60] rust: alloc: add `Box` to prelude Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: add `Box` to prelude" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 34/60] rust: alloc: introduce `ArrayLayout` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: introduce `ArrayLayout`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 35/60] rust: alloc: implement kernel `Vec` type Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement kernel `Vec` type" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 36/60] rust: alloc: implement `IntoIterator` for `Vec` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `IntoIterator` for `Vec`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 37/60] rust: alloc: implement `collect` for `IntoIter` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `collect` for `IntoIter`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 38/60] rust: treewide: switch to the kernel `Vec` type Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: treewide: switch to the kernel `Vec` type" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 39/60] rust: alloc: remove `VecExt` extension Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: remove `VecExt` extension" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 40/60] rust: alloc: add `Vec` to prelude Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: add `Vec` to prelude" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 41/60] rust: error: use `core::alloc::LayoutError` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: error: use `core::alloc::LayoutError`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 42/60] rust: error: check for config `test` in `Error::name` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: error: check for config `test` in `Error::name`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 43/60] rust: alloc: implement `contains` for `Flags` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `contains` for `Flags`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 44/60] rust: alloc: implement `Cmalloc` in module allocator_test Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: implement `Cmalloc` in module allocator_test" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 45/60] rust: str: test: replace `alloc::format` Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: str: test: replace `alloc::format`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 46/60] rust: alloc: update module comment of alloc.rs Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: update module comment of alloc.rs" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 47/60] kbuild: rust: remove the `alloc` crate and `GlobalAlloc` Miguel Ojeda
2025-03-09  9:46   ` Patch "kbuild: rust: remove the `alloc` crate and `GlobalAlloc`" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 48/60] MAINTAINERS: add entry for the Rust `alloc` module Miguel Ojeda
2025-03-09  9:46   ` Patch "MAINTAINERS: add entry for the Rust `alloc` module" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 49/60] drm/panic: avoid reimplementing Iterator::find Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: avoid reimplementing Iterator::find" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 50/60] drm/panic: remove unnecessary borrow in alignment_pattern Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: remove unnecessary borrow in alignment_pattern" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 51/60] drm/panic: prefer eliding lifetimes Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: prefer eliding lifetimes" has been added to the 6.12-stable tree gregkh
2025-03-07 22:49 ` [PATCH 6.12.y 52/60] drm/panic: remove redundant field when assigning value Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: remove redundant field when assigning value" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 53/60] drm/panic: correctly indent continuation of line in list item Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: correctly indent continuation of line in list item" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 54/60] drm/panic: allow verbose boolean for clarity Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: allow verbose boolean for clarity" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 55/60] drm/panic: allow verbose version check Miguel Ojeda
2025-03-09  9:46   ` Patch "drm/panic: allow verbose version check" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 56/60] rust: kbuild: expand rusttest target for macros Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: kbuild: expand rusttest target for macros" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 57/60] rust: fix size_t in bindgen prototypes of C builtins Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: fix size_t in bindgen prototypes of C builtins" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 58/60] rust: map `__kernel_size_t` and friends also to usize/isize Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: map `__kernel_size_t` and friends also to usize/isize" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 59/60] rust: use custom FFI integer types Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: use custom FFI integer types" has been added to the 6.12-stable tree gregkh
2025-03-07 22:50 ` [PATCH 6.12.y 60/60] rust: alloc: Fix `ArrayLayout` allocations Miguel Ojeda
2025-03-09  9:46   ` Patch "rust: alloc: Fix `ArrayLayout` allocations" has been added to the 6.12-stable tree gregkh
2025-03-09  9:47 ` [PATCH 6.12.y 00/60] `alloc`, `#[expect]` and "Custom FFI" Greg Kroah-Hartman
2025-03-09 12:41 ` Ilya K
2025-03-09 14:20   ` Miguel Ojeda
2025-03-09 16:27     ` Greg Kroah-Hartman
2025-03-09 20:42       ` [PATCH 6.12.y 0/2] The two missing ones Miguel Ojeda
2025-03-09 20:42         ` [PATCH 6.12.y 1/2] rust: finish using custom FFI integer types Miguel Ojeda
2025-03-09 21:02           ` Patch "rust: finish using custom FFI integer types" has been added to the 6.12-stable tree gregkh
2025-03-13  9:01           ` [PATCH 6.12.y 1/2] rust: finish using custom FFI integer types Sasha Levin
2025-03-09 20:42         ` [PATCH 6.12.y 2/2] rust: map `long` to `isize` and `char` to `u8` Miguel Ojeda
2025-03-09 21:02           ` Patch "rust: map `long` to `isize` and `char` to `u8`" has been added to the 6.12-stable tree gregkh
2025-03-13  9:01           ` [PATCH 6.12.y 2/2] rust: map `long` to `isize` and `char` to `u8` Sasha Levin
2025-03-13 10:59             ` Miguel Ojeda
2025-03-09 21:02         ` [PATCH 6.12.y 0/2] The two missing ones Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2025030949-strict-designed-56b6@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=hi@alyssa.is \
    --cc=noisycoil@disroot.org \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=sashal@kernel.org \
    --cc=stable-commits@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.