|
|
@@ -132,17 +132,14 @@ void flush_thread(void)
|
|
|
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
|
|
|
- * lazily at the first use.
|
|
|
- */
|
|
|
- if (!use_eager_fpu())
|
|
|
+ if (!use_eager_fpu()) {
|
|
|
+ /* FPU state will be reallocated lazily at the first use. */
|
|
|
+ drop_fpu(tsk);
|
|
|
free_thread_xstate(tsk);
|
|
|
- else if (!used_math()) {
|
|
|
+ } else if (!used_math()) {
|
|
|
/* kthread execs. TODO: cleanup this horror. */
|
|
|
- if (WARN_ON(init_fpu(current)))
|
|
|
- force_sig(SIGKILL, current);
|
|
|
+ if (WARN_ON(init_fpu(tsk)))
|
|
|
+ force_sig(SIGKILL, tsk);
|
|
|
user_fpu_begin();
|
|
|
restore_init_xstate();
|
|
|
}
|