Skip to content

Commit 4e3e676

Browse files
committed
hosts/arael: kernel patch for GPL kernel_neon_ APIs
https://github.com/jakubgs/nixos-nanopi-r6c/issues/1 Mic92/nixpkgs@fb89d2b openzfs/zfs#14555 Signed-off-by: Jakub Sokołowski <[email protected]>
1 parent 8460f80 commit 4e3e676

File tree

3 files changed

+46
-5
lines changed

3 files changed

+46
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From aaeca98456431a8d9382ecf48ac4843e252c07b3 Mon Sep 17 00:00:00 2001
2+
From: Mark Brown <[email protected]>
3+
Date: Mon, 7 Nov 2022 17:07:47 +0000
4+
Subject: [PATCH] arm64/fpsimd: Make kernel_neon_ API _GPL
5+
6+
Currently for reasons lost in the mists of time the kernel_neon_ APIs are
7+
EXPORT_SYMBOL() but the general policy for floating point usage is that it
8+
should be GPL only given the non-standard runtime environment that holds
9+
while it is in use and PCS impacts when code is compiled for FP usage.
10+
11+
Given the limited existing deployment of non-GPL modules for arm64 and the
12+
fact that other architectures like x86 already make their equivalent
13+
functions GPL only this is not expected to be disruptive to existing users.
14+
15+
Suggested-by: Christoph Hellwig <[email protected]>
16+
Signed-off-by: Mark Brown <[email protected]>
17+
Link: https://lore.kernel.org/r/[email protected]
18+
Signed-off-by: Will Deacon <[email protected]>
19+
---
20+
arch/arm64/kernel/fpsimd.c | 4 ++--
21+
1 file changed, 2 insertions(+), 2 deletions(-)
22+
23+
diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
24+
index 23834d96d1e781..1fe7d65096ac66 100644
25+
--- a/arch/arm64/kernel/fpsimd.c
26+
+++ b/arch/arm64/kernel/fpsimd.c
27+
@@ -1838,7 +1838,7 @@ void kernel_neon_begin(void)
28+
/* Invalidate any task state remaining in the fpsimd regs: */
29+
fpsimd_flush_cpu_state();
30+
}
31+
-EXPORT_SYMBOL(kernel_neon_begin);
32+
+EXPORT_SYMBOL_GPL(kernel_neon_begin);
33+
34+
/*
35+
* kernel_neon_end(): give the CPU FPSIMD registers back to the current task
36+
@@ -1856,7 +1856,7 @@ void kernel_neon_end(void)
37+
38+
put_cpu_fpsimd_context();
39+
}
40+
-EXPORT_SYMBOL(kernel_neon_end);
41+
+EXPORT_SYMBOL_GPL(kernel_neon_end);
42+
43+
#ifdef CONFIG_EFI
44+

hosts/arael/kernel_vanilla_6_3.nix

+2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ buildLinux (args // rec {
1717
kernelPatches = [
1818
{ name = "nanopi_r6s_rk3588s";
1919
patch = ./nanopi_r6s_rk3588s.patch; }
20+
{ name = "export_neon_symbols_as_gpl";
21+
patch = ./export_neon_symbols_as_gpl.patch; }
2022
];
2123
} // (args.argsOverride or { }))

hosts/arael/sd-image.nix

-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ in {
3939
services.sshd.enable = true;
4040
networking.firewall.enable = false;
4141

42-
# ZFS "GPL-incompatible module" fix:
43-
# https://github.com/NixOS/nixpkgs/pull/237875
44-
# https://github.com/openzfs/zfs/issues/14555
45-
boot.zfs.removeLinuxDRM = true;
46-
4742
# root autologin etc
4843
users.users.root.password = "root";
4944
services.openssh.settings.PermitRootLogin = lib.mkDefault "yes";

0 commit comments

Comments
 (0)