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>
This commit is contained in:

committato da
Avi Kivity

parent
4487b3b48d
commit
71f9833bb1
@@ -4423,7 +4423,7 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu)
|
||||
vcpu->arch.emulate_regs_need_sync_from_vcpu = false;
|
||||
}
|
||||
|
||||
int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq)
|
||||
int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip)
|
||||
{
|
||||
struct decode_cache *c = &vcpu->arch.emulate_ctxt.decode;
|
||||
int ret;
|
||||
@@ -4432,7 +4432,8 @@ int kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq)
|
||||
|
||||
vcpu->arch.emulate_ctxt.decode.op_bytes = 2;
|
||||
vcpu->arch.emulate_ctxt.decode.ad_bytes = 2;
|
||||
vcpu->arch.emulate_ctxt.decode.eip = vcpu->arch.emulate_ctxt.eip;
|
||||
vcpu->arch.emulate_ctxt.decode.eip = vcpu->arch.emulate_ctxt.eip +
|
||||
inc_eip;
|
||||
ret = emulate_int_real(&vcpu->arch.emulate_ctxt, &emulate_ops, irq);
|
||||
|
||||
if (ret != X86EMUL_CONTINUE)
|
||||
|
Fai riferimento in un nuovo problema
Block a user