Index: sys/libkern/gsb_crc32.c =================================================================== --- sys/libkern/gsb_crc32.c +++ sys/libkern/gsb_crc32.c @@ -58,7 +58,8 @@ #endif #if defined(__aarch64__) -#include +#include +#include #endif #endif /* _KERNEL */ @@ -770,14 +771,7 @@ } else #endif #if defined(__aarch64__) - uint64_t reg; - - /* - * We only test for CRC32 support on the CPU with index 0 assuming that - * this applies to all CPUs. - */ - reg = READ_SPECIALREG(id_aa64isar0_el1); - if (ID_AA64ISAR0_CRC32_VAL(reg) != ID_AA64ISAR0_CRC32_NONE) { + if ((elf_hwcap & HWCAP_CRC32) != 0) { return (armv8_crc32c(crc32c, buffer, length)); } else #endif