KVM: Initialize fpu state in preemptible context
authorAvi Kivity <avi@redhat.com>
Tue, 11 Jan 2011 10:15:54 +0000 (12:15 +0200)
committerAvi Kivity <avi@redhat.com>
Wed, 12 Jan 2011 10:02:26 +0000 (12:02 +0200)
commite5c301428294cb8925667c9ee39f817c4ab1c2c9
tree6630b1e95e38287bcda12e40fbbc2d25cf551496
parent444e863d13373b958ec6b133dcecf140d6c6c2ab
KVM: Initialize fpu state in preemptible context

init_fpu() (which is indirectly called by the fpu switching code) assumes
it is in process context.  Rather than makeing init_fpu() use an atomic
allocation, which can cause a task to be killed, make sure the fpu is
already initialized when we enter the run loop.

KVM-Stable-Tag.
Reported-and-tested-by: Kirill A. Shutemov <kas@openvz.org>
Acked-by: Pekka Enberg <penberg@kernel.org>
Reviewed-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kernel/i387.c
arch/x86/kvm/x86.c