x86/fpu: Change math_error() to use unlazy_fpu(), kill (now) unused save_init_fpu()
authorOleg Nesterov <oleg@redhat.com>
Fri, 6 Feb 2015 20:02:00 +0000 (15:02 -0500)
committerBorislav Petkov <bp@suse.de>
Thu, 19 Feb 2015 10:15:03 +0000 (11:15 +0100)
commit08a744c6bfded3d5fa66f94263f81773226113d1
treea32ef7c2c947b7331eeb52480948ce41e6fa8431
parent1a2a7f4ec8e3a7ac582dac4d01fcc7e8acd3bb30
x86/fpu: Change math_error() to use unlazy_fpu(), kill (now) unused save_init_fpu()

math_error() calls save_init_fpu() after conditional_sti(), this means
that the caller can be preempted. If !use_eager_fpu() we can hit the
WARN_ON_ONCE(!__thread_has_fpu(tsk)) and/or save the wrong FPU state.

Change math_error() to use unlazy_fpu() and kill save_init_fpu().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Rik van Riel <riel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1423252925-14451-4-git-send-email-riel@redhat.com
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/include/asm/fpu-internal.h
arch/x86/kernel/traps.c