FreeBSD: Wire sha512 offload to the build

FreeBSD main just got the CPUID_STDEXT4_SHA512 define.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Rob Norris <[email protected]>
Signed-off-by: Alexander Motin <[email protected]>
Closes #18732
This commit is contained in:
Alexander Motin authored and GitHub committed 2026-07-02 10:16:26 -07:00
1 parent 1ff51ebedd
commit 37f066e3c9
2 files changed
+15 -1

No files matched your search

+14
View File
@@ -191,6 +191,20 @@ zfs_shani_available(void)
return (has_shani && __ymm_enabled());
}
/*
* Check if SHA-512 extension is available
*/
static inline boolean_t
zfs_sha512ext_available(void)
{
#if defined(CPUID_STDEXT4_SHA512)
return ((cpu_stdext_feature4 & CPUID_STDEXT4_SHA512) != 0 &&
__ymm_enabled());
#else
return (B_FALSE);
#endif
}
/*
* AVX-512 family of instruction sets:
*
+1 -1
View File
@@ -50,7 +50,7 @@ CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 \
CFLAGS+= -D__x86_64 -DHAVE_TOOLCHAIN_SSE2 -DHAVE_TOOLCHAIN_SSSE3 \
-DHAVE_TOOLCHAIN_SSE4_1 -DHAVE_TOOLCHAIN_AVX -DHAVE_TOOLCHAIN_AVX2 \
-DHAVE_TOOLCHAIN_AVX512F -DHAVE_TOOLCHAIN_AVX512VL \
-DHAVE_TOOLCHAIN_AVX512BW
-DHAVE_TOOLCHAIN_AVX512BW -DHAVE_TOOLCHAIN_SHA512EXT
.endif
.if defined(WITH_DEBUG) && ${WITH_DEBUG} == "true"