search for: vhost_dev_check_own

Displaying 20 results from an estimated 130 matches for "vhost_dev_check_own".

Did you mean: vhost_dev_check_owner
2020 Feb 13
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...t.c b/drivers/vhost/net.c > index e158159671fa..e4d5f843f9c0 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) > > mutex_lock(&n->dev.mutex); > r = vhost_dev_check_owner(&n->dev); > - if (r) > + if (r) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d rc r=%d", index, fd, r); > goto err; > + } > > if (index >= VHOST_NET_VQ_MAX) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d MAX=%d", index, fd...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...t_virtqueue *vq) > > > @@ -310,6 +319,7 @@ long vhost_dev_init(struct vhost_dev *dev, > > > > > > return 0; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_dev_init); > > > > > > /* Caller should have device mutex */ > > > long vhost_dev_check_owner(struct vhost_dev *dev) > > > @@ -317,6 +327,7 @@ long vhost_dev_check_owner(struct vhost_dev *dev) > > > /* Are you the owner? If not, I don't think you mean to do that */ > > > return dev->mm == current->mm ? 0 : -EPERM; > > > } > > > +...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...t_virtqueue *vq) > > > @@ -310,6 +319,7 @@ long vhost_dev_init(struct vhost_dev *dev, > > > > > > return 0; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_dev_init); > > > > > > /* Caller should have device mutex */ > > > long vhost_dev_check_owner(struct vhost_dev *dev) > > > @@ -317,6 +327,7 @@ long vhost_dev_check_owner(struct vhost_dev *dev) > > > /* Are you the owner? If not, I don't think you mean to do that */ > > > return dev->mm == current->mm ? 0 : -EPERM; > > > } > > > +...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...t.c b/drivers/vhost/net.c > index e158159671fa..e4d5f843f9c0 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) > > mutex_lock(&n->dev.mutex); > r = vhost_dev_check_owner(&n->dev); > - if (r) > + if (r) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d rc r=%d", index, fd, r); > goto err; > + } > > if (index >= VHOST_NET_VQ_MAX) { > + pr_debug("vhost_dev_check_owner index=%u fd=%d MAX=%d", index, fd...
2020 Feb 14
0
vhost changes (batched) in linux-next after 12/13 trigger random crashes in KVM guests after reboot
...5f843f9c0 100644 >>> --- a/drivers/vhost/net.c >>> +++ b/drivers/vhost/net.c >>> @@ -1505,10 +1505,13 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) >>> >>> mutex_lock(&n->dev.mutex); >>> r = vhost_dev_check_owner(&n->dev); >>> - if (r) >>> + if (r) { >>> + pr_debug("vhost_dev_check_owner index=%u fd=%d rc r=%d", index, fd, r); >>> goto err; >>> + } >>> >>> if (index >= VHOST_NET_V...
2020 Apr 01
2
[PATCH] virtio/test: fix up after IOTLB changes
...VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT, NULL); f->private_data = n; @@ -225,7 +225,7 @@ static long vhost_test_reset_owner(struct vhost_test *n) { void *priv = NULL; long err; - struct vhost_umem *umem; + struct vhost_iotlb *umem; mutex_lock(&n->dev.mutex); err = vhost_dev_check_owner(&n->dev); diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index ee0491f579ac..878e565dfffe 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -13,9 +13,11 @@ #include <linux/uaccess.h> #include <linux/slab.h> #include <linux/export.h> +#if...
2020 Apr 01
2
[PATCH] virtio/test: fix up after IOTLB changes
...VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT, NULL); f->private_data = n; @@ -225,7 +225,7 @@ static long vhost_test_reset_owner(struct vhost_test *n) { void *priv = NULL; long err; - struct vhost_umem *umem; + struct vhost_iotlb *umem; mutex_lock(&n->dev.mutex); err = vhost_dev_check_owner(&n->dev); diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c index ee0491f579ac..878e565dfffe 100644 --- a/drivers/vhost/vringh.c +++ b/drivers/vhost/vringh.c @@ -13,9 +13,11 @@ #include <linux/uaccess.h> #include <linux/slab.h> #include <linux/export.h> +#if...
2013 Jul 07
0
[PATCH v2 03/11] vhost: Make vhost a separate module
...-310,6 +319,7 @@ long vhost_dev_init(struct vhost_dev *dev, > > > > > > > > return 0; > > > > } > > > > +EXPORT_SYMBOL_GPL(vhost_dev_init); > > > > > > > > /* Caller should have device mutex */ > > > > long vhost_dev_check_owner(struct vhost_dev *dev) > > > > @@ -317,6 +327,7 @@ long vhost_dev_check_owner(struct vhost_dev *dev) > > > > /* Are you the owner? If not, I don't think you mean to do that */ > > > > return dev->mm == current->mm ? 0 : -EPERM; > > > >...
2017 Dec 24
2
[PATCH] vhost: remove unused lock check flag in vhost_dev_cleanup()
...locked) +void vhost_dev_cleanup(struct vhost_dev *dev) { int i; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..ff4d918e3e0a 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -181,7 +181,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); struct vhost_umem *vhost_dev_reset_owner_prepare(void); void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_umem *); -void vhost_dev_cleanup(struct vhost_dev *, bool locked); +void vhost_dev_cleanup(struct vhost_dev *); void vhost_dev_stop(struct vhost_dev *); lon...
2013 May 03
4
[PATCH 0/3] vhost cleanups and separate module
Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module drivers/vhost/Kconfig | 8 ++++++++ drivers/vhost/Makefile | 3 ++- drivers/vhost/net.c | 6 ++++++ drivers/vhost/scsi.c | 1 - drivers/vhost/vhost.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- drivers/vhost/vhost.h | 8 ++------ 6
2013 May 03
4
[PATCH 0/3] vhost cleanups and separate module
Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module drivers/vhost/Kconfig | 8 ++++++++ drivers/vhost/Makefile | 3 ++- drivers/vhost/net.c | 6 ++++++ drivers/vhost/scsi.c | 1 - drivers/vhost/vhost.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- drivers/vhost/vhost.h | 8 ++------ 6
2012 Jul 12
2
[PATCH 3/5] vhost: Make vhost a separate module
...L(vhost_enable_zcopy); /* Helper to allocate iovec buffers for all vqs. */ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) @@ -322,6 +329,7 @@ long vhost_dev_init(struct vhost_dev *dev, return 0; } +EXPORT_SYMBOL_GPL(vhost_dev_init); /* Caller should have device mutex */ long vhost_dev_check_owner(struct vhost_dev *dev) @@ -329,6 +337,7 @@ long vhost_dev_check_owner(struct vhost_dev *dev) /* Are you the owner? If not, I don't think you mean to do that */ return dev->mm == current->mm ? 0 : -EPERM; } +EXPORT_SYMBOL_GPL(vhost_dev_check_owner); struct vhost_attach_cgroups_st...
2012 Jul 12
2
[PATCH 3/5] vhost: Make vhost a separate module
...L(vhost_enable_zcopy); /* Helper to allocate iovec buffers for all vqs. */ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) @@ -322,6 +329,7 @@ long vhost_dev_init(struct vhost_dev *dev, return 0; } +EXPORT_SYMBOL_GPL(vhost_dev_init); /* Caller should have device mutex */ long vhost_dev_check_owner(struct vhost_dev *dev) @@ -329,6 +337,7 @@ long vhost_dev_check_owner(struct vhost_dev *dev) /* Are you the owner? If not, I don't think you mean to do that */ return dev->mm == current->mm ? 0 : -EPERM; } +EXPORT_SYMBOL_GPL(vhost_dev_check_owner); struct vhost_attach_cgroups_st...
2020 Apr 02
1
[PATCH] virtio/test: fix up after IOTLB changes
...n; > > @@ -225,7 +225,7 @@ static long vhost_test_reset_owner(struct vhost_test *n) > > { > > void *priv = NULL; > > long err; > > - struct vhost_umem *umem; > > + struct vhost_iotlb *umem; > > mutex_lock(&n->dev.mutex); > > err = vhost_dev_check_owner(&n->dev); > > diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c > > index ee0491f579ac..878e565dfffe 100644 > > --- a/drivers/vhost/vringh.c > > +++ b/drivers/vhost/vringh.c > > @@ -13,9 +13,11 @@ > > #include <linux/uaccess.h> > &g...
2010 Nov 29
5
[PATCH 0/2] tools/virtio: virtio_ring testing tool
This implements a virtio simulator: - adds stubs for enough support functions to compile virtio ring in userspace. - Adds a stub vhost based module this can talk to. This should help us decide things like which ring layout works best. Communication is currently done using an eventfd descriptor. This means there's a shared spinlock there: what I would like to do in the future, is run
2010 Nov 29
5
[PATCH 0/2] tools/virtio: virtio_ring testing tool
This implements a virtio simulator: - adds stubs for enough support functions to compile virtio ring in userspace. - Adds a stub vhost based module this can talk to. This should help us decide things like which ring layout works best. Communication is currently done using an eventfd descriptor. This means there's a shared spinlock there: what I would like to do in the future, is run
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...ss_iotlb_msg(struct vhost_dev *dev, > struct vhost_iotlb_msg *msg) > { > struct vhost_vdpa *v = container_of(dev, struct vhost_vdpa, vdev); > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > int r = 0; > > r = vhost_dev_check_owner(dev); > @@ -668,6 +676,14 @@ static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, > case VHOST_IOTLB_INVALIDATE: > vhost_vdpa_unmap(v, msg->iova, msg->size); > break; > + case VHOST_IOTLB_BATCH_BEGIN: > + v->in_batch = true; > + break; > + case...
2020 Jun 28
2
[PATCH RFC 4/5] vhost-vdpa: support IOTLB batching hints
...ss_iotlb_msg(struct vhost_dev *dev, > struct vhost_iotlb_msg *msg) > { > struct vhost_vdpa *v = container_of(dev, struct vhost_vdpa, vdev); > + struct vdpa_device *vdpa = v->vdpa; > + const struct vdpa_config_ops *ops = vdpa->config; > int r = 0; > > r = vhost_dev_check_owner(dev); > @@ -668,6 +676,14 @@ static int vhost_vdpa_process_iotlb_msg(struct vhost_dev *dev, > case VHOST_IOTLB_INVALIDATE: > vhost_vdpa_unmap(v, msg->iova, msg->size); > break; > + case VHOST_IOTLB_BATCH_BEGIN: > + v->in_batch = true; > + break; > + case...
2009 Aug 19
1
[PATCHv4 2/2] vhost_net: a kernel-level virtio server
...gt;file); + kfree(n); + return 0; +} + +static long vhost_net_set_socket(struct vhost_net *n, int fd) +{ + struct { + struct sockaddr_ll sa; + char buf[MAX_ADDR_LEN]; + } uaddr; + struct socket *sock, *oldsock = NULL; + int uaddr_len = sizeof uaddr, r; + + mutex_lock(&n->dev.mutex); + r = vhost_dev_check_owner(&n->dev); + if (r) + goto done; + + if (fd == -1) { + /* Disconnect from socket and device. */ + oldsock = vhost_net_stop(n); + goto done; + } + + sock = sockfd_lookup(fd, &r); + if (!sock) { + r = -ENOTSOCK; + goto done; + } + + /* Parameter checking */ + if (sock->sk->sk_...
2009 Aug 19
1
[PATCHv4 2/2] vhost_net: a kernel-level virtio server
...gt;file); + kfree(n); + return 0; +} + +static long vhost_net_set_socket(struct vhost_net *n, int fd) +{ + struct { + struct sockaddr_ll sa; + char buf[MAX_ADDR_LEN]; + } uaddr; + struct socket *sock, *oldsock = NULL; + int uaddr_len = sizeof uaddr, r; + + mutex_lock(&n->dev.mutex); + r = vhost_dev_check_owner(&n->dev); + if (r) + goto done; + + if (fd == -1) { + /* Disconnect from socket and device. */ + oldsock = vhost_net_stop(n); + goto done; + } + + sock = sockfd_lookup(fd, &r); + if (!sock) { + r = -ENOTSOCK; + goto done; + } + + /* Parameter checking */ + if (sock->sk->sk_...