aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/kernel-fpu.m415
-rw-r--r--include/os/linux/kernel/linux/simd_x86.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/config/kernel-fpu.m4 b/config/kernel-fpu.m4
index 4d6fe0522..faa64f1ec 100644
--- a/config/kernel-fpu.m4
+++ b/config/kernel-fpu.m4
@@ -2,6 +2,9 @@ dnl #
dnl # Handle differences in kernel FPU code.
dnl #
dnl # Kernel
+dnl # 5.16: XCR code put into asm/fpu/xcr.h
+dnl # HAVE_KERNEL_FPU_XCR_HEADER
+dnl #
dnl # 5.0: Wrappers have been introduced to save/restore the FPU state.
dnl # This change was made to the 4.19.38 and 4.14.120 LTS kernels.
dnl # HAVE_KERNEL_FPU_INTERNAL
@@ -25,6 +28,18 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU_HEADER], [
AC_DEFINE(HAVE_KERNEL_FPU_API_HEADER, 1,
[kernel has asm/fpu/api.h])
AC_MSG_RESULT(asm/fpu/api.h)
+ AC_MSG_CHECKING([whether fpu/xcr header is available])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/module.h>
+ #include <asm/fpu/xcr.h>
+ ],[
+ ],[
+ AC_DEFINE(HAVE_KERNEL_FPU_XCR_HEADER, 1,
+ [kernel has asm/fpu/xcr.h])
+ AC_MSG_RESULT(asm/fpu/xcr.h)
+ ],[
+ AC_MSG_RESULT(no asm/fpu/xcr.h)
+ ])
],[
AC_MSG_RESULT(i387.h & xcr.h)
])
diff --git a/include/os/linux/kernel/linux/simd_x86.h b/include/os/linux/kernel/linux/simd_x86.h
index cdd3286d2..f2ae0fcbc 100644
--- a/include/os/linux/kernel/linux/simd_x86.h
+++ b/include/os/linux/kernel/linux/simd_x86.h
@@ -88,6 +88,9 @@
#if defined(HAVE_KERNEL_FPU_API_HEADER)
#include <asm/fpu/api.h>
#include <asm/fpu/internal.h>
+#if defined(HAVE_KERNEL_FPU_XCR_HEADER)
+#include <asm/fpu/xcr.h>
+#endif
#else
#include <asm/i387.h>
#include <asm/xcr.h>