Skip to content

Commit

Permalink
linux: update fpu patches for 5.3
Browse files Browse the repository at this point in the history
At the moment we experience bad instabilities with linux 5.3:

openzfs/zfs#9346

as the zfs-native method of disabling the FPU is buggy.

(cherry picked from commit 96097ab)
  • Loading branch information
Mic92 committed Feb 13, 2020
1 parent 2633e93 commit 451e319
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 1e010beda2896bdf3082fb37a3e49f8ce20e04d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <[email protected]>
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 <[email protected]>
---
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

10 changes: 8 additions & 2 deletions pkgs/os-specific/linux/kernel/patches.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@
};

export_kernel_fpu_functions = {
name = "export_kernel_fpu_functions";
patch = ./export_kernel_fpu_functions.patch;
"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
Expand Down
9 changes: 6 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15747,21 +15747,24 @@ in
# when adding a new linux version
kernelPatches.cpu-cgroup-v2."4.11"
kernelPatches.modinst_arg_list_too_long
kernelPatches.export_kernel_fpu_functions
kernelPatches.export_kernel_fpu_functions."4.14"
];
};

linux_4_19 = callPackage ../os-specific/linux/kernel/linux-4.19.nix {
kernelPatches =
[ kernelPatches.bridge_stp_helper
kernelPatches.modinst_arg_list_too_long
kernelPatches.export_kernel_fpu_functions
kernelPatches.export_kernel_fpu_functions."4.14"
];
};

# Update this when adding the newest kernel major version!
linux_latest = callPackage ../os-specific/linux/kernel/linux-5.4.nix {
kernelPatches = [ kernelPatches.bridge_stp_helper ];
kernelPatches = [
kernelPatches.bridge_stp_helper
kernelPatches.export_kernel_fpu_functions."5.3"
];
};

linux_testing = callPackage ../os-specific/linux/kernel/linux-testing.nix {
Expand Down

0 comments on commit 451e319

Please sign in to comment.