Skip to content

Commit

Permalink
hosts/arael: kernel patch for GPL kernel_neon_ APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubgs committed Aug 23, 2023
1 parent 8460f80 commit 4e3e676
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
44 changes: 44 additions & 0 deletions hosts/arael/export_neon_symbols_as_gpl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From aaeca98456431a8d9382ecf48ac4843e252c07b3 Mon Sep 17 00:00:00 2001
From: Mark Brown <[email protected]>
Date: Mon, 7 Nov 2022 17:07:47 +0000
Subject: [PATCH] arm64/fpsimd: Make kernel_neon_ API _GPL

Currently for reasons lost in the mists of time the kernel_neon_ APIs are
EXPORT_SYMBOL() but the general policy for floating point usage is that it
should be GPL only given the non-standard runtime environment that holds
while it is in use and PCS impacts when code is compiled for FP usage.

Given the limited existing deployment of non-GPL modules for arm64 and the
fact that other architectures like x86 already make their equivalent
functions GPL only this is not expected to be disruptive to existing users.

Suggested-by: Christoph Hellwig <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
---
arch/arm64/kernel/fpsimd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c
index 23834d96d1e781..1fe7d65096ac66 100644
--- a/arch/arm64/kernel/fpsimd.c
+++ b/arch/arm64/kernel/fpsimd.c
@@ -1838,7 +1838,7 @@ void kernel_neon_begin(void)
/* Invalidate any task state remaining in the fpsimd regs: */
fpsimd_flush_cpu_state();
}
-EXPORT_SYMBOL(kernel_neon_begin);
+EXPORT_SYMBOL_GPL(kernel_neon_begin);

/*
* kernel_neon_end(): give the CPU FPSIMD registers back to the current task
@@ -1856,7 +1856,7 @@ void kernel_neon_end(void)

put_cpu_fpsimd_context();
}
-EXPORT_SYMBOL(kernel_neon_end);
+EXPORT_SYMBOL_GPL(kernel_neon_end);

#ifdef CONFIG_EFI

2 changes: 2 additions & 0 deletions hosts/arael/kernel_vanilla_6_3.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ buildLinux (args // rec {
kernelPatches = [
{ name = "nanopi_r6s_rk3588s";
patch = ./nanopi_r6s_rk3588s.patch; }
{ name = "export_neon_symbols_as_gpl";
patch = ./export_neon_symbols_as_gpl.patch; }
];
} // (args.argsOverride or { }))
5 changes: 0 additions & 5 deletions hosts/arael/sd-image.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ in {
services.sshd.enable = true;
networking.firewall.enable = false;

# ZFS "GPL-incompatible module" fix:
# https://github.com/NixOS/nixpkgs/pull/237875
# https://github.com/openzfs/zfs/issues/14555
boot.zfs.removeLinuxDRM = true;

# root autologin etc
users.users.root.password = "root";
services.openssh.settings.PermitRootLogin = lib.mkDefault "yes";
Expand Down

0 comments on commit 4e3e676

Please sign in to comment.