summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2026-03-30 16:46:32 +0200
committerEric Biggers <ebiggers@kernel.org>2026-04-02 16:14:53 -0700
commite0718ed60d60299840cfc2a408eb26042a20d186 (patch)
tree06d3d11d80b662e44a57b6a7672e4674ceb8463c /lib
parent5276ea17a23c829d4e4417569abff71a1c8342d9 (diff)
downloadlwn-e0718ed60d60299840cfc2a408eb26042a20d186.tar.gz
lwn-e0718ed60d60299840cfc2a408eb26042a20d186.zip
lib/crc: arm64: Drop unnecessary chunking logic from crc64
On arm64, kernel mode NEON executes with preemption enabled, so there is no need to chunk the input by hand. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20260330144630.33026-8-ardb@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/crc/arm64/crc64.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/crc/arm64/crc64.h b/lib/crc/arm64/crc64.h
index cc65abeee24c..60151ec3035a 100644
--- a/lib/crc/arm64/crc64.h
+++ b/lib/crc/arm64/crc64.h
@@ -16,15 +16,13 @@ static inline u64 crc64_nvme_arch(u64 crc, const u8 *p, size_t len)
{
if (len >= 128 && cpu_have_named_feature(PMULL) &&
likely(may_use_simd())) {
- do {
- size_t chunk = min_t(size_t, len & ~15, SZ_4K);
+ size_t chunk = len & ~15;
- scoped_ksimd()
- crc = crc64_nvme_arm64_c(crc, p, chunk);
+ scoped_ksimd()
+ crc = crc64_nvme_arm64_c(crc, p, chunk);
- p += chunk;
- len -= chunk;
- } while (len >= 128);
+ p += chunk;
+ len &= 15;
}
return crc64_nvme_generic(crc, p, len);
}