aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/traps.c')
-rw-r--r--arch/x86/kernel/traps.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index c74f2f5652da..9d2073e2ecc9 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -859,18 +859,16 @@ void math_state_restore(void)
859 local_irq_disable(); 859 local_irq_disable();
860 } 860 }
861 861
862 /* Avoid __kernel_fpu_begin() right after __thread_fpu_begin() */
863 kernel_fpu_disable();
862 __thread_fpu_begin(tsk); 864 __thread_fpu_begin(tsk);
863
864 /*
865 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
866 */
867 if (unlikely(restore_fpu_checking(tsk))) { 865 if (unlikely(restore_fpu_checking(tsk))) {
868 drop_init_fpu(tsk); 866 drop_init_fpu(tsk);
869 force_sig_info(SIGSEGV, SEND_SIG_PRIV, tsk); 867 force_sig_info(SIGSEGV, SEND_SIG_PRIV, tsk);
870 return; 868 } else {
869 tsk->thread.fpu_counter++;
871 } 870 }
872 871 kernel_fpu_enable();
873 tsk->thread.fpu_counter++;
874} 872}
875EXPORT_SYMBOL_GPL(math_state_restore); 873EXPORT_SYMBOL_GPL(math_state_restore);
876 874