Lines Matching defs:work
45 static void async_pf_execute(struct work_struct *work)
48 container_of(work, struct kvm_async_pf, work);
59 * This work is run asynchronously to the task which owns
92 static void kvm_flush_and_free_async_pf_work(struct kvm_async_pf *work)
95 * The async #PF is "done", but KVM must wait for the work item itself,
98 * after the last call to module_put(). Note, flushing the work item
104 * need to be flushed (but sanity check that the work wasn't queued).
106 if (work->wakeup_all)
107 WARN_ON_ONCE(work->work.func);
109 flush_work(&work->work);
110 kmem_cache_free(async_pf_cache, work);
117 /* cancel outstanding work queue item */
119 struct kvm_async_pf *work =
121 typeof(*work), queue);
122 list_del(&work->queue);
128 if (!work->vcpu)
133 flush_work(&work->work);
135 if (cancel_work_sync(&work->work)) {
136 mmput(work->mm);
137 kmem_cache_free(async_pf_cache, work);
144 struct kvm_async_pf *work =
146 typeof(*work), link);
147 list_del(&work->link);
150 kvm_flush_and_free_async_pf_work(work);
160 struct kvm_async_pf *work;
165 work = list_first_entry(&vcpu->async_pf.done, typeof(*work),
167 list_del(&work->link);
170 kvm_arch_async_page_ready(vcpu, work);
172 kvm_arch_async_page_present(vcpu, work);
174 list_del(&work->queue);
176 kvm_flush_and_free_async_pf_work(work);
187 struct kvm_async_pf *work;
200 work = kmem_cache_zalloc(async_pf_cache, GFP_NOWAIT | __GFP_NOWARN);
201 if (!work)
204 work->wakeup_all = false;
205 work->vcpu = vcpu;
206 work->cr2_or_gpa = cr2_or_gpa;
207 work->addr = hva;
208 work->arch = *arch;
209 work->mm = current->mm;
210 mmget(work->mm);
212 INIT_WORK(&work->work, async_pf_execute);
214 list_add_tail(&work->queue, &vcpu->async_pf.queue);
216 work->notpresent_injected = kvm_arch_async_page_not_present(vcpu, work);
218 schedule_work(&work->work);
225 struct kvm_async_pf *work;
231 work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC);
232 if (!work)
235 work->wakeup_all = true;
236 INIT_LIST_HEAD(&work->queue); /* for list_del to work */
240 list_add_tail(&work->link, &vcpu->async_pf.done);