s390/uaccess: Shorten raw_copy_from_user() / raw_copy_to_user() inline assemblies
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Feb 2025 19:19:26 +0000 (20:19 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:18:03 +0000 (17:18 +0100)
commitc488f5187a24969b40fd08c3e9ead377c0cfb9b3
treef8cde8b32b1cc9267f8bd683e22050e7900ef4fe
parentfb5bbcdcc3eabd8e9061eac7c3223e3de640adfa
s390/uaccess: Shorten raw_copy_from_user() / raw_copy_to_user() inline assemblies

Add specific exception handler for copy_to_user() / copy_from_user()
mvcos fault handling, which allows to shorten the inline assemblies to
three instructions.

On fault the exception handler adjusts the length used by the mvcos
instruction in a way that the instruction completes with condition code
zero, indicating the number of bytes copied with the input/output operand
'size'. This allows to calculate and return the number of bytes not copied,
if any, like required.

Loop and return value handling is changed to C so that the compiler may
optimize the code.

Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/asm-extable.h
arch/s390/include/asm/uaccess.h
arch/s390/mm/extable.c