summaryrefslogtreecommitdiffstats
path: root/virt/kvm/async_pf.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-10-14 11:22:50 +0200
committerAvi Kivity <avi@redhat.com>2011-01-12 11:23:12 +0200
commit344d9588a9df06182684168be4f1408b55c7da3e (patch)
tree16890e3f0f10ac767265e650a1d6d38b78780040 /virt/kvm/async_pf.c
parentca3f10172eea9b95bbb66487656f3c3e93855702 (diff)
downloadlinux-stable-344d9588a9df06182684168be4f1408b55c7da3e.tar.gz
linux-stable-344d9588a9df06182684168be4f1408b55c7da3e.tar.bz2
linux-stable-344d9588a9df06182684168be4f1408b55c7da3e.zip
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/kvm/async_pf.c')
-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:
kmem_cache_free(async_pf_cache, work);
return 0;
}
+
+int kvm_async_pf_wakeup_all(struct kvm_vcpu *vcpu)
+{
+ struct kvm_async_pf *work;
+
+ if (!list_empty(&vcpu->async_pf.done))
+ return 0;
+
+ work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC);
+ if (!work)
+ return -ENOMEM;
+
+ work->page = bad_page;
+ get_page(bad_page);
+ INIT_LIST_HEAD(&work->queue); /* for list_del to work */
+
+ list_add_tail(&work->link, &vcpu->async_pf.done);
+ vcpu->async_pf.queued++;
+ return 0;
+}