dst->thread.fpu_counter = 0;
dst->thread.fpu.has_fpu = 0;
- dst->thread.fpu.last_cpu = ~0;
dst->thread.fpu.state = NULL;
+ task_disable_lazy_fpu_restore(dst);
if (tsk_used_math(src)) {
int err = fpu_alloc(&dst->thread.fpu);
if (err)
flush_ptrace_hw_breakpoint(tsk);
memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
+
drop_init_fpu(tsk);
/*
* Free the FPU state for non xsave platforms. They get reallocated
*/
if (!use_eager_fpu())
free_thread_xstate(tsk);
+ else if (!used_math()) {
+ /* kthread execs. TODO: cleanup this horror. */
+ if (WARN_ON(init_fpu(current)))
+ force_sig(SIGKILL, current);
+ math_state_restore();
+ }
}
static void hard_disable_TSC(void)