linux/arch/riscv
Luc Van Oostenryck 86406d51d3
riscv: split the declaration of __copy_user
We use a single __copy_user assembly function to copy memory both from
and to userspace. While this works, it triggers sparse errors because
we're implicitly casting between the kernel and user address spaces by
calling __copy_user.

This patch splits the C declaration into a pair of functions,
__asm_copy_{to,from}_user, that have sane semantics WRT __user. This
split make things fine from sparse's point of view. The assembly
implementation keeps a single definition but add a double ENTRY() for it,
one for __asm_copy_to_user and another one for __asm_copy_from_user.
The result is a spare-safe implementation that pays no performance
or code size penalty.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
2018-06-09 12:34:31 -07:00
..
configs RISC-V: Enable module support in defconfig 2018-04-02 20:00:56 -07:00
include riscv: split the declaration of __copy_user 2018-06-09 12:34:31 -07:00
kernel riscv: split the declaration of __copy_user 2018-06-09 12:34:31 -07:00
lib riscv: split the declaration of __copy_user 2018-06-09 12:34:31 -07:00
mm RISC-V changes for 4.16 2018-02-07 11:33:08 -08:00
Kconfig riscv: select DMA_DIRECT_OPS instead of redefining it 2018-04-24 10:54:08 -07:00
Makefile RISC-V: Fixes to module loading 2018-04-02 20:43:14 -07:00