Commit d6533c15 authored by Sean Christopherson's avatar Sean Christopherson
Browse files

KVM: selftests: Check for a potential unhandled exception iff KVM_RUN succeeded



Don't check for an unhandled exception if KVM_RUN failed, e.g. if it
returned errno=EFAULT, as reporting unhandled exceptions is done via a
ucall, i.e. requires KVM_RUN to exit cleanly.  Theoretically, checking
for a ucall on a failed KVM_RUN could get a false positive, e.g. if there
were stale data in vcpu->run from a previous exit.

Reviewed-by: default avatarJames Houghton <jthoughton@google.com>
Reviewed-by: default avatarAndrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20241128005547.4077116-5-seanjc@google.com


Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
parent fe85ce31
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1648,6 +1648,7 @@ int _vcpu_run(struct kvm_vcpu *vcpu)
		rc = __vcpu_run(vcpu);
	} while (rc == -1 && errno == EINTR);

	if (!rc)
		assert_on_unhandled_exception(vcpu);

	return rc;