KVM: x86: Do not update EFLAGS on faulting emulation
If the emulation ends in fault, eflags should not be updated. However, several instruction emulations (actually all the fastops) currently update eflags, if the fault was detected afterwards (e.g., #PF during writeback). Signed-off-by: Nadav Amit <namit@cs.technion.ac.il> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>pull/263/head
parent
9d88fca71a
commit
38827dbd3f
|
|
@ -5360,6 +5360,8 @@ restart:
|
||||||
kvm_rip_write(vcpu, ctxt->eip);
|
kvm_rip_write(vcpu, ctxt->eip);
|
||||||
if (r == EMULATE_DONE)
|
if (r == EMULATE_DONE)
|
||||||
kvm_vcpu_check_singlestep(vcpu, rflags, &r);
|
kvm_vcpu_check_singlestep(vcpu, rflags, &r);
|
||||||
|
if (!ctxt->have_exception ||
|
||||||
|
exception_type(ctxt->exception.vector) == EXCPT_TRAP)
|
||||||
__kvm_set_rflags(vcpu, ctxt->eflags);
|
__kvm_set_rflags(vcpu, ctxt->eflags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue