diff options
author | Serge E. Hallyn <serge@hallyn.com> | 2011-04-13 10:12:54 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-05-11 07:57:09 -0400 |
commit | 71f9833bb1cba9939245f3e57388d87d69f8f399 (patch) | |
tree | 763f0afa1ad42902549d5484bc565e10a0a4683b /arch/x86/kvm/x86.c | |
parent | 4487b3b48d8fa3f6a5dd4155c9e34d5e998ad7fe (diff) |
KVM: fix push of wrong eip when doing softint
When doing a soft int, we need to bump eip before pushing it to
the stack. Otherwise we'll do the int a second time.
[apw@canonical.com: merged eip update as per Jan's recommendation.]
Signed-off-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 3416a3473849..b05e3fcce298 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4423,7 +4423,7 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu) | |||
4423 | vcpu->arch.emulate_regs_need_sync_from_vcpu = false; | 4423 | vcpu->arch.emulate_regs_need_sync_from_vcpu = false; |
4424 | } | 4424 | } |
4425 | 4425 | ||
4426 | int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq) | 4426 | int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip) |
4427 | { | 4427 | { |
4428 | struct decode_cache *c = &vcpu->arch.emulate_ctxt.decode; | 4428 | struct decode_cache *c = &vcpu->arch.emulate_ctxt.decode; |
4429 | int ret; | 4429 | int ret; |
@@ -4432,7 +4432,8 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq) | |||
4432 | 4432 | ||
4433 | vcpu->arch.emulate_ctxt.decode.op_bytes = 2; | 4433 | vcpu->arch.emulate_ctxt.decode.op_bytes = 2; |
4434 | vcpu->arch.emulate_ctxt.decode.ad_bytes = 2; | 4434 | vcpu->arch.emulate_ctxt.decode.ad_bytes = 2; |
4435 | vcpu->arch.emulate_ctxt.decode.eip = vcpu->arch.emulate_ctxt.eip; | 4435 | vcpu->arch.emulate_ctxt.decode.eip = vcpu->arch.emulate_ctxt.eip + |
4436 | inc_eip; | ||
4436 | ret = emulate_int_real(&vcpu->arch.emulate_ctxt, &emulate_ops, irq); | 4437 | ret = emulate_int_real(&vcpu->arch.emulate_ctxt, &emulate_ops, irq); |
4437 | 4438 | ||
4438 | if (ret != X86EMUL_CONTINUE) | 4439 | if (ret != X86EMUL_CONTINUE) |