summaryrefslogtreecommitdiff
path: root/lib/raid6
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-02-05 16:48:44 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-02-09 13:58:16 +0100
commit8d16ce148858669f05b8e117a0634010397e17d6 (patch)
tree5a95abf3cecd0a6e4684c71d32eb2d16fc60e59c /lib/raid6
parentfd7eea27a3aed79b63b1726c00bde0d50cf207e2 (diff)
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 'lib/raid6')
-rw-r--r--lib/raid6/s390vx.uc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/raid6/s390vx.uc b/lib/raid6/s390vx.uc
index cd0b9e95f499..7b0b355e1a26 100644
--- a/lib/raid6/s390vx.uc
+++ b/lib/raid6/s390vx.uc
@@ -81,7 +81,7 @@ static inline void COPY_VEC(int x, int y)
static void raid6_s390vx$#_gen_syndrome(int disks, size_t bytes, void **ptrs)
{
- struct kernel_fpu vxstate;
+ DECLARE_KERNEL_FPU_ONSTACK(vxstate);
u8 **dptr, *p, *q;
int d, z, z0;
@@ -114,7 +114,7 @@ static void raid6_s390vx$#_gen_syndrome(int disks, size_t bytes, void **ptrs)
static void raid6_s390vx$#_xor_syndrome(int disks, int start, int stop,
size_t bytes, void **ptrs)
{
- struct kernel_fpu vxstate;
+ DECLARE_KERNEL_FPU_ONSTACK(vxstate);
u8 **dptr, *p, *q;
int d, z, z0;