aboutsummaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-10-14 05:22:50 -0400
committerAvi Kivity <avi@redhat.com>2011-01-12 04:23:12 -0500
commit344d9588a9df06182684168be4f1408b55c7da3e (patch)
tree16890e3f0f10ac767265e650a1d6d38b78780040 /virt
parentca3f10172eea9b95bbb66487656f3c3e93855702 (diff)
KVM: Add PV MSR to enable asynchronous page faults delivery.
Guest enables async PF vcpu functionality using this MSR. Reviewed-by: Rik van Riel <riel@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/async_pf.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/virt/kvm/async_pf.c b/virt/kvm/async_pf.c
index e97eae965a4c..1f59498561b2 100644
--- a/virt/kvm/async_pf.c
+++ b/virt/kvm/async_pf.c
@@ -190,3 +190,23 @@ retry_sync:
190 kmem_cache_free(async_pf_cache, work); 190 kmem_cache_free(async_pf_cache, work);
191 return 0; 191 return 0;
192} 192}
193
194int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu)
195{
196 struct kvm_async_pf *work;
197
198 if (!list_empty(&vcpu->async_pf.done))
199 return 0;
200
201 work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC);
202 if (!work)
203 return -ENOMEM;
204
205 work->page = bad_page;
206 get_page(bad_page);
207 INIT_LIST_HEAD(&work->queue); /* for list_del to work */
208
209 list_add_tail(&work->link, &vcpu->async_pf.done);
210 vcpu->async_pf.queued++;
211 return 0;
212}