[PATCH 0/2] uaccess: unify inline vs outline copy_{from,to}_user() selection

Yury Norov posted 2 patches 1 week, 1 day ago
arch/arc/include/asm/uaccess.h        |  3 +--
arch/arm/include/asm/uaccess.h        |  3 +--
arch/arm64/include/asm/uaccess.h      |  3 +--
arch/hexagon/include/asm/uaccess.h    |  3 +--
arch/loongarch/include/asm/uaccess.h  |  3 +--
arch/m68k/include/asm/uaccess.h       |  3 +--
arch/microblaze/include/asm/uaccess.h |  3 +--
arch/mips/include/asm/uaccess.h       |  3 +--
arch/nios2/include/asm/uaccess.h      |  3 +--
arch/openrisc/include/asm/uaccess.h   |  3 +--
arch/parisc/include/asm/uaccess.h     |  3 +--
arch/s390/include/asm/uaccess.h       |  3 +--
arch/sh/include/asm/uaccess.h         |  3 +--
arch/sparc/include/asm/uaccess_32.h   |  3 +--
arch/sparc/include/asm/uaccess_64.h   |  3 +--
arch/um/include/asm/uaccess.h         |  3 +--
arch/xtensa/include/asm/uaccess.h     |  3 +--
include/asm-generic/uaccess.h         |  3 +--
include/linux/uaccess.h               | 25 ++++++++++---------------
lib/usercopy.c                        |  4 +---
rust/helpers/uaccess.c                |  2 +-
21 files changed, 30 insertions(+), 55 deletions(-)
[PATCH 0/2] uaccess: unify inline vs outline copy_{from,to}_user() selection
Posted by Yury Norov 1 week, 1 day ago
Christophe has pointed in [1] that one my patch incorrectly defines
rust_helper__copy_to_user() wrapper based on INLINE_COPY_FROM_USER.

Having separate controls for 'from' and 'to' versions is pretty useless,
and has proven to be error prone. So, instead of fixing the rust portion,
simply switch the kernel to a single knob.

[1] https://lore.kernel.org/all/746c9c50-20c4-4dc9-a539-bf1310ff9414@kernel.org/

Yury Norov (2):
  uaccess: unify inline vs outline copy_{from,to}_user() selection
  uaccess: minimize INLINE_COPY_USER-related ifdefery

 arch/arc/include/asm/uaccess.h        |  3 +--
 arch/arm/include/asm/uaccess.h        |  3 +--
 arch/arm64/include/asm/uaccess.h      |  3 +--
 arch/hexagon/include/asm/uaccess.h    |  3 +--
 arch/loongarch/include/asm/uaccess.h  |  3 +--
 arch/m68k/include/asm/uaccess.h       |  3 +--
 arch/microblaze/include/asm/uaccess.h |  3 +--
 arch/mips/include/asm/uaccess.h       |  3 +--
 arch/nios2/include/asm/uaccess.h      |  3 +--
 arch/openrisc/include/asm/uaccess.h   |  3 +--
 arch/parisc/include/asm/uaccess.h     |  3 +--
 arch/s390/include/asm/uaccess.h       |  3 +--
 arch/sh/include/asm/uaccess.h         |  3 +--
 arch/sparc/include/asm/uaccess_32.h   |  3 +--
 arch/sparc/include/asm/uaccess_64.h   |  3 +--
 arch/um/include/asm/uaccess.h         |  3 +--
 arch/xtensa/include/asm/uaccess.h     |  3 +--
 include/asm-generic/uaccess.h         |  3 +--
 include/linux/uaccess.h               | 25 ++++++++++---------------
 lib/usercopy.c                        |  4 +---
 rust/helpers/uaccess.c                |  2 +-
 21 files changed, 30 insertions(+), 55 deletions(-)

-- 
2.43.0
Re: [PATCH 0/2] uaccess: unify inline vs outline copy_{from,to}_user() selection
Posted by Andrew Morton 1 week ago
On Wed, 25 Mar 2026 12:33:10 -0400 Yury Norov <ynorov@nvidia.com> wrote:

> Christophe has pointed in [1] that one my patch incorrectly defines
> rust_helper__copy_to_user() wrapper based on INLINE_COPY_FROM_USER.
> 
> Having separate controls for 'from' and 'to' versions is pretty useless,
> and has proven to be error prone. So, instead of fixing the rust portion,
> simply switch the kernel to a single knob.
> 
> [1] https://lore.kernel.org/all/746c9c50-20c4-4dc9-a539-bf1310ff9414@kernel.org/

Some changelog whining:

As this series is aimed at mainline inclusion, I don't see much value
in changelogging which refers to previous development versions of the
patchset.  That's useful material to include below the ^---$ separator,
but it isn't of interest to our target audience: people who are reading
this patchset three years hence.

So can we please have a clean description of what this patchset does and
why it does it?

Also, [1/2] says
Fixes: 1f9a8286bc0c ("uaccess: always export _copy_[from|to]_user with CONFIG_RUST")

but I'm not actually seeing a description of what was wrong with
1f9a8286bc0c.  Can we please have a description of the motivation in
here somewhere?