s390/uaccess: Optimize raw_copy_from_user() / raw_copy_to_user() for constant sizes
authorHeiko Carstens <hca@linux.ibm.com>
Tue, 11 Feb 2025 19:19:29 +0000 (20:19 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:18:03 +0000 (17:18 +0100)
commit88e87cb7b8f8afcf1776d5b8a3ddd17fe8d2a32f
tree599444e250ca73b57bd710742836bf24fc6e0a6e
parent10a79b6fdd1a4ead85d270bfa3ae0b7bb83020cf
s390/uaccess: Optimize raw_copy_from_user() / raw_copy_to_user() for constant sizes

Avoid that the compiler generates an mvcos loop for constant sizes
smaller than 4096 bytes. The mvcos instruction copies between zero and
4096 bytes (effective length) with one operation. Therefore it is not
necessary to implement a loop for sizes smaller or equal to 4096
bytes.

This reduces the kernel text size by ~50kb (defconfig, gcc 14.2.0):
add/remove: 4/5 grow/shrink: 6/471 up/down: 2294/-51700 (-49406)

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