Skip to content

Commit e542baf

Browse files
committed
KVM: x86: fix uninitialized variable use on KVM_REQ_TRIPLE_FAULT
If a triple fault was fixed by kvm_x86_ops.nested_ops->triple_fault (by turning it into a vmexit), there is no need to leave vcpu_enter_guest(). Any vcpu->requests will be caught later before the actual vmentry, and in fact vcpu_enter_guest() was not initializing the "r" variable. Depending on the compiler's whims, this could cause the x86_64/triple_fault_event_test test to fail. Cc: Maxim Levitsky <[email protected]> Fixes: 92e7d5c ("KVM: x86: allow L1 to not intercept triple fault") Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 7e3bba9 commit e542baf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/x86.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10574,8 +10574,8 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu)
1057410574
vcpu->run->exit_reason = KVM_EXIT_SHUTDOWN;
1057510575
vcpu->mmio_needed = 0;
1057610576
r = 0;
10577+
goto out;
1057710578
}
10578-
goto out;
1057910579
}
1058010580
if (kvm_check_request(KVM_REQ_APF_HALT, vcpu)) {
1058110581
/* Page is swapped out. Do synthetic halt */

0 commit comments

Comments
 (0)