s390/fpu: make use of __uninitialized macro
authorHeiko Carstens <hca@linux.ibm.com>
Mon, 5 Feb 2024 15:48:44 +0000 (16:48 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 9 Feb 2024 12:58:16 +0000 (13:58 +0100)
commit8d16ce148858669f05b8e117a0634010397e17d6
tree5a95abf3cecd0a6e4684c71d32eb2d16fc60e59c
parentfd7eea27a3aed79b63b1726c00bde0d50cf207e2
s390/fpu: make use of __uninitialized macro

Code sections in s390 specific kernel code which use floating point or
vector registers all come with a 520 byte stack variable to save already in
use registers, if required.

With INIT_STACK_ALL_PATTERN or INIT_STACK_ALL_ZERO enabled this variable
will always be initialized on function entry in addition to saving register
contents, which contradicts the intention (performance improvement) of such
code sections.

Therefore provide a DECLARE_KERNEL_FPU_ONSTACK() macro which provides
struct kernel_fpu variables with an __uninitialized attribute, and convert
all existing code to use this.

This way only this specific type of stack variable will not be initialized,
regardless of config options.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20240205154844.3757121-3-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/crypto/chacha-glue.c
arch/s390/crypto/crc32-vx.c
arch/s390/include/asm/fpu/types.h
arch/s390/kernel/sysinfo.c
lib/raid6/s390vx.uc