summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-01-21 15:31:45 +0200
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 12:36:03 -0300
commit2608d7a12fd4badfe2eac534150f0715a7fd3ff3 (patch)
tree98cccb92487d023e9519f323c91c090a43367510 /arch/x86
parentab344828ebe729e52949d64046adaa196f6b9dbe (diff)
downloadop-kernel-dev-2608d7a12fd4badfe2eac534150f0715a7fd3ff3.zip
op-kernel-dev-2608d7a12fd4badfe2eac534150f0715a7fd3ff3.tar.gz
KVM: Allow kvm_load_guest_fpu() even when !vcpu->fpu_active
This allows accessing the guest fpu from the instruction emulator, as well as being symmetric with kvm_put_guest_fpu(). Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/x86.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index ce267d9..4cf4eac 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4239,7 +4239,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
preempt_disable();
kvm_x86_ops->prepare_guest_switch(vcpu);
- kvm_load_guest_fpu(vcpu);
+ if (vcpu->fpu_active)
+ kvm_load_guest_fpu(vcpu);
local_irq_disable();
@@ -5285,7 +5286,7 @@ EXPORT_SYMBOL_GPL(fx_init);
void kvm_load_guest_fpu(struct kvm_vcpu *vcpu)
{
- if (!vcpu->fpu_active || vcpu->guest_fpu_loaded)
+ if (vcpu->guest_fpu_loaded)
return;
vcpu->guest_fpu_loaded = 1;
OpenPOWER on IntegriCloud