diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2024-02-05 16:48:44 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2024-02-09 13:58:16 +0100 |
commit | 8d16ce148858669f05b8e117a0634010397e17d6 (patch) | |
tree | 5a95abf3cecd0a6e4684c71d32eb2d16fc60e59c /arch/s390/include/asm/fpu | |
parent | fd7eea27a3aed79b63b1726c00bde0d50cf207e2 (diff) | |
download | lwn-8d16ce148858669f05b8e117a0634010397e17d6.tar.gz lwn-8d16ce148858669f05b8e117a0634010397e17d6.zip |
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>
Diffstat (limited to 'arch/s390/include/asm/fpu')
-rw-r--r-- | arch/s390/include/asm/fpu/types.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/s390/include/asm/fpu/types.h b/arch/s390/include/asm/fpu/types.h index d889e9436865..b1afa13c07b7 100644 --- a/arch/s390/include/asm/fpu/types.h +++ b/arch/s390/include/asm/fpu/types.h @@ -35,4 +35,7 @@ struct kernel_fpu { }; }; +#define DECLARE_KERNEL_FPU_ONSTACK(name) \ + struct kernel_fpu name __uninitialized + #endif /* _ASM_S390_FPU_TYPES_H */ |