[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87ldnqf06r.fsf@t14s.mail-host-address-is-not-set>
Date: Mon, 11 Aug 2025 15:38:20 +0200
From: Andreas Hindborg <a.hindborg@...nel.org>
To: Alice Ryhl <aliceryhl@...gle.com>, Lorenzo Stoakes
<lorenzo.stoakes@...cle.com>, "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Andrew Morton <akpm@...ux-foundation.org>, Danilo Krummrich
<dakr@...nel.org>, Matthew Wilcox <willy@...radead.org>, Tamir Duberstein
<tamird@...il.com>, Miguel Ojeda <ojeda@...nel.org>
Cc: Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn
Roy Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, linux-mm@...ck.org,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org, Alice Ryhl
<aliceryhl@...gle.com>
Subject: Re: [PATCH v2 0/2] Take ARCH_KMALLOC_MINALIGN into account for
build-time XArray check
"Alice Ryhl" <aliceryhl@...gle.com> writes:
> The Rust bindings for XArray include a build-time check to ensure that
> you can only use the XArray with pointers that are 4-byte aligned.
> Because of that, there is currently a build failure if you attempt to
> create an XArray<KBox<T>> where T is a 1-byte or 2-byte aligned type.
> However, this error is incorrect as KBox<_> is guaranteed to be a
> pointer that comes from kmalloc, and kmalloc always produces pointers
> that are at least 4-byte aligned.
>
> To fix this, we augment the compile-time logic that computes the
> alignment of KBox<_> to take the minimum alignment of its allocator into
> account.
>
> Intended to land through alloc-next under the RUST [ALLOC] entry.
>
> Signed-off-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Andreas Hindborg <a.hindborg@...nel.org>
Best regards,
Andreas Hindborg
Powered by blists - more mailing lists