Skip to content

Commit

Permalink
x86/fpu: Use restore_init_xstate() instead of math_state_restore() on…
Browse files Browse the repository at this point in the history
… kthread exec

Change flush_thread() to do user_fpu_begin() and restore_init_xstate()
instead of math_state_restore().

Note: "TODO: cleanup this horror" is still valid. We do not need
init_fpu() at all, we only need fpu_alloc() and memset(0). But this
needs other changes, in particular user_fpu_begin() should set
used_math().

Signed-off-by: Oleg Nesterov <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Cc: Andy Lutomirski <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Pekka Riikonen <[email protected]>
Cc: Quentin Casasnovas <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Suresh Siddha <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
oleg-nesterov authored and Ingo Molnar committed Mar 23, 2015
1 parent 8f4d818 commit 9cb6ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ void flush_thread(void)
/* kthread execs. TODO: cleanup this horror. */
if (WARN_ON(init_fpu(current)))
force_sig(SIGKILL, current);
math_state_restore();
user_fpu_begin();
restore_init_xstate();
}
}

Expand Down

0 comments on commit 9cb6ce8

Please sign in to comment.