Lines Matching refs:vm
32 struct acrn_vm *vm; member
43 struct acrn_vm *vm = irqfd->vm; in acrn_irqfd_inject() local
45 acrn_msi_inject(vm, irqfd->msi.msi_addr, in acrn_irqfd_inject()
53 lockdep_assert_held(&irqfd->vm->irqfds_lock); in hsm_irqfd_shutdown()
65 struct acrn_vm *vm; in hsm_irqfd_shutdown_work() local
68 vm = irqfd->vm; in hsm_irqfd_shutdown_work()
69 mutex_lock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work()
72 mutex_unlock(&vm->irqfds_lock); in hsm_irqfd_shutdown_work()
81 struct acrn_vm *vm; in hsm_irqfd_wakeup() local
84 vm = irqfd->vm; in hsm_irqfd_wakeup()
91 queue_work(vm->irqfd_wq, &irqfd->shutdown); in hsm_irqfd_wakeup()
110 static int acrn_irqfd_assign(struct acrn_vm *vm, struct acrn_irqfd *args) in acrn_irqfd_assign() argument
122 irqfd->vm = vm; in acrn_irqfd_assign()
148 mutex_lock(&vm->irqfds_lock); in acrn_irqfd_assign()
149 list_for_each_entry(tmp, &vm->irqfds, list) { in acrn_irqfd_assign()
153 mutex_unlock(&vm->irqfds_lock); in acrn_irqfd_assign()
156 list_add_tail(&irqfd->list, &vm->irqfds); in acrn_irqfd_assign()
157 mutex_unlock(&vm->irqfds_lock); in acrn_irqfd_assign()
177 static int acrn_irqfd_deassign(struct acrn_vm *vm, in acrn_irqfd_deassign() argument
187 mutex_lock(&vm->irqfds_lock); in acrn_irqfd_deassign()
188 list_for_each_entry_safe(irqfd, tmp, &vm->irqfds, list) { in acrn_irqfd_deassign()
194 mutex_unlock(&vm->irqfds_lock); in acrn_irqfd_deassign()
200 int acrn_irqfd_config(struct acrn_vm *vm, struct acrn_irqfd *args) in acrn_irqfd_config() argument
205 ret = acrn_irqfd_deassign(vm, args); in acrn_irqfd_config()
207 ret = acrn_irqfd_assign(vm, args); in acrn_irqfd_config()
212 int acrn_irqfd_init(struct acrn_vm *vm) in acrn_irqfd_init() argument
214 INIT_LIST_HEAD(&vm->irqfds); in acrn_irqfd_init()
215 mutex_init(&vm->irqfds_lock); in acrn_irqfd_init()
216 vm->irqfd_wq = alloc_workqueue("acrn_irqfd-%u", 0, 0, vm->vmid); in acrn_irqfd_init()
217 if (!vm->irqfd_wq) in acrn_irqfd_init()
220 dev_dbg(acrn_dev.this_device, "VM %u irqfd init.\n", vm->vmid); in acrn_irqfd_init()
224 void acrn_irqfd_deinit(struct acrn_vm *vm) in acrn_irqfd_deinit() argument
228 dev_dbg(acrn_dev.this_device, "VM %u irqfd deinit.\n", vm->vmid); in acrn_irqfd_deinit()
229 destroy_workqueue(vm->irqfd_wq); in acrn_irqfd_deinit()
230 mutex_lock(&vm->irqfds_lock); in acrn_irqfd_deinit()
231 list_for_each_entry_safe(irqfd, next, &vm->irqfds, list) in acrn_irqfd_deinit()
233 mutex_unlock(&vm->irqfds_lock); in acrn_irqfd_deinit()