]> www.infradead.org Git - users/jedix/linux-maple.git/commit
riscv: implement user_access_begin() and families
authorJisheng Zhang <jszhang@kernel.org>
Thu, 10 Apr 2025 07:05:23 +0000 (07:05 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 8 May 2025 17:01:00 +0000 (10:01 -0700)
commit19500c6dbc5c348564a6513c801ab0889300565a
tree0b34eb90f8aa7fe292aaae4b42040419b99250f7
parent788aa64c01f1262310b4c1fb827a36df170d86ea
riscv: implement user_access_begin() and families

Currently, when a function like strncpy_from_user() is called,
the userspace access protection is disabled and enabled
for every word read.

By implementing user_access_begin() and families, the protection
is disabled at the beginning of the copy and enabled at the end.

The __inttype macro is borrowed from x86 implementation.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Cyril Bur <cyrilbur@tenstorrent.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20250410070526.3160847-3-cyrilbur@tenstorrent.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/uaccess.h