Merge branch 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / x86 / kernel / traps.c
index cfbe3fc..8276dc6 100644 (file)
@@ -628,11 +628,12 @@ void math_state_restore(void)
        }
 
        __thread_fpu_begin(tsk);
+
        /*
         * Paranoid restore. send a SIGSEGV if we fail to restore the state.
         */
        if (unlikely(restore_fpu_checking(tsk))) {
-               __thread_fpu_end(tsk);
+               drop_init_fpu(tsk);
                force_sig(SIGSEGV, tsk);
                return;
        }
@@ -645,6 +646,8 @@ dotraplinkage void __kprobes
 do_device_not_available(struct pt_regs *regs, long error_code)
 {
        exception_enter(regs);
+       BUG_ON(use_eager_fpu());
+
 #ifdef CONFIG_MATH_EMULATION
        if (read_cr0() & X86_CR0_EM) {
                struct math_emu_info info = { };