aboutsummaryrefslogtreecommitdiffstats
path: root/virt/kvm/async_pf.c
diff options
context:
space:
mode:
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:
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}