Skip to content

Commit dec1061

Browse files
author
Eric Biggers
committed
lib/crypto: arm64/poly1305: Remove obsolete chunking logic
Since commit aefbab8 ("arm64: fpsimd: Preserve/restore kernel mode NEON at context switch"), kernel-mode NEON sections have been preemptible on arm64. And since commit 7dadeaa ("sched: Further restrict the preemption modes"), voluntary preemption is no longer supported on arm64 either. Therefore, there's no longer any need to limit the length of kernel-mode NEON sections on arm64. Simplify the Poly1305 code accordingly. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260401000548.133151-5-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent d3a5cc5 commit dec1061

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

lib/crypto/arm64/poly1305.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,11 @@ static void poly1305_blocks(struct poly1305_block_state *state, const u8 *src,
2727
unsigned int len, u32 padbit)
2828
{
2929
if (static_branch_likely(&have_neon) && likely(may_use_simd())) {
30-
do {
31-
unsigned int todo = min_t(unsigned int, len, SZ_4K);
32-
33-
scoped_ksimd()
34-
poly1305_blocks_neon(state, src, todo, padbit);
35-
36-
len -= todo;
37-
src += todo;
38-
} while (len);
39-
} else
30+
scoped_ksimd()
31+
poly1305_blocks_neon(state, src, len, padbit);
32+
} else {
4033
poly1305_blocks_arm64(state, src, len, padbit);
34+
}
4135
}
4236

4337
#define poly1305_mod_init_arch poly1305_mod_init_arch

0 commit comments

Comments
 (0)