diff options
author | Tony Hutter <[email protected]> | 2019-01-11 18:01:28 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-01-28 10:11:45 -0800 |
commit | 0c593296e98e3ac95f14704e4cee6cedb2134990 (patch) | |
tree | 12adc0a34c8b8e65cd1006cd30c0a51b39e30db2 /config/kernel-fpu.m4 | |
parent | ed158b19b1dddf26f2bbebb4d0fd21f04fdd5d38 (diff) |
Linux 5.0 compat: Disable vector instructions on 5.0+ kernels
The 5.0 kernel no longer exports the functions we need to do vector
(SSE/SSE2/SSE3/AVX...) instructions. Disable vector-based checksum
algorithms when building against those kernels.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Tony Hutter <[email protected]>
Closes #8259
Diffstat (limited to 'config/kernel-fpu.m4')
-rw-r--r-- | config/kernel-fpu.m4 | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/config/kernel-fpu.m4 b/config/kernel-fpu.m4 index 1c5690969..671fe7ea5 100644 --- a/config/kernel-fpu.m4 +++ b/config/kernel-fpu.m4 @@ -1,18 +1,41 @@ +dnl # +dnl # Handle differences in kernel FPU code. dnl # -dnl # 4.2 API change -dnl # asm/i387.h is replaced by asm/fpu/api.h +dnl # Kernel +dnl # 5.0: All kernel fpu functions are GPL only, so we can't use them. +dnl # (nothing defined) +dnl # +dnl # 4.2: Use __kernel_fpu_{begin,end}() +dnl # HAVE_UNDERSCORE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU +dnl # +dnl # Pre-4.2: Use kernel_fpu_{begin,end}() +dnl # HAVE_KERNEL_FPU & KERNEL_EXPORTS_X86_FPU dnl # AC_DEFUN([ZFS_AC_KERNEL_FPU], [ - AC_MSG_CHECKING([whether asm/fpu/api.h exists]) + AC_MSG_CHECKING([which kernel_fpu function to use]) ZFS_LINUX_TRY_COMPILE([ - #include <linux/kernel.h> - #include <asm/fpu/api.h> + #include <asm/i387.h> + #include <asm/xcr.h> ],[ - __kernel_fpu_begin(); + kernel_fpu_begin(); + kernel_fpu_end(); ],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FPU_API_H, 1, [kernel has <asm/fpu/api.h> interface]) + AC_MSG_RESULT(kernel_fpu_*) + AC_DEFINE(HAVE_KERNEL_FPU, 1, [kernel has kernel_fpu_* functions]) + AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions]) ],[ - AC_MSG_RESULT(no) + ZFS_LINUX_TRY_COMPILE([ + #include <linux/kernel.h> + #include <asm/fpu/api.h> + ],[ + __kernel_fpu_begin(); + __kernel_fpu_end(); + ],[ + AC_MSG_RESULT(__kernel_fpu_*) + AC_DEFINE(HAVE_UNDERSCORE_KERNEL_FPU, 1, [kernel has __kernel_fpu_* functions]) + AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1, [kernel exports FPU functions]) + ],[ + AC_MSG_RESULT(not exported) + ]) ]) ]) |