summaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto
diff options
context:
space:
mode:
authorHeiko Carstens <hca@linux.ibm.com>2024-02-03 11:45:17 +0100
committerHeiko Carstens <hca@linux.ibm.com>2024-02-16 14:30:16 +0100
commit066c40918bb495de8f2e45bd7eec06737a142712 (patch)
tree4b510a53f7616d9095336cc60e78fcc54f2275a7 /arch/s390/crypto
parentcad8c3abaac3848f46ba9d1b21f79fab87098da2 (diff)
downloadlinux-stable-066c40918bb495de8f2e45bd7eec06737a142712.tar.gz
linux-stable-066c40918bb495de8f2e45bd7eec06737a142712.tar.bz2
linux-stable-066c40918bb495de8f2e45bd7eec06737a142712.zip
s390/fpu: decrease stack usage for some cases
The kernel_fpu structure has a quite large size of 520 bytes. In order to reduce stack footprint introduce several kernel fpu structures with different and also smaller sizes. This way every kernel fpu user must use the correct variant. A compile time check verifies that the correct variant is used. There are several users which use only 16 instead of all 32 vector registers. For those users the new kernel_fpu_16 structure with a size of only 266 bytes can be used. Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/crypto')
-rw-r--r--arch/s390/crypto/chacha-glue.c2
-rw-r--r--arch/s390/crypto/crc32-vx.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/crypto/chacha-glue.c b/arch/s390/crypto/chacha-glue.c
index 97098add2079..f8b0c52e77a4 100644
--- a/arch/s390/crypto/chacha-glue.c
+++ b/arch/s390/crypto/chacha-glue.c
@@ -22,7 +22,7 @@ static void chacha20_crypt_s390(u32 *state, u8 *dst, const u8 *src,
unsigned int nbytes, const u32 *key,
u32 *counter)
{
- DECLARE_KERNEL_FPU_ONSTACK(vxstate);
+ DECLARE_KERNEL_FPU_ONSTACK32(vxstate);
kernel_fpu_begin(&vxstate, KERNEL_VXR);
chacha20_vx(dst, src, nbytes, key, counter);
diff --git a/arch/s390/crypto/crc32-vx.c b/arch/s390/crypto/crc32-vx.c
index dc2997f18e30..d9f1fdb66691 100644
--- a/arch/s390/crypto/crc32-vx.c
+++ b/arch/s390/crypto/crc32-vx.c
@@ -50,7 +50,7 @@ u32 crc32c_le_vgfm_16(u32 crc, unsigned char const *buf, size_t size);
unsigned char const *data, size_t datalen) \
{ \
unsigned long prealign, aligned, remaining; \
- DECLARE_KERNEL_FPU_ONSTACK(vxstate); \
+ DECLARE_KERNEL_FPU_ONSTACK16(vxstate); \
\
if (datalen < VX_MIN_LEN + VX_ALIGN_MASK) \
return ___crc32_sw(crc, data, datalen); \