public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/, sys-fs/zfs-kmod/files/
Date: Mon, 29 Jan 2024 16:08:10 +0000 (UTC)	[thread overview]
Message-ID: <1706544478.1d106b3c4cc3d9d10e558558d4fbffbdf9c694ad.sam@gentoo> (raw)

commit:     1d106b3c4cc3d9d10e558558d4fbffbdf9c694ad
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 29 16:07:58 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 29 16:07:58 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d106b3c

sys-fs/zfs-kmod: fix arm64 neon compat w/ >=linux-6.2

Closes: https://bugs.gentoo.org/904657
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch | 100 +++++++++++++++++++++
 sys-fs/zfs-kmod/zfs-kmod-2.2.2.ebuild              |   3 +-
 2 files changed, 102 insertions(+), 1 deletion(-)

diff --git a/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch
new file mode 100644
index 000000000000..54121adcdca3
--- /dev/null
+++ b/sys-fs/zfs-kmod/files/zfs-kmod-2.2.2-arm64-neon.patch
@@ -0,0 +1,100 @@
+https://bugs.gentoo.org/904657
+https://github.com/openzfs/zfs/issues/14555
+https://github.com/openzfs/zfs/commit/976bf9b6a61919638d42ed79cd207132785d128a
+
+From 976bf9b6a61919638d42ed79cd207132785d128a Mon Sep 17 00:00:00 2001
+From: Shengqi Chen <harry-chen@outlook.com>
+Date: Tue, 9 Jan 2024 08:05:24 +0800
+Subject: [PATCH] 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 <behlendorf1@llnl.gov>
+Signed-off-by: Shengqi Chen <harry-chen@outlook.com>
+Closes #15711
+Closes #14555
+Closes: #15401
+--- 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])
++			])
+ 		])
+ 	])
+ ])
+--- a/include/os/linux/kernel/linux/simd_aarch64.h
++++ b/include/os/linux/kernel/linux/simd_aarch64.h
+@@ -71,9 +71,15 @@
+ #define	ID_AA64PFR0_EL1		sys_reg(3, 0, 0, 1, 0)
+ #define	ID_AA64ISAR0_EL1	sys_reg(3, 0, 0, 6, 0)
+ 
++#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON))
+ #define	kfpu_allowed()		1
+ #define	kfpu_begin()		kernel_neon_begin()
+ #define	kfpu_end()		kernel_neon_end()
++#else
++#define	kfpu_allowed()		0
++#define	kfpu_begin()		do {} while (0)
++#define	kfpu_end()		do {} while (0)
++#endif
+ #define	kfpu_init()		(0)
+ #define	kfpu_fini()		do {} while (0)
+ 
+--- a/include/os/linux/kernel/linux/simd_arm.h
++++ b/include/os/linux/kernel/linux/simd_arm.h
+@@ -53,9 +53,15 @@
+ #include <asm/elf.h>
+ #include <asm/hwcap.h>
+ 
++#if (defined(HAVE_KERNEL_NEON) && defined(CONFIG_KERNEL_MODE_NEON))
+ #define	kfpu_allowed()		1
+ #define	kfpu_begin()		kernel_neon_begin()
+ #define	kfpu_end()		kernel_neon_end()
++#else
++#define	kfpu_allowed()		0
++#define	kfpu_begin()		do {} while (0)
++#define	kfpu_end()		do {} while (0)
++#endif
+ #define	kfpu_init()		(0)
+ #define	kfpu_fini()		do {} while (0)
+ 
+

diff --git a/sys-fs/zfs-kmod/zfs-kmod-2.2.2.ebuild b/sys-fs/zfs-kmod/zfs-kmod-2.2.2.ebuild
index 18f9e126cc32..863395ebfef3 100644
--- a/sys-fs/zfs-kmod/zfs-kmod-2.2.2.ebuild
+++ b/sys-fs/zfs-kmod/zfs-kmod-2.2.2.ebuild
@@ -60,6 +60,7 @@ PDEPEND="dist-kernel? ( ~sys-fs/zfs-${PV}[dist-kernel] )"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.1.11-gentoo.patch
+	"${FILESDIR}"/${PN}-2.2.2-arm64-neon.patch
 )
 
 pkg_pretend() {
@@ -103,7 +104,7 @@ pkg_setup() {
 			"Linux ${kv_major_max}.${kv_minor_max} is the latest supported version"
 	fi
 
-	linux-mod-r1_pkg_setup
+	#linux-mod-r1_pkg_setup
 }
 
 src_prepare() {


             reply	other threads:[~2024-01-29 16:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 16:08 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-05  6:16 [gentoo-commits] repo/gentoo:master commit in: sys-fs/zfs-kmod/, sys-fs/zfs-kmod/files/ Sam James
2024-02-06  1:50 Sam James
2023-12-28  3:43 Sam James
2023-11-24 21:53 Sam James
2023-07-03 21:03 Sam James
2023-05-30  2:51 Sam James
2022-10-04  5:07 Sam James
2022-09-17 22:16 Georgy Yakovlev
2022-03-22 18:01 Sam James
2021-12-20  5:19 Georgy Yakovlev
2021-11-11  2:22 Georgy Yakovlev
2021-11-07 23:59 Georgy Yakovlev
2021-07-02  8:31 Georgy Yakovlev
2021-06-09  5:20 Georgy Yakovlev
2021-06-04  2:14 Georgy Yakovlev
2020-12-18 20:04 Georgy Yakovlev
2020-09-21 23:04 Georgy Yakovlev
2020-09-07  4:04 Georgy Yakovlev
2020-03-30 21:08 Georgy Yakovlev
2019-05-29 22:15 Georgy Yakovlev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1706544478.1d106b3c4cc3d9d10e558558d4fbffbdf9c694ad.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox