Skip to content

riscv: uaccess: optimizations

Jisheng Zhang linux-arch linux-riscv lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4riscv: implement user_access_begin and familiesarch/riscv/include/asm/uaccess.h+63 -01 reply
2/4riscv: uaccess: use input constraints for ptr of __put_userarch/riscv/include/asm/uaccess.h+9 -912 replies
3/4riscv: uaccess: use 'asm goto' for put_user()arch/riscv/include/asm/uaccess.h+32 -360 replies
4/4riscv: uaccess: use 'asm goto output' for get_userarch/riscv/include/asm/uaccess.h+63 -250 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchCyril Bur
1/4R-b
2/4
3/4
4/4

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/4] riscv: uaccess: optimizations

This series tries to optimize riscv uaccess in the following way:

patch1 implement the user_access_begin and families, I.E the unsafe accessors. when a function like strncpy_from_user() is called, the userspace access protection is disabled and enabled for every word read. After patch1, the protection is disabled at the beginning of the copy and enabled at the end.

patch2 is a simple clean up

patch3 uses 'asm goto' for put_user()
patch4 uses 'asm goto output' for get_user()

Both patch3 and patch4 are based on the fact -- 'asm goto' and 'asm goto output'generates noticeably better code since we don't need to test the error etc, the exception just jumps to the error handling directly.

Jisheng Zhang (4):
riscv: implement user_access_begin and families
riscv: uaccess: use input constraints for ptr of __put_user
riscv: uaccess: use 'asm goto' for put_user()
riscv: uaccess: use 'asm goto output' for get_user

 arch/riscv/include/asm/uaccess.h | 201 +++++++++++++++++++++++--------
 1 file changed, 149 insertions(+), 52 deletions(-)
Signature · 1 line
2.43.0