| /linux/virt/lib/ |
| H A D | irqbypass.c | 94 struct eventfd_ctx *eventfd, int irq) in irq_bypass_register_producer() argument 96 unsigned long index = (unsigned long)eventfd; in irq_bypass_register_producer() 100 if (WARN_ON_ONCE(producer->eventfd)) in irq_bypass_register_producer() 120 producer->eventfd = eventfd; in irq_bypass_register_producer() 135 unsigned long index = (unsigned long)producer->eventfd; in irq_bypass_unregister_producer() 137 if (!producer->eventfd) in irq_bypass_unregister_producer() 146 producer->eventfd = NULL; in irq_bypass_unregister_producer() 159 struct eventfd_ctx *eventfd) in irq_bypass_register_consumer() argument 161 unsigned long index = (unsigned long)eventfd; in irq_bypass_register_consumer() 165 if (WARN_ON_ONCE(consumer->eventfd)) in irq_bypass_register_consumer() [all …]
|
| /linux/drivers/virt/acrn/ |
| H A D | irqfd.c | 33 struct eventfd_ctx *eventfd; member 55 eventfd_ctx_remove_wait_queue(irqfd->eventfd, &irqfd->wait, &cnt); in hsm_irqfd_shutdown() 56 eventfd_ctx_put(irqfd->eventfd); in hsm_irqfd_shutdown() 110 struct eventfd_ctx *eventfd = NULL; in acrn_irqfd_assign() local 130 eventfd = eventfd_ctx_fileget(fd_file(f)); in acrn_irqfd_assign() 131 if (IS_ERR(eventfd)) { in acrn_irqfd_assign() 132 ret = PTR_ERR(eventfd); in acrn_irqfd_assign() 136 irqfd->eventfd = eventfd; in acrn_irqfd_assign() 147 if (irqfd->eventfd != tmp->eventfd) in acrn_irqfd_assign() 164 eventfd_ctx_put(eventfd); in acrn_irqfd_assign() [all …]
|
| H A D | ioeventfd.c | 29 struct eventfd_ctx *eventfd; member 47 eventfd_ctx_put(p->eventfd); in acrn_ioeventfd_shutdown() 61 if (p->eventfd == ioeventfd->eventfd && in hsm_ioeventfd_is_conflict() 79 struct eventfd_ctx *eventfd; in acrn_ioeventfd_assign() local 95 eventfd = eventfd_ctx_fdget(args->fd); in acrn_ioeventfd_assign() 96 if (IS_ERR(eventfd)) in acrn_ioeventfd_assign() 97 return PTR_ERR(eventfd); in acrn_ioeventfd_assign() 108 p->eventfd = eventfd; in acrn_ioeventfd_assign() 143 eventfd_ctx_put(eventfd); in acrn_ioeventfd_assign() 151 struct eventfd_ctx *eventfd; in acrn_ioeventfd_deassign() local [all …]
|
| /linux/virt/kvm/ |
| H A D | eventfd.c | 136 eventfd_ctx_remove_wait_queue(irqfd->eventfd, &irqfd->wait, &cnt); in irqfd_shutdown() 155 eventfd_ctx_put(irqfd->eventfd); in irqfd_shutdown() 213 eventfd_ctx_do_read(irqfd->eventfd, &cnt); in irqfd_wakeup() 359 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL; in kvm_irqfd_assign() local 388 eventfd = eventfd_ctx_fileget(fd_file(f)); in kvm_irqfd_assign() 389 if (IS_ERR(eventfd)) { in kvm_irqfd_assign() 390 ret = PTR_ERR(eventfd); in kvm_irqfd_assign() 394 irqfd->eventfd = eventfd; in kvm_irqfd_assign() 482 ret = irq_bypass_register_consumer(&irqfd->consumer, irqfd->eventfd); in kvm_irqfd_assign() 485 irqfd->eventfd, ret); in kvm_irqfd_assign() [all …]
|
| H A D | Makefile.kvm | 8 kvm-y := $(KVM)/kvm_main.o $(KVM)/eventfd.o $(KVM)/binary_stats.o
|
| /linux/drivers/hv/ |
| H A D | mshv_eventfd.c | 3 * eventfd support for mshv 17 #include <linux/eventfd.h> 324 /* The eventfd is closing, detach from the partition */ in mshv_irqfd_wakeup() 389 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL; in mshv_irqfd_assign() local 411 eventfd = eventfd_ctx_fileget(fd_file(f)); in mshv_irqfd_assign() 412 if (IS_ERR(eventfd)) { in mshv_irqfd_assign() 413 ret = PTR_ERR(eventfd); in mshv_irqfd_assign() 417 irqfd->irqfd_eventfd_ctx = eventfd; in mshv_irqfd_assign() 470 * a callback whenever someone signals the underlying eventfd in mshv_irqfd_assign() 504 * Check if there was an event already pending on the eventfd in mshv_irqfd_assign() 538 struct eventfd_ctx *eventfd; mshv_irqfd_deassign() local 667 struct eventfd_ctx *eventfd; mshv_assign_ioeventfd() local 759 struct eventfd_ctx *eventfd; mshv_deassign_ioeventfd() local [all...] |
| H A D | mshv_vtl_main.c | 300 struct eventfd_ctx *eventfd; in mshv_vtl_vmbus_isr() local 317 eventfd = READ_ONCE(flag_eventfds[i]); in mshv_vtl_vmbus_isr() 318 if (eventfd) in mshv_vtl_vmbus_isr() 319 eventfd_signal(eventfd); in mshv_vtl_vmbus_isr() 968 struct eventfd_ctx *eventfd, *old_eventfd; in mshv_vtl_sint_ioctl_set_eventfd() local 975 eventfd = NULL; in mshv_vtl_sint_ioctl_set_eventfd() 977 eventfd = eventfd_ctx_fdget(set_eventfd.fd); in mshv_vtl_sint_ioctl_set_eventfd() 978 if (IS_ERR(eventfd)) in mshv_vtl_sint_ioctl_set_eventfd() 979 return PTR_ERR(eventfd); in mshv_vtl_sint_ioctl_set_eventfd() 984 WRITE_ONCE(flag_eventfds[set_eventfd.flag], eventfd); in mshv_vtl_sint_ioctl_set_eventfd()
|
| /linux/tools/testing/selftests/kvm/ |
| H A D | irqfd_test.c | 28 static void juggle_eventfd_secondary(struct kvm_vm *vm, int eventfd) in juggle_eventfd_secondary() argument 41 r = __kvm_irqfd(vm, GSI_BASE_SECONDARY, eventfd, 0); in juggle_eventfd_secondary() 47 r = __kvm_irqfd(vm, GSI_BASE_SECONDARY + i, eventfd, KVM_IRQFD_FLAG_DEASSIGN); in juggle_eventfd_secondary() 63 static void juggle_eventfd_primary(struct kvm_vm *vm, int eventfd) in juggle_eventfd_primary() argument 72 r1 = __kvm_irqfd(vm, GSI_BASE_PRIMARY, eventfd, 0); in juggle_eventfd_primary() 76 r2 = __kvm_irqfd(vm, GSI_BASE_PRIMARY + 1, eventfd, 0); in juggle_eventfd_primary() 85 kvm_irqfd(vm, GSI_BASE_PRIMARY, eventfd, KVM_IRQFD_FLAG_DEASSIGN); in juggle_eventfd_primary() 86 kvm_irqfd(vm, GSI_BASE_PRIMARY + 1, eventfd, KVM_IRQFD_FLAG_DEASSIGN); in juggle_eventfd_primary()
|
| /linux/include/linux/ |
| H A D | irqbypass.h | 49 struct eventfd_ctx *eventfd; member 75 struct eventfd_ctx *eventfd; member 87 struct eventfd_ctx *eventfd, int irq); 90 struct eventfd_ctx *eventfd);
|
| H A D | vmpressure.h | 42 struct eventfd_ctx *eventfd, 45 struct eventfd_ctx *eventfd);
|
| H A D | kvm_irqfd.h | 56 struct eventfd_ctx *eventfd; member
|
| /linux/drivers/xen/ |
| H A D | privcmd.c | 882 struct eventfd_ctx *eventfd; member 906 eventfd_ctx_remove_wait_queue(kirqfd->eventfd, &kirqfd->wait, &cnt); in irqfd_shutdown() 907 eventfd_ctx_put(kirqfd->eventfd); in irqfd_shutdown() 916 eventfd_ctx_do_read(kirqfd->eventfd, &cnt); in irqfd_inject() 991 kirqfd->eventfd = eventfd_ctx_fileget(fd_file(f)); in privcmd_irqfd_assign() 992 if (IS_ERR(kirqfd->eventfd)) { in privcmd_irqfd_assign() 993 ret = PTR_ERR(kirqfd->eventfd); in privcmd_irqfd_assign() 1007 if (kirqfd->eventfd == tmp->eventfd) { in privcmd_irqfd_assign() 1030 eventfd_ctx_put(kirqfd->eventfd); in privcmd_irqfd_assign() 1040 struct eventfd_ctx *eventfd; in privcmd_irqfd_deassign() local [all …]
|
| /linux/mm/ |
| H A D | memcontrol-v1.c | 46 struct eventfd_ctx *eventfd; member 60 struct eventfd_ctx *eventfd; member 71 struct eventfd_ctx *eventfd, const char *args); 78 struct eventfd_ctx *eventfd); 461 eventfd_signal(t->entries[i].eventfd); in __mem_cgroup_threshold() 473 eventfd_signal(t->entries[i].eventfd); in __mem_cgroup_threshold() 719 eventfd_signal(ev->eventfd); in mem_cgroup_oom_notify_cb() 734 struct eventfd_ctx *eventfd, const char *args, enum res_type type) in __mem_cgroup_usage_register_event() argument 777 new->entries[size - 1].eventfd = eventfd; in __mem_cgroup_usage_register_event() 814 struct eventfd_ctx *eventfd, const char *args) in mem_cgroup_usage_register_event() argument [all …]
|
| /linux/drivers/vfio/ |
| H A D | virqfd.c | 47 eventfd_ctx_do_read(virqfd->eventfd, &cnt); in virqfd_wakeup() 90 eventfd_ctx_remove_wait_queue(virqfd->eventfd, &virqfd->wait, &cnt); in virqfd_shutdown() 92 eventfd_ctx_put(virqfd->eventfd); in virqfd_shutdown() 147 virqfd->eventfd = ctx; in vfio_virqfd_enable()
|
| /linux/drivers/vfio/pci/ |
| H A D | vfio_pci_intrs.c | 741 struct vfio_pci_eventfd *eventfd; in vfio_pci_set_ctx_trigger_single() local 743 eventfd = rcu_dereference_protected(*peventfd, in vfio_pci_set_ctx_trigger_single() 746 if (!eventfd) in vfio_pci_set_ctx_trigger_single() 750 eventfd_signal(eventfd->ctx); in vfio_pci_set_ctx_trigger_single() 764 struct vfio_pci_eventfd *eventfd = in vfio_pci_set_ctx_trigger_single() local 768 if (eventfd) in vfio_pci_set_ctx_trigger_single() 769 eventfd_signal(eventfd->ctx); in vfio_pci_set_ctx_trigger_single()
|
| H A D | vfio_pci_core.c | 47 struct vfio_pci_eventfd *eventfd = in vfio_pci_eventfd_rcu_free() local 50 eventfd_ctx_put(eventfd->ctx); in vfio_pci_eventfd_rcu_free() 51 kfree(eventfd); in vfio_pci_eventfd_rcu_free() 1806 struct vfio_pci_eventfd *eventfd; in vfio_pci_core_request() local 1809 eventfd = rcu_dereference(vdev->req_trigger); in vfio_pci_core_request() 1810 if (eventfd) { in vfio_pci_core_request() 1815 eventfd_signal(eventfd->ctx); in vfio_pci_core_request() 2238 struct vfio_pci_eventfd *eventfd; in vfio_pci_core_aer_err_detected() local 2241 eventfd = rcu_dereference(vdev->err_trigger); in vfio_pci_core_aer_err_detected() 2242 if (eventfd) in vfio_pci_core_aer_err_detected() [all …]
|
| /linux/tools/build/feature/ |
| H A D | test-eventfd.c | 8 return eventfd(0, EFD_NONBLOCK); in main()
|
| /linux/tools/testing/selftests/kvm/include/ |
| H A D | kvm_util.h | 515 static inline int __kvm_irqfd(struct kvm_vm *vm, uint32_t gsi, int eventfd, in __kvm_irqfd() argument 519 .fd = eventfd, in __kvm_irqfd() 528 static inline void kvm_irqfd(struct kvm_vm *vm, uint32_t gsi, int eventfd, in kvm_irqfd() argument 531 int ret = __kvm_irqfd(vm, gsi, eventfd, flags); in kvm_irqfd() 536 static inline void kvm_assign_irqfd(struct kvm_vm *vm, uint32_t gsi, int eventfd) in kvm_assign_irqfd() argument 538 kvm_irqfd(vm, gsi, eventfd, 0); in kvm_assign_irqfd() 541 static inline void kvm_deassign_irqfd(struct kvm_vm *vm, uint32_t gsi, int eventfd) in kvm_deassign_irqfd() argument 543 kvm_irqfd(vm, gsi, eventfd, KVM_IRQFD_FLAG_DEASSIGN); in kvm_deassign_irqfd() 548 int fd = eventfd(0, 0); in kvm_new_eventfd()
|
| /linux/arch/x86/kvm/ |
| H A D | hyperv.c | 2415 struct eventfd_ctx *eventfd; in kvm_hvcall_signal_event() local 2444 eventfd = idr_find(&hv->conn_to_evt, hc->ingpa); in kvm_hvcall_signal_event() 2446 if (!eventfd) in kvm_hvcall_signal_event() 2449 eventfd_signal(eventfd); in kvm_hvcall_signal_event() 2708 struct eventfd_ctx *eventfd; in kvm_hv_destroy_vm() local 2711 idr_for_each_entry(&hv->conn_to_evt, eventfd, i) in kvm_hv_destroy_vm() 2712 eventfd_ctx_put(eventfd); in kvm_hv_destroy_vm() 2719 struct eventfd_ctx *eventfd; in kvm_hv_eventfd_assign() local 2722 eventfd = eventfd_ctx_fdget(fd); in kvm_hv_eventfd_assign() 2723 if (IS_ERR(eventfd)) in kvm_hv_eventfd_assign() [all …]
|
| H A D | xen.c | 2057 } eventfd; member 2115 struct eventfd_ctx *eventfd = NULL; in kvm_xen_eventfd_assign() local 2135 eventfd = eventfd_ctx_fdget(data->u.evtchn.deliver.eventfd.fd); in kvm_xen_eventfd_assign() 2136 if (IS_ERR(eventfd)) { in kvm_xen_eventfd_assign() 2137 ret = PTR_ERR(eventfd); in kvm_xen_eventfd_assign() 2153 if (eventfd) { in kvm_xen_eventfd_assign() 2154 evtchnfd->deliver.eventfd.ctx = eventfd; in kvm_xen_eventfd_assign() 2176 if (eventfd) in kvm_xen_eventfd_assign() 2177 eventfd_ctx_put(eventfd); in kvm_xen_eventfd_assign() 2196 eventfd_ctx_put(evtchnfd->deliver.eventfd.ctx); in kvm_xen_eventfd_deassign() [all …]
|
| /linux/tools/virtio/ringtest/ |
| H A D | main.c | 302 kickfd = eventfd(0, 0); in main() 304 callfd = eventfd(0, 0); in main()
|
| /linux/samples/cgroup/ |
| H A D | cgroup_event_listener.c | 47 efd = eventfd(0, 0); in main()
|
| /linux/include/uapi/misc/ |
| H A D | ocxl.h | 65 __s32 eventfd; member
|
| /linux/Documentation/userspace-api/ |
| H A D | vduse.rst | 221 3. Setup the kick eventfd for the specified virtqueues with the VDUSE_VQ_SETUP_KICKFD 222 ioctl. The kick eventfd is used by VDUSE kernel module to notify userspace to 226 4. Listen to the kick eventfd (optional) and consume the available ring. The buffer
|
| /linux/drivers/vdpa/vdpa_user/ |
| H A D | vduse_dev.c | 937 struct vduse_vq_eventfd *eventfd) in vduse_kickfd_setup() argument 943 if (eventfd->index >= dev->vq_num) in vduse_kickfd_setup() 946 index = array_index_nospec(eventfd->index, dev->vq_num); in vduse_kickfd_setup() 948 if (eventfd->fd >= 0) { in vduse_kickfd_setup() 949 ctx = eventfd_ctx_fdget(eventfd->fd); in vduse_kickfd_setup() 952 } else if (eventfd->fd != VDUSE_EVENTFD_DEASSIGN) in vduse_kickfd_setup() 1307 struct vduse_vq_eventfd eventfd; in vduse_dev_ioctl() local 1310 if (copy_from_user(&eventfd, argp, sizeof(eventfd))) in vduse_dev_ioctl() 1313 ret = vduse_kickfd_setup(dev, &eventfd); in vduse_dev_ioctl()
|