diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2025-10-01 14:29:23 +0300 |
|---|---|---|
| committer | Ard Biesheuvel <ardb@kernel.org> | 2025-11-12 11:51:13 +0300 |
| commit | f53d18a4e67eacf665e9d60727d508387f84327b (patch) | |
| tree | 94fbda6d3ab2c319d07158593c5b9fcac4e504c6 /lib/crypto/arm/sha256.h | |
| parent | 814f5415d3e3084eeb0550acdee5eca8b4966055 (diff) | |
| download | linux-f53d18a4e67eacf665e9d60727d508387f84327b.tar.xz | |
lib/crypto: Switch ARM and arm64 to 'ksimd' scoped guard API
Before modifying the prototypes of kernel_neon_begin() and
kernel_neon_end() to accommodate kernel mode FP/SIMD state buffers
allocated on the stack, move arm64 to the new 'ksimd' scoped guard API,
which encapsulates the calls to those functions.
For symmetry, do the same for 32-bit ARM too.
Reviewed-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'lib/crypto/arm/sha256.h')
| -rw-r--r-- | lib/crypto/arm/sha256.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/crypto/arm/sha256.h b/lib/crypto/arm/sha256.h index 7556457b3094..ae7e52dd6e3b 100644 --- a/lib/crypto/arm/sha256.h +++ b/lib/crypto/arm/sha256.h @@ -22,12 +22,12 @@ static void sha256_blocks(struct sha256_block_state *state, { if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && static_branch_likely(&have_neon) && likely(may_use_simd())) { - kernel_neon_begin(); - if (static_branch_likely(&have_ce)) - sha256_ce_transform(state, data, nblocks); - else - sha256_block_data_order_neon(state, data, nblocks); - kernel_neon_end(); + scoped_ksimd() { + if (static_branch_likely(&have_ce)) + sha256_ce_transform(state, data, nblocks); + else + sha256_block_data_order_neon(state, data, nblocks); + } } else { sha256_block_data_order(state, data, nblocks); } |
