LoongArch: Adjust {copy, clear}_user exception handler behavior
authorWeihao Li <liweihao@loongson.cn>
Wed, 6 Sep 2023 14:53:10 +0000 (22:53 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 6 Sep 2023 14:53:10 +0000 (22:53 +0800)
commit937f65935950a0346292120acc5d98033f90e61c
treed52fe3bb341d74cf9d3a3ecfce3024ce8c4ae56b
parent0921af6ccfb37dc2d6aefcf744333c14e7ca739d
LoongArch: Adjust {copy, clear}_user exception handler behavior

The {copy, clear}_user function should returns number of bytes that
could not be {copied, cleared}. So, try to {copy, clear} byte by byte
when ld.{d,w,h} and st.{d,w,h} trapped into an exception.

Reviewed-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Weihao Li <liweihao@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/lib/clear_user.S
arch/loongarch/lib/copy_user.S