]> git.proxmox.com Git - zfsonlinux.git/blob - debian/patches/0008-SIMD-FPU-register-save-restore-is-also-required-on-5.patch
cherry-pick: Perform KABI checks in parallel
[zfsonlinux.git] / debian / patches / 0008-SIMD-FPU-register-save-restore-is-also-required-on-5.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 Date: Wed, 25 Sep 2019 10:48:48 +0200
4 Subject: [PATCH] [SIMD]: FPU register save/restore is also required on 5.0
5 kernels
6
7 NOTE: the kernel needs to have the copy_kernel_to_xregs_err,
8 copy_kernel_to_fxregs_err and copy_kernel_to_fregs_err functions
9 backported for this to work.
10
11 Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
12 ---
13 include/linux/simd_x86.h | 11 ++++-------
14 1 file changed, 4 insertions(+), 7 deletions(-)
15
16 diff --git a/include/linux/simd_x86.h b/include/linux/simd_x86.h
17 index edd456098..98503a29e 100644
18 --- a/include/linux/simd_x86.h
19 +++ b/include/linux/simd_x86.h
20 @@ -181,7 +181,6 @@ kfpu_begin(void)
21 preempt_disable();
22 local_irq_disable();
23
24 -#if defined(HAVE_KERNEL_TIF_NEED_FPU_LOAD)
25 /*
26 * The current FPU registers need to be preserved by kfpu_begin()
27 * and restored by kfpu_end(). This is required because we can
28 @@ -190,11 +189,11 @@ kfpu_begin(void)
29 * context switch.
30 */
31 copy_fpregs_to_fpstate(&current->thread.fpu);
32 -#elif defined(HAVE_KERNEL_FPU_INITIALIZED)
33 +
34 +
35 +#if defined(HAVE_KERNEL_FPU_INITIALIZED)
36 /*
37 - * There is no need to preserve and restore the FPU registers.
38 - * They will always be restored from the task's stored FPU state
39 - * when switching contexts.
40 + * Was removed with 5.2 as it was always set to 1 there
41 */
42 WARN_ON_ONCE(current->thread.fpu.initialized == 0);
43 #endif
44 @@ -203,7 +202,6 @@ kfpu_begin(void)
45 static inline void
46 kfpu_end(void)
47 {
48 -#if defined(HAVE_KERNEL_TIF_NEED_FPU_LOAD)
49 union fpregs_state *state = &current->thread.fpu.state;
50 int error;
51
52 @@ -215,7 +213,6 @@ kfpu_end(void)
53 error = copy_kernel_to_fregs_err(&state->fsave);
54 }
55 WARN_ON_ONCE(error);
56 -#endif
57
58 local_irq_enable();
59 preempt_enable();