summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-04-28 19:15:39 +0300
committerAvi Kivity <avi@redhat.com>2010-08-01 10:35:35 +0300
commit95c5588652f7742a21c33d9dcce0e043e057d04f (patch)
tree6f948ccbb9e8996d2af5890ecee32b31db72877c /arch/x86/kvm/x86.c
parent3457e4192e367fd4e0da5e9f46f9df85fa99cd11 (diff)
KVM: x86 emulator: advance RIP outside x86 emulator code
Return new RIP as part of instruction emulation result instead of updating KVM's RIP from x86 emulator code. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 9e5a833f3392..8f45cc712dda 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3941,6 +3941,7 @@ restart:
shadow_mask = vcpu->arch.emulate_ctxt.interruptibility;
kvm_x86_ops->set_interrupt_shadow(vcpu, shadow_mask);
+ kvm_rip_write(vcpu, vcpu->arch.emulate_ctxt.eip);
if (vcpu->arch.pio.count) {
if (!vcpu->arch.pio.in)
@@ -4945,6 +4946,7 @@ int kvm_task_switch(struct kvm_vcpu *vcpu, u16 tss_selector, int reason,
if (ret)
return EMULATE_FAIL;
+ kvm_rip_write(vcpu, vcpu->arch.emulate_ctxt.eip);
kvm_x86_ops->set_rflags(vcpu, vcpu->arch.emulate_ctxt.eflags);
return EMULATE_DONE;
}