s390/uaccess: Remove INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 16 Jan 2025 15:24:31 +0000 (16:24 +0100)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Sun, 26 Jan 2025 16:24:07 +0000 (17:24 +0100)
commit884f0582b232f521333c8ad1899c977d580dd755
tree55ac1a52f8aee4062da102e1ed69f558c8f1dcef
parentea5ae3a7f0a95cea70bd8afd165c95e19404a216
s390/uaccess: Remove INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER

The s390 implementations of raw_copy_from_user() and raw_copy_to_user() are
never inlined. However INLINE_COPY_FROM_USER and INLINE_COPY_TO_USER are
still set. This leads to the odd situation that only the error handling
(memset to zero of the not copied bytes) of copy_from_user() is inlined,
while the actual fast path code is out-of-line.

This would make sense if raw_copy_from_user() and raw_copy_to_user() were
implemented in assembler files, where inlining is not possible. But the
current s390 setup does not make any sense.

Address this by moving the raw uaccess copy inline assemblies to the
uaccess header file, and remove INLINE_COPY_FROM_USER and
INLINE_COPY_TO_USER definitions. This way the uaccess code, but now
including error handling, is still out-of-line with the common code
_copy_from_user() and _copy_to_user() variants, which inline the raw
uaccess functions via _inline_copy_from_user() and _inline_copy_to_user().

This reduces the size of the kernel image by ~17kb.
(defconfig, gcc 14.2.0)

Acked-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/include/asm/uaccess.h
arch/s390/lib/uaccess.c