Lines Matching refs:p
43 static void acrn_ioeventfd_shutdown(struct acrn_vm *vm, struct hsm_ioeventfd *p) in acrn_ioeventfd_shutdown() argument
47 eventfd_ctx_put(p->eventfd); in acrn_ioeventfd_shutdown()
48 list_del(&p->list); in acrn_ioeventfd_shutdown()
49 kfree(p); in acrn_ioeventfd_shutdown()
55 struct hsm_ioeventfd *p; in hsm_ioeventfd_is_conflict() local
60 list_for_each_entry(p, &vm->ioeventfds, list) in hsm_ioeventfd_is_conflict()
61 if (p->eventfd == ioeventfd->eventfd && in hsm_ioeventfd_is_conflict()
62 p->addr == ioeventfd->addr && in hsm_ioeventfd_is_conflict()
63 p->type == ioeventfd->type && in hsm_ioeventfd_is_conflict()
64 (p->wildcard || ioeventfd->wildcard || in hsm_ioeventfd_is_conflict()
65 p->data == ioeventfd->data)) in hsm_ioeventfd_is_conflict()
80 struct hsm_ioeventfd *p; in acrn_ioeventfd_assign() local
99 p = kzalloc(sizeof(*p), GFP_KERNEL); in acrn_ioeventfd_assign()
100 if (!p) { in acrn_ioeventfd_assign()
105 INIT_LIST_HEAD(&p->list); in acrn_ioeventfd_assign()
106 p->addr = args->addr; in acrn_ioeventfd_assign()
107 p->length = args->len; in acrn_ioeventfd_assign()
108 p->eventfd = eventfd; in acrn_ioeventfd_assign()
109 p->type = ioreq_type_from_flags(args->flags); in acrn_ioeventfd_assign()
117 p->data = args->data; in acrn_ioeventfd_assign()
119 p->wildcard = true; in acrn_ioeventfd_assign()
123 if (hsm_ioeventfd_is_conflict(vm, p)) { in acrn_ioeventfd_assign()
129 ret = acrn_ioreq_range_add(vm->ioeventfd_client, p->type, in acrn_ioeventfd_assign()
130 p->addr, p->addr + p->length - 1); in acrn_ioeventfd_assign()
134 list_add_tail(&p->list, &vm->ioeventfds); in acrn_ioeventfd_assign()
141 kfree(p); in acrn_ioeventfd_assign()
150 struct hsm_ioeventfd *p; in acrn_ioeventfd_deassign() local
158 list_for_each_entry(p, &vm->ioeventfds, list) { in acrn_ioeventfd_deassign()
159 if (p->eventfd != eventfd) in acrn_ioeventfd_deassign()
162 acrn_ioreq_range_del(vm->ioeventfd_client, p->type, in acrn_ioeventfd_deassign()
163 p->addr, p->addr + p->length - 1); in acrn_ioeventfd_deassign()
164 acrn_ioeventfd_shutdown(vm, p); in acrn_ioeventfd_deassign()
176 struct hsm_ioeventfd *p = NULL; in hsm_ioeventfd_match() local
180 list_for_each_entry(p, &vm->ioeventfds, list) { in hsm_ioeventfd_match()
181 if (p->type == type && p->addr == addr && p->length >= len && in hsm_ioeventfd_match()
182 (p->wildcard || p->data == data)) in hsm_ioeventfd_match()
183 return p; in hsm_ioeventfd_match()
192 struct hsm_ioeventfd *p; in acrn_ioeventfd_handler() local
224 p = hsm_ioeventfd_match(client->vm, addr, val, size, req->type); in acrn_ioeventfd_handler()
225 if (p) in acrn_ioeventfd_handler()
226 eventfd_signal(p->eventfd, 1); in acrn_ioeventfd_handler()
265 struct hsm_ioeventfd *p, *next; in acrn_ioeventfd_deinit() local
270 list_for_each_entry_safe(p, next, &vm->ioeventfds, list) in acrn_ioeventfd_deinit()
271 acrn_ioeventfd_shutdown(vm, p); in acrn_ioeventfd_deinit()