aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorShengqi Chen <[email protected]>2024-01-09 08:05:24 +0800
committerGitHub <[email protected]>2024-01-08 16:05:24 -0800
commit7b89149c9f120e2fb1c08e7f903a0c671340fabd (patch)
treed8b3b97562995f90e6e1799bdc18a9c80b5af9df /config
parent07e95b4670dc421ec726a2b4efa97a22fe572005 (diff)
Linux 6.2 compat: add check for kernel_neon_* availability
This patch adds check for `kernel_neon_*` symbols on arm and arm64 platforms to address the following issues: 1. Linux 6.2+ on arm64 has exported them with `EXPORT_SYMBOL_GPL`, so license compatibility must be checked before use. 2. On both arm and arm64, the definitions of these symbols are guarded by `CONFIG_KERNEL_MODE_NEON`, but their declarations are still present. Checking in configuration phase only leads to MODPOST errors (undefined references). Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Shengqi Chen <[email protected]> Closes #15711 Closes #14555 Closes: #15401
Diffstat (limited to 'config')
-rw-r--r--config/kernel-fpu.m423
1 files changed, 20 insertions, 3 deletions
diff --git a/config/kernel-fpu.m4 b/config/kernel-fpu.m4
index c6efebd8c..edfde1a02 100644
--- a/config/kernel-fpu.m4
+++ b/config/kernel-fpu.m4
@@ -79,6 +79,12 @@ AC_DEFUN([ZFS_AC_KERNEL_SRC_FPU], [
__kernel_fpu_end();
], [], [ZFS_META_LICENSE])
+ ZFS_LINUX_TEST_SRC([kernel_neon], [
+ #include <asm/neon.h>
+ ], [
+ kernel_neon_begin();
+ kernel_neon_end();
+ ], [], [ZFS_META_LICENSE])
])
AC_DEFUN([ZFS_AC_KERNEL_FPU], [
@@ -105,9 +111,20 @@ AC_DEFUN([ZFS_AC_KERNEL_FPU], [
AC_DEFINE(KERNEL_EXPORTS_X86_FPU, 1,
[kernel exports FPU functions])
],[
- AC_MSG_RESULT(internal)
- AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
- [kernel fpu internal])
+ dnl #
+ dnl # ARM neon symbols (only on arm and arm64)
+ dnl # could be GPL-only on arm64 after Linux 6.2
+ dnl #
+ ZFS_LINUX_TEST_RESULT([kernel_neon_license],[
+ AC_MSG_RESULT(kernel_neon_*)
+ AC_DEFINE(HAVE_KERNEL_NEON, 1,
+ [kernel has kernel_neon_* functions])
+ ],[
+ # catch-all
+ AC_MSG_RESULT(internal)
+ AC_DEFINE(HAVE_KERNEL_FPU_INTERNAL, 1,
+ [kernel fpu internal])
+ ])
])
])
])