Skip to content

Commit d3a5cc5

Browse files
author
Eric Biggers
committed
lib/crypto: arm64/gf128hash: 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 GHASH and POLYVAL code accordingly. Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260401000548.133151-4-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
1 parent 63fcc76 commit d3a5cc5

1 file changed

Lines changed: 4 additions & 20 deletions

File tree

lib/crypto/arm64/gf128hash.h

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,8 @@ static void ghash_blocks_arch(struct polyval_elem *acc,
8989
const u8 *data, size_t nblocks)
9090
{
9191
if (static_branch_likely(&have_asimd) && may_use_simd()) {
92-
do {
93-
/* Allow rescheduling every 4 KiB. */
94-
size_t n = min_t(size_t, nblocks,
95-
4096 / GHASH_BLOCK_SIZE);
96-
97-
scoped_ksimd()
98-
pmull_ghash_update_p8(n, acc, data, &key->h);
99-
data += n * GHASH_BLOCK_SIZE;
100-
nblocks -= n;
101-
} while (nblocks);
92+
scoped_ksimd()
93+
pmull_ghash_update_p8(nblocks, acc, data, &key->h);
10294
} else {
10395
ghash_blocks_generic(acc, &key->h, data, nblocks);
10496
}
@@ -110,16 +102,8 @@ static void polyval_blocks_arch(struct polyval_elem *acc,
110102
const u8 *data, size_t nblocks)
111103
{
112104
if (static_branch_likely(&have_pmull) && may_use_simd()) {
113-
do {
114-
/* Allow rescheduling every 4 KiB. */
115-
size_t n = min_t(size_t, nblocks,
116-
4096 / POLYVAL_BLOCK_SIZE);
117-
118-
scoped_ksimd()
119-
polyval_blocks_pmull(acc, key, data, n);
120-
data += n * POLYVAL_BLOCK_SIZE;
121-
nblocks -= n;
122-
} while (nblocks);
105+
scoped_ksimd()
106+
polyval_blocks_pmull(acc, key, data, nblocks);
123107
} else {
124108
polyval_blocks_generic(acc, &key->h_powers[NUM_H_POWERS - 1],
125109
data, nblocks);

0 commit comments

Comments
 (0)