Lines Matching refs:work

45 static void async_pf_execute(struct work_struct *work)  in async_pf_execute()  argument
48 container_of(work, struct kvm_async_pf, work); in async_pf_execute()
100 struct kvm_async_pf *work = in kvm_clear_async_pf_completion_queue() local
102 typeof(*work), queue); in kvm_clear_async_pf_completion_queue()
103 list_del(&work->queue); in kvm_clear_async_pf_completion_queue()
109 if (!work->vcpu) in kvm_clear_async_pf_completion_queue()
114 flush_work(&work->work); in kvm_clear_async_pf_completion_queue()
116 if (cancel_work_sync(&work->work)) { in kvm_clear_async_pf_completion_queue()
117 mmput(work->mm); in kvm_clear_async_pf_completion_queue()
119 kmem_cache_free(async_pf_cache, work); in kvm_clear_async_pf_completion_queue()
126 struct kvm_async_pf *work = in kvm_clear_async_pf_completion_queue() local
128 typeof(*work), link); in kvm_clear_async_pf_completion_queue()
129 list_del(&work->link); in kvm_clear_async_pf_completion_queue()
130 kmem_cache_free(async_pf_cache, work); in kvm_clear_async_pf_completion_queue()
139 struct kvm_async_pf *work; in kvm_check_async_pf_completion() local
144 work = list_first_entry(&vcpu->async_pf.done, typeof(*work), in kvm_check_async_pf_completion()
146 list_del(&work->link); in kvm_check_async_pf_completion()
149 kvm_arch_async_page_ready(vcpu, work); in kvm_check_async_pf_completion()
151 kvm_arch_async_page_present(vcpu, work); in kvm_check_async_pf_completion()
153 list_del(&work->queue); in kvm_check_async_pf_completion()
155 kmem_cache_free(async_pf_cache, work); in kvm_check_async_pf_completion()
166 struct kvm_async_pf *work; in kvm_setup_async_pf() local
179 work = kmem_cache_zalloc(async_pf_cache, GFP_NOWAIT | __GFP_NOWARN); in kvm_setup_async_pf()
180 if (!work) in kvm_setup_async_pf()
183 work->wakeup_all = false; in kvm_setup_async_pf()
184 work->vcpu = vcpu; in kvm_setup_async_pf()
185 work->cr2_or_gpa = cr2_or_gpa; in kvm_setup_async_pf()
186 work->addr = hva; in kvm_setup_async_pf()
187 work->arch = *arch; in kvm_setup_async_pf()
188 work->mm = current->mm; in kvm_setup_async_pf()
189 mmget(work->mm); in kvm_setup_async_pf()
190 kvm_get_kvm(work->vcpu->kvm); in kvm_setup_async_pf()
192 INIT_WORK(&work->work, async_pf_execute); in kvm_setup_async_pf()
194 list_add_tail(&work->queue, &vcpu->async_pf.queue); in kvm_setup_async_pf()
196 work->notpresent_injected = kvm_arch_async_page_not_present(vcpu, work); in kvm_setup_async_pf()
198 schedule_work(&work->work); in kvm_setup_async_pf()
205 struct kvm_async_pf *work; in kvm_async_pf_wakeup_all() local
211 work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC); in kvm_async_pf_wakeup_all()
212 if (!work) in kvm_async_pf_wakeup_all()
215 work->wakeup_all = true; in kvm_async_pf_wakeup_all()
216 INIT_LIST_HEAD(&work->queue); /* for list_del to work */ in kvm_async_pf_wakeup_all()
220 list_add_tail(&work->link, &vcpu->async_pf.done); in kvm_async_pf_wakeup_all()