diff options
| author | Eric Biggers <ebiggers@kernel.org> | 2025-11-12 20:55:55 +0300 |
|---|---|---|
| committer | Eric Biggers <ebiggers@kernel.org> | 2025-11-12 20:55:55 +0300 |
| commit | 065f04001081fa48f24dd95f7095d06402756253 (patch) | |
| tree | 8d6eca52ad3838ac751d1bcc677b29c934ca5752 /lib/crypto/arm/chacha.h | |
| parent | 2dbb6f4a25d38fcf7d6c1c682e45a13e6bbe9562 (diff) | |
| parent | f53d18a4e67eacf665e9d60727d508387f84327b (diff) | |
| download | linux-065f04001081fa48f24dd95f7095d06402756253.tar.xz | |
Merge tag 'scoped-ksimd-for-arm-arm64' into libcrypto-fpsimd-on-stack
Pull scoped ksimd API for ARM and arm64 from Ard Biesheuvel:
"Introduce a more strict replacement API for
kernel_neon_begin()/kernel_neon_end() on both ARM and arm64, and
replace occurrences of the latter pair appearing in lib/crypto"
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib/crypto/arm/chacha.h')
| -rw-r--r-- | lib/crypto/arm/chacha.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/crypto/arm/chacha.h b/lib/crypto/arm/chacha.h index 0cae30f8ee5d..836e49088e98 100644 --- a/lib/crypto/arm/chacha.h +++ b/lib/crypto/arm/chacha.h @@ -12,7 +12,6 @@ #include <asm/cputype.h> #include <asm/hwcap.h> -#include <asm/neon.h> #include <asm/simd.h> asmlinkage void chacha_block_xor_neon(const struct chacha_state *state, @@ -68,9 +67,8 @@ static void hchacha_block_arch(const struct chacha_state *state, if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon_usable()) { hchacha_block_arm(state, out, nrounds); } else { - kernel_neon_begin(); - hchacha_block_neon(state, out, nrounds); - kernel_neon_end(); + scoped_ksimd() + hchacha_block_neon(state, out, nrounds); } } @@ -87,9 +85,8 @@ static void chacha_crypt_arch(struct chacha_state *state, u8 *dst, do { unsigned int todo = min_t(unsigned int, bytes, SZ_4K); - kernel_neon_begin(); - chacha_doneon(state, dst, src, todo, nrounds); - kernel_neon_end(); + scoped_ksimd() + chacha_doneon(state, dst, src, todo, nrounds); bytes -= todo; src += todo; |
