Skip to content

Commit f3020b8

Browse files
committed
x86/kvm: Use __xfer_to_guest_mode_work_pending() in kvm_run_vcpu()
The comments explicitely explain that the work flags check and handling in kvm_run_vcpu() is done with preemption and interrupts enabled as KVM invokes the check again right before entering guest mode with interrupts disabled which guarantees that the work flags are observed and handled before VMENTER. Nevertheless the flag pending check in kvm_run_vcpu() uses the helper variant which requires interrupts to be disabled triggering an instant lockdep splat. This was caught in testing before and then not fixed up in the patch before applying. :( Use the relaxed and intentionally racy __xfer_to_guest_mode_work_pending() instead. Fixes: 72c3c0f ("x86/kvm: Use generic xfer to guest work function") Reported-by: Qian Cai <[email protected]> writes: Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 72c3c0f commit f3020b8

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
@@ -8682,7 +8682,7 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
86828682
break;
86838683
}
86848684

8685-
if (xfer_to_guest_mode_work_pending()) {
8685+
if (__xfer_to_guest_mode_work_pending()) {
86868686
srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
86878687
r = xfer_to_guest_mode_handle_work(vcpu);
86888688
if (r)

0 commit comments

Comments
 (0)