public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev, Benno Lossin <benno.lossin@proton.me>,
	Gary Guo <gary@garyguo.net>, Danilo Krummrich <dakr@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>
Subject: [PATCH 6.12 046/269] rust: alloc: implement kernel `Vec` type
Date: Mon, 10 Mar 2025 18:03:19 +0100	[thread overview]
Message-ID: <20250310170459.558469721@linuxfoundation.org> (raw)
In-Reply-To: <20250310170457.700086763@linuxfoundation.org>

6.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Danilo Krummrich <dakr@kernel.org>

commit 2aac4cd7dae3d7bb0e0ddec2561b2ee4cbe6c8f6 upstream.

`Vec` provides a contiguous growable array type with contents allocated
with the kernel's allocators (e.g. `Kmalloc`, `Vmalloc` or `KVmalloc`).

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

[ This patch starts using a new unstable feature, `inline_const`, but
  it was stabilized in Rust 1.79.0, i.e. the next version after the
  minimum one, thus it will not be an issue. - Miguel ]

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-17-dakr@kernel.org
[ Cleaned `rustdoc` unescaped backtick warning, added a couple more
  backticks elsewhere, fixed typos, sorted `feature`s, rewrapped
  documentation lines. - 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/kvec.rs |  648 ++++++++++++++++++++++++++++++++++++++++++++++
 rust/kernel/lib.rs        |    1 
 rust/kernel/prelude.rs    |    2 
 4 files changed, 656 insertions(+), 1 deletion(-)
 create mode 100644 rust/kernel/alloc/kvec.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 kbox;
+pub mod kvec;
 pub mod layout;
 pub mod vec_ext;
 
@@ -19,6 +20,11 @@ pub use self::kbox::KBox;
 pub use self::kbox::KVBox;
 pub use self::kbox::VBox;
 
+pub use self::kvec::KVVec;
+pub use self::kvec::KVec;
+pub use self::kvec::VVec;
+pub use self::kvec::Vec;
+
 /// Indicates an allocation error.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub struct AllocError;
--- /dev/null
+++ b/rust/kernel/alloc/kvec.rs
@@ -0,0 +1,648 @@
+// SPDX-License-Identifier: GPL-2.0
+
+//! Implementation of [`Vec`].
+
+use super::{
+    allocator::{KVmalloc, Kmalloc, Vmalloc},
+    layout::ArrayLayout,
+    AllocError, Allocator, Box, Flags,
+};
+use core::{
+    fmt,
+    marker::PhantomData,
+    mem::{ManuallyDrop, MaybeUninit},
+    ops::Deref,
+    ops::DerefMut,
+    ops::Index,
+    ops::IndexMut,
+    ptr,
+    ptr::NonNull,
+    slice,
+    slice::SliceIndex,
+};
+
+/// Create a [`KVec`] containing the arguments.
+///
+/// New memory is allocated with `GFP_KERNEL`.
+///
+/// # Examples
+///
+/// ```
+/// let mut v = kernel::kvec![];
+/// v.push(1, GFP_KERNEL)?;
+/// assert_eq!(v, [1]);
+///
+/// let mut v = kernel::kvec![1; 3]?;
+/// v.push(4, GFP_KERNEL)?;
+/// assert_eq!(v, [1, 1, 1, 4]);
+///
+/// let mut v = kernel::kvec![1, 2, 3]?;
+/// v.push(4, GFP_KERNEL)?;
+/// assert_eq!(v, [1, 2, 3, 4]);
+///
+/// # Ok::<(), Error>(())
+/// ```
+#[macro_export]
+macro_rules! kvec {
+    () => (
+        $crate::alloc::KVec::new()
+    );
+    ($elem:expr; $n:expr) => (
+        $crate::alloc::KVec::from_elem($elem, $n, GFP_KERNEL)
+    );
+    ($($x:expr),+ $(,)?) => (
+        match $crate::alloc::KBox::new_uninit(GFP_KERNEL) {
+            Ok(b) => Ok($crate::alloc::KVec::from($crate::alloc::KBox::write(b, [$($x),+]))),
+            Err(e) => Err(e),
+        }
+    );
+}
+
+/// The kernel's [`Vec`] type.
+///
+/// A contiguous growable array type with contents allocated with the kernel's allocators (e.g.
+/// [`Kmalloc`], [`Vmalloc`] or [`KVmalloc`]), written `Vec<T, A>`.
+///
+/// For non-zero-sized values, a [`Vec`] will use the given allocator `A` for its allocation. For
+/// the most common allocators the type aliases [`KVec`], [`VVec`] and [`KVVec`] exist.
+///
+/// For zero-sized types the [`Vec`]'s pointer must be `dangling_mut::<T>`; no memory is allocated.
+///
+/// Generally, [`Vec`] consists of a pointer that represents the vector's backing buffer, the
+/// capacity of the vector (the number of elements that currently fit into the vector), its length
+/// (the number of elements that are currently stored in the vector) and the `Allocator` type used
+/// to allocate (and free) the backing buffer.
+///
+/// A [`Vec`] can be deconstructed into and (re-)constructed from its previously named raw parts
+/// and manually modified.
+///
+/// [`Vec`]'s backing buffer gets, if required, automatically increased (re-allocated) when elements
+/// are added to the vector.
+///
+/// # Invariants
+///
+/// - `self.ptr` is always properly aligned and either points to memory allocated with `A` or, for
+///   zero-sized types, is a dangling, well aligned pointer.
+///
+/// - `self.len` always represents the exact number of elements stored in the vector.
+///
+/// - `self.layout` represents the absolute number of elements that can be stored within the vector
+///   without re-allocation. For ZSTs `self.layout`'s capacity is zero. However, it is legal for the
+///   backing buffer to be larger than `layout`.
+///
+/// - The `Allocator` type `A` of the vector is the exact same `Allocator` type the backing buffer
+///   was allocated with (and must be freed with).
+pub struct Vec<T, A: Allocator> {
+    ptr: NonNull<T>,
+    /// Represents the actual buffer size as `cap` times `size_of::<T>` bytes.
+    ///
+    /// Note: This isn't quite the same as `Self::capacity`, which in contrast returns the number of
+    /// elements we can still store without reallocating.
+    layout: ArrayLayout<T>,
+    len: usize,
+    _p: PhantomData<A>,
+}
+
+/// Type alias for [`Vec`] with a [`Kmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let mut v = KVec::new();
+/// v.push(1, GFP_KERNEL)?;
+/// assert_eq!(&v, &[1]);
+///
+/// # Ok::<(), Error>(())
+/// ```
+pub type KVec<T> = Vec<T, Kmalloc>;
+
+/// Type alias for [`Vec`] with a [`Vmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let mut v = VVec::new();
+/// v.push(1, GFP_KERNEL)?;
+/// assert_eq!(&v, &[1]);
+///
+/// # Ok::<(), Error>(())
+/// ```
+pub type VVec<T> = Vec<T, Vmalloc>;
+
+/// Type alias for [`Vec`] with a [`KVmalloc`] allocator.
+///
+/// # Examples
+///
+/// ```
+/// let mut v = KVVec::new();
+/// v.push(1, GFP_KERNEL)?;
+/// assert_eq!(&v, &[1]);
+///
+/// # Ok::<(), Error>(())
+/// ```
+pub type KVVec<T> = Vec<T, KVmalloc>;
+
+// SAFETY: `Vec` is `Send` if `T` is `Send` because `Vec` owns its elements.
+unsafe impl<T, A> Send for Vec<T, A>
+where
+    T: Send,
+    A: Allocator,
+{
+}
+
+// SAFETY: `Vec` is `Sync` if `T` is `Sync` because `Vec` owns its elements.
+unsafe impl<T, A> Sync for Vec<T, A>
+where
+    T: Sync,
+    A: Allocator,
+{
+}
+
+impl<T, A> Vec<T, A>
+where
+    A: Allocator,
+{
+    #[inline]
+    const fn is_zst() -> bool {
+        core::mem::size_of::<T>() == 0
+    }
+
+    /// Returns the number of elements that can be stored within the vector without allocating
+    /// additional memory.
+    pub fn capacity(&self) -> usize {
+        if const { Self::is_zst() } {
+            usize::MAX
+        } else {
+            self.layout.len()
+        }
+    }
+
+    /// Returns the number of elements stored within the vector.
+    #[inline]
+    pub fn len(&self) -> usize {
+        self.len
+    }
+
+    /// Forcefully sets `self.len` to `new_len`.
+    ///
+    /// # Safety
+    ///
+    /// - `new_len` must be less than or equal to [`Self::capacity`].
+    /// - If `new_len` is greater than `self.len`, all elements within the interval
+    ///   [`self.len`,`new_len`) must be initialized.
+    #[inline]
+    pub unsafe fn set_len(&mut self, new_len: usize) {
+        debug_assert!(new_len <= self.capacity());
+        self.len = new_len;
+    }
+
+    /// Returns a slice of the entire vector.
+    #[inline]
+    pub fn as_slice(&self) -> &[T] {
+        self
+    }
+
+    /// Returns a mutable slice of the entire vector.
+    #[inline]
+    pub fn as_mut_slice(&mut self) -> &mut [T] {
+        self
+    }
+
+    /// Returns a mutable raw pointer to the vector's backing buffer, or, if `T` is a ZST, a
+    /// dangling raw pointer.
+    #[inline]
+    pub fn as_mut_ptr(&mut self) -> *mut T {
+        self.ptr.as_ptr()
+    }
+
+    /// Returns a raw pointer to the vector's backing buffer, or, if `T` is a ZST, a dangling raw
+    /// pointer.
+    #[inline]
+    pub fn as_ptr(&self) -> *const T {
+        self.ptr.as_ptr()
+    }
+
+    /// Returns `true` if the vector contains no elements, `false` otherwise.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let mut v = KVec::new();
+    /// assert!(v.is_empty());
+    ///
+    /// v.push(1, GFP_KERNEL);
+    /// assert!(!v.is_empty());
+    /// ```
+    #[inline]
+    pub fn is_empty(&self) -> bool {
+        self.len() == 0
+    }
+
+    /// Creates a new, empty `Vec<T, A>`.
+    ///
+    /// This method does not allocate by itself.
+    #[inline]
+    pub const fn new() -> Self {
+        // INVARIANT: Since this is a new, empty `Vec` with no backing memory yet,
+        // - `ptr` is a properly aligned dangling pointer for type `T`,
+        // - `layout` is an empty `ArrayLayout` (zero capacity)
+        // - `len` is zero, since no elements can be or have been stored,
+        // - `A` is always valid.
+        Self {
+            ptr: NonNull::dangling(),
+            layout: ArrayLayout::empty(),
+            len: 0,
+            _p: PhantomData::<A>,
+        }
+    }
+
+    /// Returns a slice of `MaybeUninit<T>` for the remaining spare capacity of the vector.
+    pub fn spare_capacity_mut(&mut self) -> &mut [MaybeUninit<T>] {
+        // SAFETY:
+        // - `self.len` is smaller than `self.capacity` and hence, the resulting pointer is
+        //   guaranteed to be part of the same allocated object.
+        // - `self.len` can not overflow `isize`.
+        let ptr = unsafe { self.as_mut_ptr().add(self.len) } as *mut MaybeUninit<T>;
+
+        // SAFETY: The memory between `self.len` and `self.capacity` is guaranteed to be allocated
+        // and valid, but uninitialized.
+        unsafe { slice::from_raw_parts_mut(ptr, self.capacity() - self.len) }
+    }
+
+    /// Appends an element to the back of the [`Vec`] instance.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let mut v = KVec::new();
+    /// v.push(1, GFP_KERNEL)?;
+    /// assert_eq!(&v, &[1]);
+    ///
+    /// v.push(2, GFP_KERNEL)?;
+    /// assert_eq!(&v, &[1, 2]);
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn push(&mut self, v: T, flags: Flags) -> Result<(), AllocError> {
+        self.reserve(1, flags)?;
+
+        // SAFETY:
+        // - `self.len` is smaller than `self.capacity` and hence, the resulting pointer is
+        //   guaranteed to be part of the same allocated object.
+        // - `self.len` can not overflow `isize`.
+        let ptr = unsafe { self.as_mut_ptr().add(self.len) };
+
+        // SAFETY:
+        // - `ptr` is properly aligned and valid for writes.
+        unsafe { core::ptr::write(ptr, v) };
+
+        // SAFETY: We just initialised the first spare entry, so it is safe to increase the length
+        // by 1. We also know that the new length is <= capacity because of the previous call to
+        // `reserve` above.
+        unsafe { self.set_len(self.len() + 1) };
+        Ok(())
+    }
+
+    /// Creates a new [`Vec`] instance with at least the given capacity.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let v = KVec::<u32>::with_capacity(20, GFP_KERNEL)?;
+    ///
+    /// assert!(v.capacity() >= 20);
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn with_capacity(capacity: usize, flags: Flags) -> Result<Self, AllocError> {
+        let mut v = Vec::new();
+
+        v.reserve(capacity, flags)?;
+
+        Ok(v)
+    }
+
+    /// Creates a `Vec<T, A>` from a pointer, a length and a capacity using the allocator `A`.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let mut v = kernel::kvec![1, 2, 3]?;
+    /// v.reserve(1, GFP_KERNEL)?;
+    ///
+    /// let (mut ptr, mut len, cap) = v.into_raw_parts();
+    ///
+    /// // SAFETY: We've just reserved memory for another element.
+    /// unsafe { ptr.add(len).write(4) };
+    /// len += 1;
+    ///
+    /// // SAFETY: We only wrote an additional element at the end of the `KVec`'s buffer and
+    /// // correspondingly increased the length of the `KVec` by one. Otherwise, we construct it
+    /// // from the exact same raw parts.
+    /// let v = unsafe { KVec::from_raw_parts(ptr, len, cap) };
+    ///
+    /// assert_eq!(v, [1, 2, 3, 4]);
+    ///
+    /// # Ok::<(), Error>(())
+    /// ```
+    ///
+    /// # Safety
+    ///
+    /// If `T` is a ZST:
+    ///
+    /// - `ptr` must be a dangling, well aligned pointer.
+    ///
+    /// Otherwise:
+    ///
+    /// - `ptr` must have been allocated with the allocator `A`.
+    /// - `ptr` must satisfy or exceed the alignment requirements of `T`.
+    /// - `ptr` must point to memory with a size of at least `size_of::<T>() * capacity` bytes.
+    /// - The allocated size in bytes must not be larger than `isize::MAX`.
+    /// - `length` must be less than or equal to `capacity`.
+    /// - The first `length` elements must be initialized values of type `T`.
+    ///
+    /// It is also valid to create an empty `Vec` passing a dangling pointer for `ptr` and zero for
+    /// `cap` and `len`.
+    pub unsafe fn from_raw_parts(ptr: *mut T, length: usize, capacity: usize) -> Self {
+        let layout = if Self::is_zst() {
+            ArrayLayout::empty()
+        } else {
+            // SAFETY: By the safety requirements of this function, `capacity * size_of::<T>()` is
+            // smaller than `isize::MAX`.
+            unsafe { ArrayLayout::new_unchecked(capacity) }
+        };
+
+        // INVARIANT: For ZSTs, we store an empty `ArrayLayout`, all other type invariants are
+        // covered by the safety requirements of this function.
+        Self {
+            // SAFETY: By the safety requirements, `ptr` is either dangling or pointing to a valid
+            // memory allocation, allocated with `A`.
+            ptr: unsafe { NonNull::new_unchecked(ptr) },
+            layout,
+            len: length,
+            _p: PhantomData::<A>,
+        }
+    }
+
+    /// Consumes the `Vec<T, A>` and returns its raw components `pointer`, `length` and `capacity`.
+    ///
+    /// This will not run the destructor of the contained elements and for non-ZSTs the allocation
+    /// will stay alive indefinitely. Use [`Vec::from_raw_parts`] to recover the [`Vec`], drop the
+    /// elements and free the allocation, if any.
+    pub fn into_raw_parts(self) -> (*mut T, usize, usize) {
+        let mut me = ManuallyDrop::new(self);
+        let len = me.len();
+        let capacity = me.capacity();
+        let ptr = me.as_mut_ptr();
+        (ptr, len, capacity)
+    }
+
+    /// Ensures that the capacity exceeds the length by at least `additional` elements.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let mut v = KVec::new();
+    /// v.push(1, GFP_KERNEL)?;
+    ///
+    /// v.reserve(10, GFP_KERNEL)?;
+    /// let cap = v.capacity();
+    /// assert!(cap >= 10);
+    ///
+    /// v.reserve(10, GFP_KERNEL)?;
+    /// let new_cap = v.capacity();
+    /// assert_eq!(new_cap, cap);
+    ///
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn reserve(&mut self, additional: usize, flags: Flags) -> Result<(), AllocError> {
+        let len = self.len();
+        let cap = self.capacity();
+
+        if cap - len >= additional {
+            return Ok(());
+        }
+
+        if Self::is_zst() {
+            // The capacity is already `usize::MAX` for ZSTs, we can't go higher.
+            return Err(AllocError);
+        }
+
+        // We know that `cap <= isize::MAX` because of the type invariants of `Self`. So the
+        // multiplication by two won't overflow.
+        let new_cap = core::cmp::max(cap * 2, len.checked_add(additional).ok_or(AllocError)?);
+        let layout = ArrayLayout::new(new_cap).map_err(|_| AllocError)?;
+
+        // SAFETY:
+        // - `ptr` is valid because it's either `None` or comes from a previous call to
+        //   `A::realloc`.
+        // - `self.layout` matches the `ArrayLayout` of the preceding allocation.
+        let ptr = unsafe {
+            A::realloc(
+                Some(self.ptr.cast()),
+                layout.into(),
+                self.layout.into(),
+                flags,
+            )?
+        };
+
+        // INVARIANT:
+        // - `layout` is some `ArrayLayout::<T>`,
+        // - `ptr` has been created by `A::realloc` from `layout`.
+        self.ptr = ptr.cast();
+        self.layout = layout;
+
+        Ok(())
+    }
+}
+
+impl<T: Clone, A: Allocator> Vec<T, A> {
+    /// Extend the vector by `n` clones of `value`.
+    pub fn extend_with(&mut self, n: usize, value: T, flags: Flags) -> Result<(), AllocError> {
+        if n == 0 {
+            return Ok(());
+        }
+
+        self.reserve(n, flags)?;
+
+        let spare = self.spare_capacity_mut();
+
+        for item in spare.iter_mut().take(n - 1) {
+            item.write(value.clone());
+        }
+
+        // We can write the last element directly without cloning needlessly.
+        spare[n - 1].write(value);
+
+        // SAFETY:
+        // - `self.len() + n < self.capacity()` due to the call to reserve above,
+        // - the loop and the line above initialized the next `n` elements.
+        unsafe { self.set_len(self.len() + n) };
+
+        Ok(())
+    }
+
+    /// Pushes clones of the elements of slice into the [`Vec`] instance.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// let mut v = KVec::new();
+    /// v.push(1, GFP_KERNEL)?;
+    ///
+    /// v.extend_from_slice(&[20, 30, 40], GFP_KERNEL)?;
+    /// assert_eq!(&v, &[1, 20, 30, 40]);
+    ///
+    /// v.extend_from_slice(&[50, 60], GFP_KERNEL)?;
+    /// assert_eq!(&v, &[1, 20, 30, 40, 50, 60]);
+    /// # Ok::<(), Error>(())
+    /// ```
+    pub fn extend_from_slice(&mut self, other: &[T], flags: Flags) -> Result<(), AllocError> {
+        self.reserve(other.len(), flags)?;
+        for (slot, item) in core::iter::zip(self.spare_capacity_mut(), other) {
+            slot.write(item.clone());
+        }
+
+        // SAFETY:
+        // - `other.len()` spare entries have just been initialized, so it is safe to increase
+        //   the length by the same number.
+        // - `self.len() + other.len() <= self.capacity()` is guaranteed by the preceding `reserve`
+        //   call.
+        unsafe { self.set_len(self.len() + other.len()) };
+        Ok(())
+    }
+
+    /// Create a new `Vec<T, A>` and extend it by `n` clones of `value`.
+    pub fn from_elem(value: T, n: usize, flags: Flags) -> Result<Self, AllocError> {
+        let mut v = Self::with_capacity(n, flags)?;
+
+        v.extend_with(n, value, flags)?;
+
+        Ok(v)
+    }
+}
+
+impl<T, A> Drop for Vec<T, A>
+where
+    A: Allocator,
+{
+    fn drop(&mut self) {
+        // SAFETY: `self.as_mut_ptr` is guaranteed to be valid by the type invariant.
+        unsafe {
+            ptr::drop_in_place(core::ptr::slice_from_raw_parts_mut(
+                self.as_mut_ptr(),
+                self.len,
+            ))
+        };
+
+        // SAFETY:
+        // - `self.ptr` was previously allocated with `A`.
+        // - `self.layout` matches the `ArrayLayout` of the preceding allocation.
+        unsafe { A::free(self.ptr.cast(), self.layout.into()) };
+    }
+}
+
+impl<T, A, const N: usize> From<Box<[T; N], A>> for Vec<T, A>
+where
+    A: Allocator,
+{
+    fn from(b: Box<[T; N], A>) -> Vec<T, A> {
+        let len = b.len();
+        let ptr = Box::into_raw(b);
+
+        // SAFETY:
+        // - `b` has been allocated with `A`,
+        // - `ptr` fulfills the alignment requirements for `T`,
+        // - `ptr` points to memory with at least a size of `size_of::<T>() * len`,
+        // - all elements within `b` are initialized values of `T`,
+        // - `len` does not exceed `isize::MAX`.
+        unsafe { Vec::from_raw_parts(ptr as _, len, len) }
+    }
+}
+
+impl<T> Default for KVec<T> {
+    #[inline]
+    fn default() -> Self {
+        Self::new()
+    }
+}
+
+impl<T: fmt::Debug, A: Allocator> fmt::Debug for Vec<T, A> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        fmt::Debug::fmt(&**self, f)
+    }
+}
+
+impl<T, A> Deref for Vec<T, A>
+where
+    A: Allocator,
+{
+    type Target = [T];
+
+    #[inline]
+    fn deref(&self) -> &[T] {
+        // SAFETY: The memory behind `self.as_ptr()` is guaranteed to contain `self.len`
+        // initialized elements of type `T`.
+        unsafe { slice::from_raw_parts(self.as_ptr(), self.len) }
+    }
+}
+
+impl<T, A> DerefMut for Vec<T, A>
+where
+    A: Allocator,
+{
+    #[inline]
+    fn deref_mut(&mut self) -> &mut [T] {
+        // SAFETY: The memory behind `self.as_ptr()` is guaranteed to contain `self.len`
+        // initialized elements of type `T`.
+        unsafe { slice::from_raw_parts_mut(self.as_mut_ptr(), self.len) }
+    }
+}
+
+impl<T: Eq, A> Eq for Vec<T, A> where A: Allocator {}
+
+impl<T, I: SliceIndex<[T]>, A> Index<I> for Vec<T, A>
+where
+    A: Allocator,
+{
+    type Output = I::Output;
+
+    #[inline]
+    fn index(&self, index: I) -> &Self::Output {
+        Index::index(&**self, index)
+    }
+}
+
+impl<T, I: SliceIndex<[T]>, A> IndexMut<I> for Vec<T, A>
+where
+    A: Allocator,
+{
+    #[inline]
+    fn index_mut(&mut self, index: I) -> &mut Self::Output {
+        IndexMut::index_mut(&mut **self, index)
+    }
+}
+
+macro_rules! impl_slice_eq {
+    ($([$($vars:tt)*] $lhs:ty, $rhs:ty,)*) => {
+        $(
+            impl<T, U, $($vars)*> PartialEq<$rhs> for $lhs
+            where
+                T: PartialEq<U>,
+            {
+                #[inline]
+                fn eq(&self, other: &$rhs) -> bool { self[..] == other[..] }
+            }
+        )*
+    }
+}
+
+impl_slice_eq! {
+    [A1: Allocator, A2: Allocator] Vec<T, A1>, Vec<U, A2>,
+    [A: Allocator] Vec<T, A>, &[U],
+    [A: Allocator] Vec<T, A>, &mut [U],
+    [A: Allocator] &[T], Vec<U, A>,
+    [A: Allocator] &mut [T], Vec<U, A>,
+    [A: Allocator] Vec<T, A>, [U],
+    [A: Allocator] [T], Vec<U, A>,
+    [A: Allocator, const N: usize] Vec<T, A>, [U; N],
+    [A: Allocator, const N: usize] Vec<T, A>, &[U; N],
+}
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -15,6 +15,7 @@
 #![feature(arbitrary_self_types)]
 #![feature(coerce_unsized)]
 #![feature(dispatch_from_dyn)]
