Skip to content

Commit 03bd520

Browse files
AttilaFueloepandrewc12
authored andcommitted
Linux 5.11 compat: x86 SIMD: fix kernel_fpu_{begin,end}() detection
Linux 5.11 changed kernel_fpu_begin() to an inlined function and moved the functionality to kernel_fpu_begin_mask(). This breaks the existing detection mechanism since it checks if kernel_fpu_begin is an exported kernel symbol, which isn't the case for an inlined function. To avoid assumptions about internal implementation, replace ZFS_LINUX_TEST_RESULT_SYMBOL in favor of ZFS_LINUX_TEST_RESULT which already makes sure kernel_fpu_{begin,end}() is usable by us. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Attila Fülöp <[email protected]> Closes openzfs#13147
1 parent 3a40d59 commit 03bd520

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

config/kernel-fpu.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ dnl #
88
dnl # XSTATE_XSAVE and XSTATE_XRESTORE aren't accessible any more
99
dnl # HAVE_KERNEL_FPU_XSAVE_INTERNAL
1010
dnl #
11+
dnl # 5.11: kernel_fpu_begin() is an inlined function now, so don't check
12+
dnl # for it inside the kernel symbols.
13+
dnl #
1114
dnl # 5.0: Wrappers have been introduced to save/restore the FPU state.
1215
dnl # This change was made to the 4.19.38 and 4.14.120 LTS kernels.
1316
dnl # HAVE_KERNEL_FPU_INTERNAL
@@ -147,8 +150,7 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
147150
dnl # Legacy kernel
148151
dnl #
149152
AC_MSG_CHECKING([whether kernel fpu is available])
150-
ZFS_LINUX_TEST_RESULT_SYMBOL([kernel_fpu_license],
151-
[kernel_fpu_begin], [arch/x86/kernel/fpu/core.c], [
153+
ZFS_LINUX_TEST_RESULT([kernel_fpu_license], [
152154
AC_MSG_RESULT(kernel_fpu_*)
153155
AC_DEFINE(HAVE_KERNEL_FPU, 1,
154156
[kernel has kernel_fpu_* functions])

0 commit comments

Comments
 (0)