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()
99 struct kvm_async_pf *work = in kvm_clear_async_pf_completion_queue() local
101 typeof(*work), queue); in kvm_clear_async_pf_completion_queue()
102 list_del(&work->queue); in kvm_clear_async_pf_completion_queue()
108 if (!work->vcpu) in kvm_clear_async_pf_completion_queue()
113 flush_work(&work->work); in kvm_clear_async_pf_completion_queue()
115 if (cancel_work_sync(&work->work)) { in kvm_clear_async_pf_completion_queue()
116 mmput(work->mm); in kvm_clear_async_pf_completion_queue()
118 kmem_cache_free(async_pf_cache, work); in kvm_clear_async_pf_completion_queue()
125 struct kvm_async_pf *work = in kvm_clear_async_pf_completion_queue() local
127 typeof(*work), link); in kvm_clear_async_pf_completion_queue()
128 list_del(&work->link); in kvm_clear_async_pf_completion_queue()
129 kmem_cache_free(async_pf_cache, work); in kvm_clear_async_pf_completion_queue()
138 struct kvm_async_pf *work; in kvm_check_async_pf_completion() local
143 work = list_first_entry(&vcpu->async_pf.done, typeof(*work), in kvm_check_async_pf_completion()
145 list_del(&work->link); in kvm_check_async_pf_completion()
148 kvm_arch_async_page_ready(vcpu, work); in kvm_check_async_pf_completion()
150 kvm_arch_async_page_present(vcpu, work); in kvm_check_async_pf_completion()
152 list_del(&work->queue); in kvm_check_async_pf_completion()
154 kmem_cache_free(async_pf_cache, work); in kvm_check_async_pf_completion()
165 struct kvm_async_pf *work; in kvm_setup_async_pf() local
178 work = kmem_cache_zalloc(async_pf_cache, GFP_NOWAIT | __GFP_NOWARN); in kvm_setup_async_pf()
179 if (!work) in kvm_setup_async_pf()
182 work->wakeup_all = false; in kvm_setup_async_pf()
183 work->vcpu = vcpu; in kvm_setup_async_pf()
184 work->cr2_or_gpa = cr2_or_gpa; in kvm_setup_async_pf()
185 work->addr = hva; in kvm_setup_async_pf()
186 work->arch = *arch; in kvm_setup_async_pf()
187 work->mm = current->mm; in kvm_setup_async_pf()
188 mmget(work->mm); in kvm_setup_async_pf()
189 kvm_get_kvm(work->vcpu->kvm); in kvm_setup_async_pf()
191 INIT_WORK(&work->work, async_pf_execute); in kvm_setup_async_pf()
193 list_add_tail(&work->queue, &vcpu->async_pf.queue); in kvm_setup_async_pf()
195 work->notpresent_injected = kvm_arch_async_page_not_present(vcpu, work); in kvm_setup_async_pf()
197 schedule_work(&work->work); in kvm_setup_async_pf()
204 struct kvm_async_pf *work; in kvm_async_pf_wakeup_all() local
210 work = kmem_cache_zalloc(async_pf_cache, GFP_ATOMIC); in kvm_async_pf_wakeup_all()
211 if (!work) in kvm_async_pf_wakeup_all()
214 work->wakeup_all = true; in kvm_async_pf_wakeup_all()
215 INIT_LIST_HEAD(&work->queue); /* for list_del to work */ in kvm_async_pf_wakeup_all()
219 list_add_tail(&work->link, &vcpu->async_pf.done); in kvm_async_pf_wakeup_all()