Re: [PATCH 5/5] lib/crc: arm: Enable arm64's NEON intrinsics implementation of crc64

Christoph Hellwig
2026-03-31T06:47:42Z

> depends on CRC64 && CRC_OPTIMIZATIONS
> + default y if ARM && KERNEL_MODE_NEON && !(CPU_BIG_ENDIAN && CC_IS_CLANG)

It would be useful to throw in a comment here why it is disabled for
big-endian on clang.

> +#define crc64_be_arch crc64_be_generic
> +
> +static inline u64 crc64_nvme_arch(u64 crc, const u8 *p, size_t len)
> +{
> + if (len >= 128 && static_branch_likely(&have_pmull) &&
> + likely(may_use_simd())) {
> + do {
> + size_t chunk = min_t(size_t, len & ~15, SZ_4K);
> +
> + scoped_ksimd()
> + crc = crc64_nvme_arm64_c(crc, p, chunk);
> +
> + p += chunk;
> + len -= chunk;
> + } while (len >= 128);
> + }

From reading the earlier patches, I'll assume arm SIMD code is
non-preemptable and thus you want the chunking here? Maybe add
a little comment explaining that?