KVM: x86 emulator: use shadowed register in emulate_sysexit()
authorGleb Natapov <gleb@redhat.com>
Wed, 28 Apr 2010 16:15:41 +0000 (19:15 +0300)
committerAvi Kivity <avi@redhat.com>
Sun, 1 Aug 2010 07:35:36 +0000 (10:35 +0300)
emulate_sysexit() should use shadowed registers copy instead of
looking into vcpu state directly.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/emulate.c

index 291e220c69a5504328d96689dac9a553af9ff76d..42cb7d71ff55a0982c8f8b2c418ee8743e7d22fa 100644 (file)
@@ -2063,8 +2063,8 @@ emulate_sysexit(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops)
        ops->set_cached_descriptor(&ss, VCPU_SREG_SS, ctxt->vcpu);
        ops->set_segment_selector(ss_sel, VCPU_SREG_SS, ctxt->vcpu);
 
-       c->eip = ctxt->vcpu->arch.regs[VCPU_REGS_RDX];
-       c->regs[VCPU_REGS_RSP] = ctxt->vcpu->arch.regs[VCPU_REGS_RCX];
+       c->eip = c->regs[VCPU_REGS_RDX];
+       c->regs[VCPU_REGS_RSP] = c->regs[VCPU_REGS_RCX];
 
        return X86EMUL_CONTINUE;
 }