From: Oleg Nesterov Date: Wed, 11 Mar 2015 17:34:49 +0000 (+0100) Subject: x86/fpu: Use restore_init_xstate() instead of math_state_restore() on kthread exec X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9cb6ce823bbd1adbe15e30bd1435c84c2e271767;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git x86/fpu: Use restore_init_xstate() instead of math_state_restore() on 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 Signed-off-by: Borislav Petkov Cc: Andy Lutomirski Cc: Dave Hansen Cc: Fenghua Yu Cc: Linus Torvalds Cc: Pekka Riikonen Cc: Quentin Casasnovas Cc: Rik van Riel Cc: Suresh Siddha Link: http://lkml.kernel.org/r/20150311173449.GE5032@redhat.com Signed-off-by: Ingo Molnar --- diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index dcaf4b00d0b4..6b058296a456 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -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(); } }