+#![feature(inline_const)]
 #![feature(lint_reasons)]
 #![feature(unsize)]
 
--- 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::{flags::*, vec_ext::VecExt, Box, KBox, KVBox, VBox};
+pub use crate::alloc::{flags::*, vec_ext::VecExt, Box, KBox, KVBox, KVVec, KVec, VBox, VVec};
 
 #[doc(no_inline)]
 pub use alloc::vec::Vec;



  parent reply	other threads:[~2025-03-10 17:21 UTC|newest]

Thread overview: 282+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 17:02 [PATCH 6.12 000/269] 6.12.19-rc1 review Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 001/269] x86/amd_nb: Use rdmsr_safe() in amd_get_mmconfig_range() Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 002/269] rust: block: fix formatting in GenDisk doc Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 003/269] drm/i915/dsi: convert to struct intel_display Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 004/269] drm/i915/dsi: Use TRANS_DDI_FUNC_CTLs own port width macro Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 005/269] gpio: vf610: use generic device_get_match_data() Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 006/269] gpio: vf610: add locking to gpio direction functions Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 007/269] cifs: Remove symlink member from cifs_open_info_data union Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 008/269] smb311: failure to open files of length 1040 when mounting with SMB3.1.1 POSIX extensions Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 009/269] btrfs: fix data overwriting bug during buffered write when block size < page size Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 010/269] x86/microcode/AMD: Add some forgotten models to the SHA check Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 011/269] loongarch: Use ASM_REACHABLE Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 012/269] rust: workqueue: remove unneeded ``#[allow(clippy::new_ret_no_self)]` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 013/269] rust: sort global Rust flags Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 014/269] rust: types: avoid repetition in `{As,From}Bytes` impls Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 015/269] rust: enable `clippy::undocumented_unsafe_blocks` lint Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 016/269] rust: enable `clippy::unnecessary_safety_comment` lint Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 017/269] rust: enable `clippy::unnecessary_safety_doc` lint Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 018/269] rust: enable `clippy::ignored_unit_patterns` lint Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 019/269] rust: enable `rustdoc::unescaped_backticks` lint Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 020/269] rust: init: remove unneeded `#[allow(clippy::disallowed_names)]` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 021/269] rust: sync: remove unneeded `#[allow(clippy::non_send_fields_in_send_ty)]` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 022/269] rust: introduce `.clippy.toml` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 023/269] rust: replace `clippy::dbg_macro` with `disallowed_macros` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 024/269] rust: provide proper code documentation titles Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 025/269] rust: enable Clippys `check-private-items` Greg Kroah-Hartman
2025-03-10 17:02 ` [PATCH 6.12 026/269] Documentation: rust: add coding guidelines on lints Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 027/269] rust: start using the `#[expect(...)]` attribute Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 028/269] Documentation: rust: discuss `#[expect(...)]` in the guidelines Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 029/269] rust: error: make conversion functions public Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 030/269] rust: error: optimize error type to use nonzero Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 031/269] rust: alloc: add `Allocator` trait Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 032/269] rust: alloc: separate `aligned_size` from `krealloc_aligned` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 033/269] rust: alloc: rename `KernelAllocator` to `Kmalloc` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 034/269] rust: alloc: implement `ReallocFunc` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 035/269] rust: alloc: make `allocator` module public Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 036/269] rust: alloc: implement `Allocator` for `Kmalloc` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 037/269] rust: alloc: add module `allocator_test` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 038/269] rust: alloc: implement `Vmalloc` allocator Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 039/269] rust: alloc: implement `KVmalloc` allocator Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 040/269] rust: alloc: add __GFP_NOWARN to `Flags` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 041/269] rust: alloc: implement kernel `Box` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 042/269] rust: treewide: switch to our kernel `Box` type Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 043/269] rust: alloc: remove extension of stds `Box` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 044/269] rust: alloc: add `Box` to prelude Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 045/269] rust: alloc: introduce `ArrayLayout` Greg Kroah-Hartman
2025-03-10 17:03 ` Greg Kroah-Hartman [this message]
2025-03-10 17:03 ` [PATCH 6.12 047/269] rust: alloc: implement `IntoIterator` for `Vec` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 048/269] rust: alloc: implement `collect` for `IntoIter` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 049/269] rust: treewide: switch to the kernel `Vec` type Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 050/269] rust: alloc: remove `VecExt` extension Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 051/269] rust: alloc: add `Vec` to prelude Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 052/269] rust: error: use `core::alloc::LayoutError` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 053/269] rust: error: check for config `test` in `Error::name` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 054/269] rust: alloc: implement `contains` for `Flags` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 055/269] rust: alloc: implement `Cmalloc` in module allocator_test Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 056/269] rust: str: test: replace `alloc::format` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 057/269] rust: alloc: update module comment of alloc.rs Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 058/269] kbuild: rust: remove the `alloc` crate and `GlobalAlloc` Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 059/269] MAINTAINERS: add entry for the Rust `alloc` module Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 060/269] drm/panic: avoid reimplementing Iterator::find Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 061/269] drm/panic: remove unnecessary borrow in alignment_pattern Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 062/269] drm/panic: prefer eliding lifetimes Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 063/269] drm/panic: remove redundant field when assigning value Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 064/269] drm/panic: correctly indent continuation of line in list item Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 065/269] drm/panic: allow verbose boolean for clarity Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 066/269] drm/panic: allow verbose version check Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 067/269] rust: kbuild: expand rusttest target for macros Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 068/269] rust: fix size_t in bindgen prototypes of C builtins Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 069/269] rust: map `__kernel_size_t` and friends also to usize/isize Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 070/269] rust: use custom FFI integer types Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 071/269] rust: alloc: Fix `ArrayLayout` allocations Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 072/269] Revert "of: reserved-memory: Fix using wrong number of cells to get property alignment" Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 073/269] tracing: tprobe-events: Fix a memory leak when tprobe with $retval Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 074/269] tracing: tprobe-events: Reject invalid tracepoint name Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 075/269] stmmac: loongson: Pass correct arg to PCI function Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 076/269] LoongArch: Convert unreachable() to BUG() Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 077/269] LoongArch: Use polling play_dead() when resuming from hibernation Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 078/269] LoongArch: Set max_pfn with the PFN of the last page Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 079/269] LoongArch: KVM: Add interrupt checking for AVEC Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 080/269] LoongArch: KVM: Reload guest CSR registers after sleep Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 081/269] LoongArch: KVM: Fix GPA size issue about VM Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 082/269] HID: appleir: Fix potential NULL dereference at raw event handle Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 083/269] ksmbd: fix type confusion via race condition when using ipc_msg_send_request Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 084/269] ksmbd: fix out-of-bounds in parse_sec_desc() Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 085/269] ksmbd: fix use-after-free in smb2_lock Greg Kroah-Hartman
2025-03-10 17:03 ` [PATCH 6.12 086/269] ksmbd: fix bug on trap " Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 087/269] gpio: rcar: Use raw_spinlock to protect register access Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 088/269] gpio: aggregator: protect driver attr handlers against module unload Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 089/269] ALSA: seq: Avoid module auto-load handling at event delivery Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 090/269] ALSA: hda: intel: Add Dell ALC3271 to power_save denylist Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 091/269] ALSA: hda/realtek - add supported Mic Mute LED for Lenovo platform Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 092/269] ALSA: hda/realtek: update ALC222 depop optimize Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 093/269] btrfs: fix a leaked chunk map issue in read_one_chunk() Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 094/269] hwmon: (peci/dimmtemp) Do not provide fake thresholds data Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 095/269] drm/amd/display: Fix null check for pipe_ctx->plane_state in resource_build_scaling_params Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 096/269] drm/amdkfd: Fix NULL Pointer Dereference in KFD queue Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 097/269] drm/amd/pm: always allow ih interrupt from fw Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 098/269] drm/imagination: avoid deadlock on fence release Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 099/269] drm/imagination: Hold drm_gem_gpuva lock for unmap Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 100/269] drm/imagination: only init job done fences once Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 101/269] drm/radeon: Fix rs400_gpu_init for ATI mobility radeon Xpress 200M Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 102/269] Revert "mm/page_alloc.c: dont show protection in zones ->lowmem_reserve[] for empty zone" Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 103/269] Revert "selftests/mm: remove local __NR_* definitions" Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 104/269] platform/x86: thinkpad_acpi: Add battery quirk for ThinkPad X131e Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 105/269] x86/boot: Sanitize boot params before parsing command line Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 106/269] x86/cacheinfo: Validate CPUID leaf 0x2 EDX output Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 107/269] x86/cpu: " Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 108/269] x86/cpu: Properly parse CPUID leaf 0x2 TLB descriptor 0x63 Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 109/269] drm/xe: Add staging tree for VM binds Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 110/269] drm/xe/hmm: Style- and include fixes Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 111/269] drm/xe/hmm: Dont dereference struct page pointers without notifier lock Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 112/269] drm/xe/vm: Fix a misplaced #endif Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 113/269] drm/xe/vm: Validate userptr during gpu vma prefetching Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 114/269] mptcp: fix scheduling while atomic in mptcp_pm_nl_append_new_local_addr Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 115/269] drm/xe: Fix GT "for each engine" workarounds Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 116/269] drm/xe: Fix fault mode invalidation with unbind Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 117/269] drm/xe/userptr: properly setup pfn_flags_mask Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 118/269] drm/xe/userptr: Unmap userptrs in the mmu notifier Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 119/269] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_remote_name() Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 120/269] Bluetooth: Add check for mgmt_alloc_skb() in mgmt_device_connected() Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 121/269] wifi: cfg80211: regulatory: improve invalid hints checking Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 122/269] wifi: nl80211: reject cooked mode if it is set along with other flags Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 123/269] selftests/damon/damos_quota_goal: handle minimum quota that cannot be further reduced Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 124/269] selftests/damon/damos_quota: make real expectation of quota exceeds Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 125/269] selftests/damon/damon_nr_regions: set ops update for merge results check to 100ms Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 126/269] selftests/damon/damon_nr_regions: sort collected regiosn before checking with min/max boundaries Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 127/269] rapidio: add check for rio_add_net() in rio_scan_alloc_net() Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 128/269] rapidio: fix an API misues when rio_add_net() fails Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 129/269] dma: kmsan: export kmsan_handle_dma() for modules Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 130/269] s390/traps: Fix test_monitor_call() inline assembly Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 131/269] NFS: fix nfs_release_folio() to not deadlock via kcompactd writeback Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 132/269] userfaultfd: do not block on locking a large folio with raised refcount Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 133/269] block: fix conversion of GPT partition name to 7-bit Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 134/269] mm/page_alloc: fix uninitialized variable Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 135/269] mm: abort vma_modify() on merge out of memory failure Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 136/269] mm: memory-failure: update ttu flag inside unmap_poisoned_folio Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 137/269] mm: dont skip arch_sync_kernel_mappings() in error paths Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 138/269] mm: fix finish_fault() handling for large folios Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 139/269] hwpoison, memory_hotplug: lock folio before unmap hwpoisoned folio Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 140/269] mm: memory-hotplug: check folio ref count first in do_migrate_range Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 141/269] wifi: iwlwifi: mvm: clean up ROC on failure Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 142/269] wifi: iwlwifi: mvm: dont try to talk to a dead firmware Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 143/269] wifi: iwlwifi: limit printed string from FW file Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 144/269] wifi: iwlwifi: Free pages allocated when failing to build A-MSDU Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 145/269] wifi: iwlwifi: Fix A-MSDU TSO preparation Greg Kroah-Hartman
2025-03-10 17:04 ` [PATCH 6.12 146/269] HID: google: fix unused variable warning under !CONFIG_ACPI Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 147/269] HID: intel-ish-hid: Fix use-after-free issue in hid_ishtp_cl_remove() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 148/269] HID: intel-ish-hid: Fix use-after-free issue in ishtp_hid_remove() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 149/269] coredump: Only sort VMAs when core_sort_vma sysctl is set Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 150/269] nvme-pci: add support for sgl metadata Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 151/269] nvme-pci: use sgls for all user requests if possible Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 152/269] nvme-ioctl: fix leaked requests on mapping error Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 153/269] wifi: mac80211: Support parsing EPCS ML element Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 154/269] wifi: mac80211: fix MLE non-inheritance parsing Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 155/269] wifi: mac80211: fix vendor-specific inheritance Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 156/269] drm/fbdev-helper: Move color-mode lookup into 4CC format helper Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 157/269] drm/fbdev: Add memory-agnostic fbdev client Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 158/269] drm: Add client-agnostic setup helper Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 159/269] drm/fbdev-ttm: Support struct drm_driver.fbdev_probe Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 160/269] drm/nouveau: Run DRM default client setup Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 161/269] drm/nouveau: select FW caching Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 162/269] bluetooth: btusb: Initialize .owner field of force_poll_sync_fops Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 163/269] nvme-tcp: add basic support for the C2HTermReq PDU Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 164/269] nvme-tcp: fix potential memory corruption in nvme_tcp_recv_pdu() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 165/269] nvmet-tcp: Fix a possible sporadic response drops in weakly ordered arch Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 166/269] ALSA: hda/realtek: Remove (revert) duplicate Ally X config Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 167/269] net: gso: fix ownership in __udp_gso_segment Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 168/269] caif_virtio: fix wrong pointer check in cfv_probe() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 169/269] perf/core: Fix pmus_lock vs. pmus_srcu ordering Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 170/269] hwmon: (pmbus) Initialise page count in pmbus_identify() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 171/269] hwmon: (ntc_thermistor) Fix the ncpXXxh103 sensor table Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 172/269] hwmon: (ad7314) Validate leading zero bits and return error Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 173/269] tracing: probe-events: Remove unused MAX_ARG_BUF_LEN macro Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 174/269] drm/imagination: Fix timestamps in firmware traces Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 175/269] ALSA: usx2y: validate nrpacks module parameter on probe Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 176/269] llc: do not use skb_get() before dev_queue_xmit() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 177/269] hwmon: fix a NULL vs IS_ERR_OR_NULL() check in xgene_hwmon_probe() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 178/269] drm/sched: Fix preprocessor guard Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 179/269] be2net: fix sleeping while atomic bugs in be_ndo_bridge_getlink Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 180/269] net: hns3: make sure ptp clock is unregister and freed if hclge_ptp_get_cycle returns an error Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 181/269] drm/i915/color: Extract intel_color_modeset() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 182/269] drm/i915: Plumb dsb all way to the plane hooks Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 183/269] drm/xe: Remove double pageflip Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 184/269] HID: hid-steam: Fix use-after-free when detaching device Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 185/269] net: ipa: Fix v4.7 resource group names Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 186/269] net: ipa: Fix QSB data for v4.7 Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 187/269] net: ipa: Enable checksum for IPA_ENDPOINT_AP_MODEM_{RX,TX} " Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 188/269] ppp: Fix KMSAN uninit-value warning with bpf Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 189/269] ethtool: linkstate: migrate linkstate functions to support multi-PHY setups Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 190/269] net: ethtool: plumb PHY stats to PHY drivers Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 191/269] net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 192/269] vlan: enforce underlying device type Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 193/269] x86/sgx: Fix size overflows in sgx_encl_create() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 194/269] exfat: fix just enough dentries but allocate a new cluster to dir Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 195/269] exfat: fix soft lockup in exfat_clear_bitmap Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 196/269] exfat: short-circuit zero-byte writes in exfat_file_write_iter Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 197/269] net-timestamp: support TCP GSO case for a few missing flags Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 198/269] ublk: set_params: properly check if parameters can be applied Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 199/269] sched/fair: Fix potential memory corruption in child_cfs_rq_on_list Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 200/269] nvme-tcp: fix signedness bug in nvme_tcp_init_connection() Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 201/269] net: dsa: mt7530: Fix traffic flooding for MMIO devices Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 202/269] mctp i3c: handle NULL header address Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 203/269] net: ipv6: fix dst ref loop in ila lwtunnel Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 204/269] net: ipv6: fix missing dst ref drop " Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 205/269] gpio: rcar: Fix missing of_node_put() call Greg Kroah-Hartman
2025-03-10 17:05 ` [PATCH 6.12 206/269] Revert "drivers/card_reader/rtsx_usb: Restore interrupt based detection" Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 207/269] usb: renesas_usbhs: Call clk_put() Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 208/269] xhci: Restrict USB4 tunnel detection for USB3 devices to Intel hosts Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 209/269] usb: renesas_usbhs: Use devm_usb_get_phy() Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 210/269] usb: hub: lack of clearing xHC resources Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 211/269] usb: quirks: Add DELAY_INIT and NO_LPM for Prolific Mass Storage Card Reader Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 212/269] usb: typec: ucsi: Fix NULL pointer access Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 213/269] usb: renesas_usbhs: Flush the notify_hotplug_work Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 214/269] usb: gadget: u_ether: Set is_suspend flag if remote wakeup fails Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 215/269] usb: atm: cxacru: fix a flaw in existing endpoint checks Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 216/269] usb: dwc3: Set SUSPENDENABLE soon after phy init Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 217/269] usb: dwc3: gadget: Prevent irq storm when TH re-executes Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 218/269] usb: typec: ucsi: increase timeout for PPM reset operations Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 219/269] usb: typec: tcpci_rt1711h: Unmask alert interrupts to fix functionality Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 220/269] usb: gadget: Set self-powered based on MaxPower and bmAttributes Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 221/269] usb: gadget: Fix setting self-powered state on suspend Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 222/269] usb: gadget: Check bmAttributes only if configuration is valid Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 223/269] kbuild: userprogs: use correct lld when linking through clang Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 224/269] acpi: typec: ucsi: Introduce a ->poll_cci method Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 225/269] rust: finish using custom FFI integer types Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 226/269] rust: map `long` to `isize` and `char` to `u8` Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 227/269] xhci: pci: Fix indentation in the PCI device ID definitions Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 228/269] usb: xhci: Enable the TRB overfetch quirk on VIA VL805 Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 229/269] KVM: SVM: Set RFLAGS.IF=1 in C code, to get VMRUN out of the STI shadow Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 230/269] KVM: SVM: Save host DR masks on CPUs with DebugSwap Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 231/269] KVM: SVM: Drop DEBUGCTL[5:2] from guests effective value Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 232/269] KVM: SVM: Suppress DEBUGCTL.BTF on AMD Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 233/269] KVM: x86: Snapshot the hosts DEBUGCTL in common x86 Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 234/269] KVM: SVM: Manually context switch DEBUGCTL if LBR virtualization is disabled Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 235/269] KVM: x86: Snapshot the hosts DEBUGCTL after disabling IRQs Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 236/269] KVM: x86: Explicitly zero EAX and EBX when PERFMON_V2 isnt supported by KVM Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 237/269] cdx: Fix possible UAF error in driver_override_show() Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 238/269] mei: me: add panther lake P DID Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 239/269] mei: vsc: Use "wakeuphostint" when getting the host wakeup GPIO Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 240/269] intel_th: pci: Add Arrow Lake support Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 241/269] intel_th: pci: Add Panther Lake-H support Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 242/269] intel_th: pci: Add Panther Lake-P/U support Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 243/269] char: misc: deallocate static minor in error path Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 244/269] drivers: core: fix device leak in __fw_devlink_relax_cycles() Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 245/269] slimbus: messaging: Free transaction ID in delayed interrupt scenario Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 246/269] bus: mhi: host: pci_generic: Use pci_try_reset_function() to avoid deadlock Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 247/269] eeprom: digsy_mtc: Make GPIO lookup table match the device Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 248/269] drivers: virt: acrn: hsm: Use kzalloc to avoid info leak in pmcmd_ioctl Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 249/269] iio: filter: admv8818: Force initialization of SDO Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 250/269] iio: light: apds9306: fix max_scale_nano values Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 251/269] iio: dac: ad3552r: clear reset status flag Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 252/269] iio: adc: ad7192: fix channel select Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 253/269] iio: adc: at91-sama5d2_adc: fix sama7g5 realbits value Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 254/269] mm: hugetlb: Add huge page size param to huge_ptep_get_and_clear() Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 255/269] arm64: hugetlb: Fix huge_ptep_get_and_clear() for non-present ptes Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 256/269] fs/netfs/read_pgpriv2: skip folio queues without `marks3` Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 257/269] fs/netfs/read_collect: fix crash due to uninitialized `prev` variable Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 258/269] kbuild: hdrcheck: fix cross build with clang Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 259/269] ALSA: hda: realtek: fix incorrect IS_REACHABLE() usage Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 260/269] nvme-tcp: Fix a C2HTermReq error message Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 261/269] docs: rust: remove spurious item in `expect` list Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 262/269] Revert "KVM: e500: always restore irqs" Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 263/269] Revert "KVM: PPC: e500: Use __kvm_faultin_pfn() to handle page faults" Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 264/269] Revert "KVM: PPC: e500: Mark "struct page" pfn accessed before dropping mmu_lock" Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 265/269] Revert "KVM: PPC: e500: Mark "struct page" dirty in kvmppc_e500_shadow_map()" Greg Kroah-Hartman
2025-03-10 17:06 ` [PATCH 6.12 266/269] KVM: e500: always restore irqs Greg Kroah-Hartman
2025-03-10 17:07 ` [PATCH 6.12 267/269] uprobes: Fix race in uprobe_free_utask Greg Kroah-Hartman
2025-03-10 17:07 ` [PATCH 6.12 268/269] selftests/bpf: Clean up open-coded gettid syscall invocations Greg Kroah-Hartman
2025-03-10 17:07 ` [PATCH 6.12 269/269] x86/mm: Dont disable PCID when INVLPG has been fixed by microcode Greg Kroah-Hartman
2025-03-10 19:04 ` [PATCH 6.12 000/269] 6.12.19-rc1 review SeongJae Park
2025-03-10 19:58 ` Florian Fainelli
2025-03-11  7:04 ` Harshit Mogalapalli
2025-03-11  9:58 ` Jon Hunter
2025-03-11 10:05 ` Ron Economos
2025-03-11 12:18 ` Naresh Kamboju
2025-03-11 13:24 ` Mark Brown
2025-03-11 16:45 ` Shuah Khan
2025-03-11 17:03 ` Markus Reichelt
2025-03-11 18:04 ` Miguel Ojeda
2025-03-11 23:39 ` Peter Schneider
2025-03-12 17:17 ` Hardik Garg

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=20250310170459.558469721@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=benno.lossin@proton.me \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=ojeda@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox