diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8ad9c75e731dd8559e45b37ba45f44c05d8b4ea0..7924ec1ac491aae6ae37245a83f47ec601ba788d 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2805,7 +2805,8 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) goto out; } poll_end = cur = ktime_get(); - } while (single_task_running() && ktime_before(cur, stop)); + } while (single_task_running() && !need_resched() && + ktime_before(cur, stop)); } prepare_to_rcuwait(&vcpu->wait);