x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal()
[platform/adaptation/renesas_rcar/renesas_kernel.git] / arch / x86 / kernel / signal.c
index 9e5de68..b88fc86 100644 (file)
@@ -673,6 +673,11 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs)
                 * handler too.
                 */
                regs->flags &= ~(X86_EFLAGS_DF|X86_EFLAGS_RF|X86_EFLAGS_TF);
+               /*
+                * Ensure the signal handler starts with the new fpu state.
+                */
+               if (used_math())
+                       drop_init_fpu(current);
        }
        signal_setup_done(failed, ksig, test_thread_flag(TIF_SINGLESTEP));
 }