Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 38827dbd authored by Nadav Amit's avatar Nadav Amit Committed by Paolo Bonzini
Browse files

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: default avatarNadav Amit <namit@cs.technion.ac.il>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 9d88fca7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -5360,6 +5360,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,
		kvm_rip_write(vcpu, ctxt->eip);
		if (r == EMULATE_DONE)
			kvm_vcpu_check_singlestep(vcpu, rflags, &r);
		if (!ctxt->have_exception ||
		    exception_type(ctxt->exception.vector) == EXCPT_TRAP)
			__kvm_set_rflags(vcpu, ctxt->eflags);

		/*