Displaying 9 results from an estimated 9 matches for "eventfd_ctx_fdget".
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...gt; +{
> + struct vdpa_callback cb;
> + u32 fd;
> + struct eventfd_ctx *ctx;
> +
> + cb.callback = vhost_vdpa_config_cb;
> + cb.private = v->vdpa;
> + if (copy_from_user(&fd, argp, sizeof(fd)))
> + return -EFAULT;
> +
> + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd);
> + swap(ctx, v->config_ctx);
> +
> + if (!IS_ERR_OR_NULL(ctx))
> + eventfd_ctx_put(ctx);
> +
> + if (IS_ERR(v->config_ctx))
> + return PTR_ERR(v->config_ctx);
> +
> + v->vdpa->config->set_config_cb(v->vdpa, &cb);
> +
> + return 0;
&g...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...gt; +{
> + struct vdpa_callback cb;
> + u32 fd;
> + struct eventfd_ctx *ctx;
> +
> + cb.callback = vhost_vdpa_config_cb;
> + cb.private = v->vdpa;
> + if (copy_from_user(&fd, argp, sizeof(fd)))
> + return -EFAULT;
> +
> + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd);
> + swap(ctx, v->config_ctx);
> +
> + if (!IS_ERR_OR_NULL(ctx))
> + eventfd_ctx_put(ctx);
> +
> + if (IS_ERR(v->config_ctx))
> + return PTR_ERR(v->config_ctx);
> +
> + v->vdpa->config->set_config_cb(v->vdpa, &cb);
> +
> + return 0;
&g...
2020 Apr 26
0
[PATCH V3 1/2] vdpa: Support config interrupt in vhost_vdpa
...gt; +{
> + struct vdpa_callback cb;
> + int fd;
> + struct eventfd_ctx *ctx;
> +
> + cb.callback = vhost_vdpa_config_cb;
> + cb.private = v->vdpa;
> + if (copy_from_user(&fd, argp, sizeof(fd)))
> + return -EFAULT;
> +
> + ctx = fd == VHOST_FILE_UNBIND ? NULL : eventfd_ctx_fdget(fd);
> + swap(ctx, v->config_ctx);
> +
> + if (!IS_ERR_OR_NULL(ctx))
> + eventfd_ctx_put(ctx);
> +
> + if (IS_ERR(v->config_ctx))
> + return PTR_ERR(v->config_ctx);
> +
> + v->vdpa->config->set_config_cb(v->vdpa, &cb);
> +
> + return 0;
&g...
2020 Apr 26
1
[PATCH 1/2] vdpa: Support config interrupt in vhost_vdpa
..._config_cb;
> + cb.private = v->vdpa;
> + if (copy_from_user(&file, argp, sizeof(file)))
> + return -EFAULT;
> +
> + if (file.fd == -1) {
> + vhost_vdpa_config_put(v);
> + v->config_ctx = NULL;
> + return PTR_ERR(v->config_ctx);
> + }
> +
> + ctx = eventfd_ctx_fdget(file.fd);
You may simply did ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
Then there's no need for the specialized action for -1 above.
> + swap(ctx, v->config_ctx);
> +
> + if (!IS_ERR_OR_NULL(ctx))
> + eventfd_ctx_put(ctx);
> +
> + if (IS_ERR(v->config_ctx)...
2020 Apr 14
0
[PATCH] vhost: do not enable VHOST_MENU by default
...m_user(&f, argp, sizeof f)) {
7ad9c9d2704854 Takuya Yoshikawa 2010-05-27 1590 r = -EFAULT;
3a4d5c94e95935 Michael S. Tsirkin 2010-01-14 1591 break;
7ad9c9d2704854 Takuya Yoshikawa 2010-05-27 1592 }
e050c7d93f4adb Eric Biggers 2018-01-06 1593 ctx = f.fd == -1 ? NULL : eventfd_ctx_fdget(f.fd);
e050c7d93f4adb Eric Biggers 2018-01-06 1594 if (IS_ERR(ctx)) {
e050c7d93f4adb Eric Biggers 2018-01-06 1595 r = PTR_ERR(ctx);
535297a6ae4c3b Michael S. Tsirkin 2010-03-17 1596 break;
535297a6ae4c3b Michael S. Tsirkin 2010-03-17 1597 }
e050c7d93f4adb Eric Biggers...
2020 Apr 14
5
[PATCH] vhost: do not enable VHOST_MENU by default
We try to keep the defconfig untouched after decoupling CONFIG_VHOST
out of CONFIG_VIRTUALIZATION in commit 20c384f1ea1a
("vhost: refine vhost and vringh kconfig") by enabling VHOST_MENU by
default. Then the defconfigs can keep enabling CONFIG_VHOST_NET
without the caring of CONFIG_VHOST.
But this will leave a "CONFIG_VHOST_MENU=y" in all defconfigs and even
for the ones that
2020 Apr 14
5
[PATCH] vhost: do not enable VHOST_MENU by default
We try to keep the defconfig untouched after decoupling CONFIG_VHOST
out of CONFIG_VIRTUALIZATION in commit 20c384f1ea1a
("vhost: refine vhost and vringh kconfig") by enabling VHOST_MENU by
default. Then the defconfigs can keep enabling CONFIG_VHOST_NET
without the caring of CONFIG_VHOST.
But this will leave a "CONFIG_VHOST_MENU=y" in all defconfigs and even
for the ones that
2013 Apr 04
1
[PATCH RFC] kvm: add PV MMIO EVENTFD
...VM_IOEVENTFD_VALID_FLAG_MASK)
return -EINVAL;
+ /* PV MMIO can't be combined with PIO or DATAMATCH */
+ if (args->flags & KVM_IOEVENTFD_FLAG_PV_MMIO &&
+ args->flags & (KVM_IOEVENTFD_FLAG_PIO |
+ KVM_IOEVENTFD_FLAG_DATAMATCH))
+ return -EINVAL;
+
eventfd = eventfd_ctx_fdget(args->fd);
if (IS_ERR(eventfd))
return PTR_ERR(eventfd);
@@ -722,6 +739,7 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
p->bus_idx = bus_idx;
p->length = args->len;
p->eventfd = eventfd;
+ p->pvmmio = args->flags & KVM_IOEVENTFD_FLAG_PV_MM...
2013 Apr 04
1
[PATCH RFC] kvm: add PV MMIO EVENTFD
...VM_IOEVENTFD_VALID_FLAG_MASK)
return -EINVAL;
+ /* PV MMIO can't be combined with PIO or DATAMATCH */
+ if (args->flags & KVM_IOEVENTFD_FLAG_PV_MMIO &&
+ args->flags & (KVM_IOEVENTFD_FLAG_PIO |
+ KVM_IOEVENTFD_FLAG_DATAMATCH))
+ return -EINVAL;
+
eventfd = eventfd_ctx_fdget(args->fd);
if (IS_ERR(eventfd))
return PTR_ERR(eventfd);
@@ -722,6 +739,7 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
p->bus_idx = bus_idx;
p->length = args->len;
p->eventfd = eventfd;
+ p->pvmmio = args->flags & KVM_IOEVENTFD_FLAG_PV_MM...