[PATCH nixpkgs 1/4] kernelPatches: drop export_kernel_fpu_functions

Alyssa Ross
2021-06-03T09:12:17Z

From: Atemu <atemu.main@gmail.com>

Hasn't been necessary since ZFS 0.8.3

(cherry picked from commit 88f877e07def90a2c77106b86802b143ca8f97b3)

Backporting this for Spectrum because it won't apply to future CrOS
kernels.
---
.../export_kernel_fpu_functions_4_14.patch | 60 -------------------
.../export_kernel_fpu_functions_5_3.patch | 42 -------------
pkgs/os-specific/linux/kernel/patches.nix | 11 ----
pkgs/top-level/all-packages.nix | 6 --
4 files changed, 119 deletions(-)
delete mode 100644 pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_4_14.patch
delete mode 100644 pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch

diff --git a/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_4_14.patch b/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_4_14.patch
deleted file mode 100644
index 205497aee2d..00000000000
--- a/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_4_14.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 245e0f743d814c9ff2d1c748175e321301eb16cf Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
-Date: Thu, 2 May 2019 05:28:08 +0100
-Subject: [PATCH] x86/fpu: Export __kernel_fpu_{begin,end}()
-
-This partially undo commit:
-
-12209993 x86/fpu: Don't export __kernel_fpu_{begin,end}()
-
-We need this symbol in zfs for AES-NI/AVX support.
----
- arch/x86/include/asm/fpu/api.h | 2 ++
- arch/x86/kernel/fpu/core.c | 6 ++++--
- 2 files changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h
-index b56d504af6545..7d53388d266ea 100644
---- a/arch/x86/include/asm/fpu/api.h
-+++ b/arch/x86/include/asm/fpu/api.h
-@@ -18,6 +18,8 @@
- * If you intend to use the FPU in softirq you need to check first with
- * irq_fpu_usable() if it is possible.
- */
-+extern void __kernel_fpu_begin(void);
-+extern void __kernel_fpu_end(void);
- extern void kernel_fpu_begin(void);
- extern void kernel_fpu_end(void);
- extern bool irq_fpu_usable(void);
-diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
-index 2e5003fef51a9..2ea85b32421a0 100644
---- a/arch/x86/kernel/fpu/core.c
-+++ b/arch/x86/kernel/fpu/core.c
-@@ -93,7 +93,7 @@ bool irq_fpu_usable(void)
- }
- EXPORT_SYMBOL(irq_fpu_usable);
-
--static void __kernel_fpu_begin(void)
-+void __kernel_fpu_begin(void)
- {
- struct fpu *fpu = &current->thread.fpu;
-
-@@ -111,8 +111,9 @@ static void __kernel_fpu_begin(void)
- __cpu_invalidate_fpregs_state();
- }
- }
-+EXPORT_SYMBOL(__kernel_fpu_begin);
-
--static void __kernel_fpu_end(void)
-+void __kernel_fpu_end(void)
- {
- struct fpu *fpu = &current->thread.fpu;
-
-@@ -121,6 +122,7 @@ static void __kernel_fpu_end(void)
-
- kernel_fpu_enable();
- }
-+EXPORT_SYMBOL(__kernel_fpu_end);
-
- void kernel_fpu_begin(void)
- {
diff --git a/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch b/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch
deleted file mode 100644
index dc9ca64bdc1..00000000000
--- a/pkgs/os-specific/linux/kernel/export_kernel_fpu_functions_5_3.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 1e010beda2896bdf3082fb37a3e49f8ce20e04d8 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
-Date: Thu, 2 May 2019 05:28:08 +0100
-Subject: [PATCH] x86/fpu: Export kernel_fpu_{begin,end}() with
- EXPORT_SYMBOL_GPL
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-We need these symbols in zfs as the fpu implementation breaks userspace:
-
-https://github.com/zfsonlinux/zfs/issues/9346
-Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
----
- arch/x86/kernel/fpu/core.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
-index 12c70840980e..352538b3bb5d 100644
---- a/arch/x86/kernel/fpu/core.c
-+++ b/arch/x86/kernel/fpu/core.c
-@@ -102,7 +102,7 @@ void kernel_fpu_begin(void)
- }
- __cpu_invalidate_fpregs_state();
- }
--EXPORT_SYMBOL_GPL(kernel_fpu_begin);
-+EXPORT_SYMBOL(kernel_fpu_begin);
-
- void kernel_fpu_end(void)
- {
-@@ -111,7 +111,7 @@ void kernel_fpu_end(void)
- this_cpu_write(in_kernel_fpu, false);
- preempt_enable();
- }
--EXPORT_SYMBOL_GPL(kernel_fpu_end);
-+EXPORT_SYMBOL(kernel_fpu_end);
-
- /*
- * Save the FPU state (mark it for reload if necessary):
---
-2.23.0
-
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index 8ce1ac2b587..678cec34b70 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -76,17 +76,6 @@
};
};

- export_kernel_fpu_functions = {
- "4.14" = {
- name = "export_kernel_fpu_functions";
- patch = ./export_kernel_fpu_functions_4_14.patch;
- };
- "5.3" = {
- name = "export_kernel_fpu_functions";
- patch = ./export_kernel_fpu_functions_5_3.patch;
- };
- };
-
# patches from https://lkml.org/lkml/2019/7/15/1748
mac_nvme_t2 = rec {
name = "mac_nvme_t2";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index c22a62456db..6ba0505cb8a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -17500,7 +17500,6 @@ in
# when adding a new linux version
kernelPatches.cpu-cgroup-v2."4.11"
kernelPatches.modinst_arg_list_too_long
- kernelPatches.export_kernel_fpu_functions."4.14"
];
};

@@ -17509,7 +17508,6 @@ in
[ kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
kernelPatches.modinst_arg_list_too_long
- kernelPatches.export_kernel_fpu_functions."4.14"
];
};

@@ -17517,7 +17515,6 @@ in
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
- kernelPatches.export_kernel_fpu_functions."5.3"
];
};

@@ -17525,7 +17522,6 @@ in
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
- kernelPatches.export_kernel_fpu_functions."5.3"
];
};

@@ -17533,7 +17529,6 @@ in
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
- kernelPatches.export_kernel_fpu_functions."5.3"
];
};

@@ -17563,7 +17558,6 @@ in
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.request_key_helper
- kernelPatches.export_kernel_fpu_functions."5.3"
];
};

--
2.31.1