Lines Matching refs:evtchnfd

1983 struct evtchnfd {  struct
2002 struct evtchnfd *evtchnfd; in kvm_xen_eventfd_update() argument
2007 evtchnfd = idr_find(&kvm->arch.xen.evtchn_ports, port); in kvm_xen_eventfd_update()
2010 if (!evtchnfd) in kvm_xen_eventfd_update()
2015 if (evtchnfd->type != data->u.evtchn.type) in kvm_xen_eventfd_update()
2022 if (!evtchnfd->deliver.port.port || in kvm_xen_eventfd_update()
2023 evtchnfd->deliver.port.port != data->u.evtchn.deliver.port.port) in kvm_xen_eventfd_update()
2030 evtchnfd->deliver.port.priority = data->u.evtchn.deliver.port.priority; in kvm_xen_eventfd_update()
2031 if (evtchnfd->deliver.port.vcpu_id != data->u.evtchn.deliver.port.vcpu) { in kvm_xen_eventfd_update()
2032 evtchnfd->deliver.port.vcpu_id = data->u.evtchn.deliver.port.vcpu; in kvm_xen_eventfd_update()
2033 evtchnfd->deliver.port.vcpu_idx = -1; in kvm_xen_eventfd_update()
2050 struct evtchnfd *evtchnfd; in kvm_xen_eventfd_assign() local
2053 evtchnfd = kzalloc(sizeof(struct evtchnfd), GFP_KERNEL); in kvm_xen_eventfd_assign()
2054 if (!evtchnfd) in kvm_xen_eventfd_assign()
2085 evtchnfd->send_port = data->u.evtchn.send_port; in kvm_xen_eventfd_assign()
2086 evtchnfd->type = data->u.evtchn.type; in kvm_xen_eventfd_assign()
2088 evtchnfd->deliver.eventfd.ctx = eventfd; in kvm_xen_eventfd_assign()
2094 evtchnfd->deliver.port.port = data->u.evtchn.deliver.port.port; in kvm_xen_eventfd_assign()
2095 evtchnfd->deliver.port.vcpu_id = data->u.evtchn.deliver.port.vcpu; in kvm_xen_eventfd_assign()
2096 evtchnfd->deliver.port.vcpu_idx = -1; in kvm_xen_eventfd_assign()
2097 evtchnfd->deliver.port.priority = data->u.evtchn.deliver.port.priority; in kvm_xen_eventfd_assign()
2101 ret = idr_alloc(&kvm->arch.xen.evtchn_ports, evtchnfd, port, port + 1, in kvm_xen_eventfd_assign()
2113 kfree(evtchnfd); in kvm_xen_eventfd_assign()
2119 struct evtchnfd *evtchnfd; in kvm_xen_eventfd_deassign() local
2122 evtchnfd = idr_remove(&kvm->arch.xen.evtchn_ports, port); in kvm_xen_eventfd_deassign()
2125 if (!evtchnfd) in kvm_xen_eventfd_deassign()
2129 if (!evtchnfd->deliver.port.port) in kvm_xen_eventfd_deassign()
2130 eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx); in kvm_xen_eventfd_deassign()
2131 kfree(evtchnfd); in kvm_xen_eventfd_deassign()
2137 struct evtchnfd *evtchnfd, **all_evtchnfds; in kvm_xen_eventfd_reset() local
2148 idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) in kvm_xen_eventfd_reset()
2151 all_evtchnfds = kmalloc_array(n, sizeof(struct evtchnfd *), GFP_KERNEL); in kvm_xen_eventfd_reset()
2158 idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) { in kvm_xen_eventfd_reset()
2159 all_evtchnfds[n++] = evtchnfd; in kvm_xen_eventfd_reset()
2160 idr_remove(&kvm->arch.xen.evtchn_ports, evtchnfd->send_port); in kvm_xen_eventfd_reset()
2167 evtchnfd = all_evtchnfds[n]; in kvm_xen_eventfd_reset()
2168 if (!evtchnfd->deliver.port.port) in kvm_xen_eventfd_reset()
2169 eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx); in kvm_xen_eventfd_reset()
2170 kfree(evtchnfd); in kvm_xen_eventfd_reset()
2199 struct evtchnfd *evtchnfd; in kvm_xen_hcall_evtchn_send() local
2215 evtchnfd = idr_find(&vcpu->kvm->arch.xen.evtchn_ports, send.port); in kvm_xen_hcall_evtchn_send()
2217 if (!evtchnfd) in kvm_xen_hcall_evtchn_send()
2220 if (evtchnfd->deliver.port.port) { in kvm_xen_hcall_evtchn_send()
2221 int ret = kvm_xen_set_evtchn(&evtchnfd->deliver.port, vcpu->kvm); in kvm_xen_hcall_evtchn_send()
2225 eventfd_signal(evtchnfd->deliver.eventfd.ctx); in kvm_xen_hcall_evtchn_send()
2290 struct evtchnfd *evtchnfd; in kvm_xen_destroy_vm() local
2295 idr_for_each_entry(&kvm->arch.xen.evtchn_ports, evtchnfd, i) { in kvm_xen_destroy_vm()
2296 if (!evtchnfd->deliver.port.port) in kvm_xen_destroy_vm()
2297 eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx); in kvm_xen_destroy_vm()
2298 kfree(evtchnfd); in kvm_xen_destroy_vm()