diff options
-rw-r--r-- | drivers/kvm/kvm_main.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index 7aeaaba79c54..5b42731beba4 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -693,10 +693,13 @@ void fx_init(struct kvm_vcpu *vcpu) | |||
693 | 693 | ||
694 | } *fx_image; | 694 | } *fx_image; |
695 | 695 | ||
696 | /* Initialize guest FPU by resetting ours and saving into guest's */ | ||
697 | preempt_disable(); | ||
696 | fx_save(vcpu->host_fx_image); | 698 | fx_save(vcpu->host_fx_image); |
697 | fpu_init(); | 699 | fpu_init(); |
698 | fx_save(vcpu->guest_fx_image); | 700 | fx_save(vcpu->guest_fx_image); |
699 | fx_restore(vcpu->host_fx_image); | 701 | fx_restore(vcpu->host_fx_image); |
702 | preempt_enable(); | ||
700 | 703 | ||
701 | fx_image = (struct fx_image_s *)vcpu->guest_fx_image; | 704 | fx_image = (struct fx_image_s *)vcpu->guest_fx_image; |
702 | fx_image->mxcsr = 0x1f80; | 705 | fx_image->mxcsr = 0x1f80; |