/* The vCPU has executed a HLT instruction with in-kernel mode enabled.  */
void kvm_vcpu_block(struct kvm_vcpu *vcpu)
/* The vCPU has executed a HLT instruction with in-kernel mode enabled.  */
void kvm_vcpu_block(struct kvm_vcpu *vcpu)
{
	DEFINE_WAIT(wait);
	for (;;) {
		prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);
		if (kvm_arch_vcpu_runnable(vcpu)) {
			set_bit(KVM_REQ_UNHALT, &vcpu->requests);
			break;
		}
		if (kvm_cpu_has_pending_timer(vcpu))
			break;
		if (signal_pending(current))
			break;
		schedule();
	}
	finish_wait(&vcpu->wq, &wait);
}