Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172304
b: refs/heads/master
c: d255f4f
h: refs/heads/master
v: v3
  • Loading branch information
Zhai, Edwin authored and Avi Kivity committed Dec 3, 2009
1 parent 2cec686 commit 804ed86
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d36f19e9ecd22dc035ef4cc6361b564be650f8e7
refs/heads/master: d255f4f2bac81eb798fcf76938147f1f6c756ae2
1 change: 1 addition & 0 deletions trunk/include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
void mark_page_dirty(struct kvm *kvm, gfn_t gfn);

void kvm_vcpu_block(struct kvm_vcpu *vcpu);
void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
void kvm_resched(struct kvm_vcpu *vcpu);
void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
Expand Down
15 changes: 15 additions & 0 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,21 @@ void kvm_resched(struct kvm_vcpu *vcpu)
}
EXPORT_SYMBOL_GPL(kvm_resched);

void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu)
{
ktime_t expires;
DEFINE_WAIT(wait);

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

/* Sleep for 100 us, and hope lock-holder got scheduled */
expires = ktime_add_ns(ktime_get(), 100000UL);
schedule_hrtimeout(&expires, HRTIMER_MODE_ABS);

finish_wait(&vcpu->wq, &wait);
}
EXPORT_SYMBOL_GPL(kvm_vcpu_on_spin);

static int kvm_vcpu_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
struct kvm_vcpu *vcpu = vma->vm_file->private_data;
Expand Down

0 comments on commit 804ed86

Please sign in to comment.