Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96921
b: refs/heads/master
c: e5c239c
h: refs/heads/master
i:
  96919: 3ec9341
v: v3
  • Loading branch information
Marcelo Tosatti authored and Avi Kivity committed May 18, 2008
1 parent 78f3a2e commit 04c5d0d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bd25ed033af52c8c054d43a9cce9c5976266ae74
refs/heads/master: e5c239cfd5b0ec22751c099dbf4d91f3c504a64f
29 changes: 15 additions & 14 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,25 +758,26 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
*/
void kvm_vcpu_block(struct kvm_vcpu *vcpu)
{
DECLARE_WAITQUEUE(wait, current);

add_wait_queue(&vcpu->wq, &wait);

/*
* We will block until either an interrupt or a signal wakes us up
*/
while (!kvm_cpu_has_interrupt(vcpu)
&& !kvm_cpu_has_pending_timer(vcpu)
&& !signal_pending(current)
&& !kvm_arch_vcpu_runnable(vcpu)) {
set_current_state(TASK_INTERRUPTIBLE);
DEFINE_WAIT(wait);

for (;;) {
prepare_to_wait(&vcpu->wq, &wait, TASK_INTERRUPTIBLE);

if (kvm_cpu_has_interrupt(vcpu))
break;
if (kvm_cpu_has_pending_timer(vcpu))
break;
if (kvm_arch_vcpu_runnable(vcpu))
break;
if (signal_pending(current))
break;

vcpu_put(vcpu);
schedule();
vcpu_load(vcpu);
}

__set_current_state(TASK_RUNNING);
remove_wait_queue(&vcpu->wq, &wait);
finish_wait(&vcpu->wq, &wait);
}

void kvm_resched(struct kvm_vcpu *vcpu)
Expand Down

0 comments on commit 04c5d0d

Please sign in to comment.