diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2025-12-03 17:38:05 +0100 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2025-12-09 15:10:21 -0800 |
| commit | a9a8b1a383254c9f4ed7fe23b56937f8ad3ad3ab (patch) | |
| tree | 111608cac37e07640b579b561b2ef7c6a4941c48 /scripts/kconfig/expr.c | |
| parent | 68b233b1d583f7d869fbb3afe2b0531138e001f7 (diff) | |
crypto/arm64: aes/xts - Use single ksimd scope to reduce stack bloat
The ciphertext stealing logic in the AES-XTS implementation creates a
separate ksimd scope to call into the FP/SIMD core routines, and in some
cases (CONFIG_KASAN_STACK is one, but there might be others), the 528
byte kernel mode FP/SIMD buffer that is allocated inside this scope is
not shared with the preceding ksimd scope, resulting in unnecessary
stack bloat.
Considering that
a) the XTS ciphertext stealing logic is never called for block
encryption use cases, and XTS is rarely used for anything else,
b) in the vast majority of cases, the entire input block is processed
during the first iteration of the loop,
we can combine both ksimd scopes into a single one with no practical
impact on how often/how long FP/SIMD is en/disabled, allowing us to
reuse the same stack slot for both FP/SIMD routine calls.
Fixes: ba3c1b3b5ac9 ("crypto/arm64: aes-blk - Switch to 'ksimd' scoped guard API")
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20251203163803.157541-5-ardb@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'scripts/kconfig/expr.c')
0 files changed, 0 insertions, 0 deletions
