Skip to content

RFC only - allow arches to over-ride unit sized user copies

[email protected] linux-arch lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2asm-generic: uaccess: allow arch to over-ride __get_user_fn()include/asm-generic/uaccess.h+5 -03 replies
2/2ARC: provide optimal __get_user_fn()arch/arc/include/asm/uaccess.h+51 -02 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchArnd Bergmann
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] RFC only - allow arches to over-ride unit sized user copies

From: Vineet Gupta <[email protected]>

Hi Arnd,

The current asm-generic/uaccess unit copy interface __{get,put}_user( ) defaults to using __copy_{to,from}_user( ). For archs which don't support unaligned access, latter typically involves generated code for alignment checks.

It is expected that arch will provide a fast path in __copy_{to,from}_user( ) for such unit sized copies - probably using __builtin_const_p( ) etc - however the alignment checks still can't be eliminated altogether using that. Even if they could, it woudl make the implementation messier IMHO.

However given that 2 separate interfaces already exist form beginning (i.e. __get_user vs. __copy_from_user) will it make sense to allow arch to provide alternate implementation of former w/o having to mess with latter.

I did a quick hack to that end and I can see that savings are more than just "noise".

bloat-o-meter vmlinux_pre_uaccess vmlinux_uaccess_part1 | head add/remove: 0/1 grow/shrink: 10/62 up/down: 1502/-7256 (-5754)

The patch which converts just __get_user follows. I've not done the full/clean version yet as this is just to gather feedback.

Thx,
-Vineet

Vineet Gupta (2):
asm-generic: uaccess: allow arch to over-ride __get_user_fn()
ARC: provide optimal __get_user_fn()

 arch/arc/include/asm/uaccess.h |   51 ++++++++++++++++++++++++++++++++++++++++
 include/asm-generic/uaccess.h  |    5 ++++
 2 files changed, 56 insertions(+), 0 deletions(-)
Signature · 1 line
1.7.4.1