Re: [PATCH] rust: uaccess: mark UserSliceReader methods inline
From: Alice Ryhl
Date: Tue Mar 11 2025 - 03:43:56 EST
On Tue, Mar 11, 2025 at 3:15 AM Antonio Hickey
<contact@xxxxxxxxxxxxxxxxx> wrote:
>
> When you build the kernel using the llvm-19.1.4-rust-1.83.0-x86_64
> toolchain provided by kernel.org with ARCH=x86_64, the following symbols
> are generated:
>
> $nm vmlinux | grep ' _R'.*UserSliceReader | rustfilt
> ffffffff817c3320 T <kernel::uaccess::UserSliceReader>::read_slice
> ffffffff817c32b0 T <kernel::uaccess::UserSliceReader>::read_raw
>
> However, these Rust symbols are trivial wrappers around the functions
> copy_from_user, _copy_from_user respectively. It doesn't
> make sense to go through a trivial wrapper for these functions, so mark
> them inline.
>
> After applying this patch, the above command will produce no output.
>
> Signed-off-by: Antonio Hickey <contact@xxxxxxxxxxxxxxxxx>
I believe you're missing a Link: and Suggested-by: tag.
Otherwise looks good to me.
Alice