summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov2010-04-15 11:29:50 +0200
committerAvi Kivity2010-05-17 11:17:49 +0200
commit19d04437267f00c7b50343513693b7a3174ff908 (patch)
tree004f50464c662ee472b03149678bc3ca8af461c8 /arch/x86/kvm/x86.c
parentKVM: MMU: Replace role.glevels with role.cr4_pae (diff)
downloadkernel-qcow2-linux-19d04437267f00c7b50343513693b7a3174ff908.tar.gz
kernel-qcow2-linux-19d04437267f00c7b50343513693b7a3174ff908.tar.xz
kernel-qcow2-linux-19d04437267f00c7b50343513693b7a3174ff908.zip
KVM: fix emulator_task_switch() return value.
emulator_task_switch() should return -1 for failure and 0 for success to the caller, just like x86_emulate_insn() does. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 58a295c6bf62..30efeead4511 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4800,10 +4800,11 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason,
tss_selector, reason, has_error_code,
error_code);
- if (ret == X86EMUL_CONTINUE)
- kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);
+ if (ret)
+ return EMULATE_FAIL;
- return (ret != X86EMUL_CONTINUE);
+ kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);
+ return EMULATE_DONE;
}
EXPORT_SYMBOL_GPL(kvm_task_switch);