search for: vhost_dev_has_owner

Displaying 20 results from an estimated 70 matches for "vhost_dev_has_owner".

2013 Jun 06
0
[PATCH net 1/2] vhost: check owner before we overwrite ubuf_info
...12 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 2b51e23..6b00f64 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1053,6 +1053,10 @@ static long vhost_net_set_owner(struct vhost_net *n) int r; mutex_lock(&n->dev.mutex); + if (vhost_dev_has_owner(&n->dev)) { + r = -EBUSY; + goto out; + } r = vhost_net_set_ubuf_info(n); if (r) goto out; diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index beee7f5..60aa5ad 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -344,13 +344,19 @@ static int vhost_attach_c...
2013 Jun 06
5
[PATCH net 0/2] vhost fixes for 3.10
Two patches fixing the fallout from the vhost cleanup in 3.10. Thanks to Tommi Rantala who reported the issue. Tommi, could you please confirm this fixes the crashes for you? Michael S. Tsirkin (2): vhost: check owner before we overwrite ubuf_info vhost: fix ubuf_info cleanup drivers/vhost/net.c | 26 +++++++++++--------------- drivers/vhost/vhost.c | 8 +++++++- drivers/vhost/vhost.h |
2013 Jun 06
5
[PATCH net 0/2] vhost fixes for 3.10
Two patches fixing the fallout from the vhost cleanup in 3.10. Thanks to Tommi Rantala who reported the issue. Tommi, could you please confirm this fixes the crashes for you? Michael S. Tsirkin (2): vhost: check owner before we overwrite ubuf_info vhost: fix ubuf_info cleanup drivers/vhost/net.c | 26 +++++++++++--------------- drivers/vhost/vhost.c | 8 +++++++- drivers/vhost/vhost.h |
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
On Mon, Aug 22, 2016 at 08:16:17AM -0600, Jonathan Corbet wrote: > On Mon, 22 Aug 2016 16:57:46 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > commit commit ea04036032edda6f771c1381d03832d2ed0f6c31 ("CodingStyle: > > add some more error handling guidelines") suggests never naming goto > > labels after the goto location - that is
2016 Aug 22
4
[PATCH] CodingStyle: add some more error handling guidelines
On Mon, Aug 22, 2016 at 08:16:17AM -0600, Jonathan Corbet wrote: > On Mon, 22 Aug 2016 16:57:46 +0300 > "Michael S. Tsirkin" <mst at redhat.com> wrote: > > > commit commit ea04036032edda6f771c1381d03832d2ed0f6c31 ("CodingStyle: > > add some more error handling guidelines") suggests never naming goto > > labels after the goto location - that is
2016 Aug 22
0
[PATCH] CodingStyle: add some more error handling guidelines
...bad style. devel/drivers/vhost/vhost.c 473 /* Caller should have device mutex */ 474 long vhost_dev_set_owner(struct vhost_dev *dev) 475 { 476 struct task_struct *worker; 477 int err; 478 479 /* Is there an owner already? */ 480 if (vhost_dev_has_owner(dev)) { 481 err = -EBUSY; 482 goto err_mm; What does goto err_mm do? It's actually a do-nothing goto. It would be easier to read as a direct return. Why is it called err_mm? Because originally the condition was: if (dev->mm) { err = -EBUSY;...
2017 Dec 24
2
[PATCH] vhost: remove unused lock check flag in vhost_dev_cleanup()
...void vhost_dev_cleanup(struct vhost_dev *dev, bool 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...
2015 Apr 17
0
[PATCH] Revert "vhost: fix release path lockdep checks"
...vhost_dev *dev, bool locked) +/* Caller should have device mutex */ +void vhost_dev_cleanup(struct vhost_dev *dev) { int i; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..cc9a742 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -127,7 +127,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); struct vhost_memory *vhost_dev_reset_owner_prepare(void); void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_memory *); -void vhost_dev_cleanup(struct vhost_dev *, bool locked); +void vhost_dev_cleanup(struct vhost_...
2015 Apr 17
0
[PATCH RESEND] Revert "vhost: fix release path lockdep checks"
...vhost_dev *dev, bool locked) +/* Caller should have device mutex */ +void vhost_dev_cleanup(struct vhost_dev *dev) { int i; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..cc9a742 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -127,7 +127,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); struct vhost_memory *vhost_dev_reset_owner_prepare(void); void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_memory *); -void vhost_dev_cleanup(struct vhost_dev *, bool locked); +void vhost_dev_cleanup(struct vhost_...
2019 Sep 23
0
[PATCH] vhost: It's better to use size_t for the 3rd parameter of vhost_exceeds_weight()
...size_t total_len); > void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, > - int nvqs, int iov_limit, int weight, int byte_weight); > + int nvqs, int iov_limit, int weight, size_t byte_weight); > long vhost_dev_set_owner(struct vhost_dev *dev); > bool vhost_dev_has_owner(struct vhost_dev *dev); > long vhost_dev_check_owner(struct vhost_dev *); > -- > 1.8.5.6
2015 Apr 17
0
[PATCH] Revert "vhost: fix release path lockdep checks"
...vhost_dev *dev, bool locked) +/* Caller should have device mutex */ +void vhost_dev_cleanup(struct vhost_dev *dev) { int i; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..cc9a742 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -127,7 +127,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); struct vhost_memory *vhost_dev_reset_owner_prepare(void); void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_memory *); -void vhost_dev_cleanup(struct vhost_dev *, bool locked); +void vhost_dev_cleanup(struct vhost_...
2015 Apr 17
0
[PATCH RESEND] Revert "vhost: fix release path lockdep checks"
...vhost_dev *dev, bool locked) +/* Caller should have device mutex */ +void vhost_dev_cleanup(struct vhost_dev *dev) { int i; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 8c1c792..cc9a742 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -127,7 +127,7 @@ bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); struct vhost_memory *vhost_dev_reset_owner_prepare(void); void vhost_dev_reset_owner(struct vhost_dev *, struct vhost_memory *); -void vhost_dev_cleanup(struct vhost_dev *, bool locked); +void vhost_dev_cleanup(struct vhost_...
2018 Dec 28
0
[RFC PATCH V2 3/3] vhost: access vq metadata through kernel virtual address
...set(&vq->avail_ring, 0, sizeof(vq->avail_ring)); + memset(&vq->used_ring, 0, sizeof(vq->used_ring)); + memset(&vq->desc_ring, 0, sizeof(vq->desc_ring)); mutex_init(&vq->mutex); vhost_vq_reset(dev, vq); if (vq->handle_kick) @@ -489,6 +492,61 @@ bool vhost_dev_has_owner(struct vhost_dev *dev) } EXPORT_SYMBOL_GPL(vhost_dev_has_owner); +static int vhost_invalidate_vmap(struct vhost_virtqueue *vq, + struct vhost_vmap *map, + unsigned long uaddr, + unsigned long start, + unsigned long end, + bool blockable) +{ + if (start < uaddr &&...
2019 Sep 25
0
[PATCH] vhost: It's better to use size_t for the 3rd parameter of vhost_exceeds_weight()
...gt;> void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, >> - int nvqs, int iov_limit, int weight, int byte_weight); >> + int nvqs, int iov_limit, int weight, size_t byte_weight); >> long vhost_dev_set_owner(struct vhost_dev *dev); bool >> vhost_dev_has_owner(struct vhost_dev *dev); long >> vhost_dev_check_owner(struct vhost_dev *); >> -- >> 1.8.5.6
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...t_umem *umem; - struct vhost_umem *iotlb; - spinlock_t iotlb_lock; - struct list_head read_list; - struct list_head pending_list; - wait_queue_head_t wait; -}; - -void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, int nvqs); -long vhost_dev_set_owner(struct vhost_dev *dev); -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_stop(struct vhost_dev *);...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...t_umem *umem; - struct vhost_umem *iotlb; - spinlock_t iotlb_lock; - struct list_head read_list; - struct list_head pending_list; - wait_queue_head_t wait; -}; - -void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, int nvqs); -long vhost_dev_set_owner(struct vhost_dev *dev); -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_stop(struct vhost_dev *);...
2018 Dec 10
1
[PATCH net 4/4] vhost: log dirty page correctly
...ivers//vhost/vhost.c:__vhost_vq_meta_reset Cyclomatic Complexity 2 drivers//vhost/vhost.c:vhost_vq_meta_reset Cyclomatic Complexity 1 drivers//vhost/vhost.c:vhost_vq_reset Cyclomatic Complexity 2 drivers//vhost/vhost.c:vhost_dev_check_owner Cyclomatic Complexity 1 drivers//vhost/vhost.c:vhost_dev_has_owner vim +1771 drivers//vhost/vhost.c 1760 1761 static void log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) 1762 { 1763 struct iovec iov[64]; 1764 int i, ret; 1765 1766 if (!vq->iotlb) { 1767 log_write(vq->log_base, vq->log_addr + used_offset, len); 176...
2019 May 17
0
[PATCH V2 1/4] vhost: introduce vhost_exceeds_weight()
...ol vhost_exceeds_weight(struct vhost_virtqueue *vq, int pkts, int total_len); void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, - int nvqs, int iov_limit); + int nvqs, int iov_limit, int weight, int byte_weight); long vhost_dev_set_owner(struct vhost_dev *dev); bool vhost_dev_has_owner(struct vhost_dev *dev); long vhost_dev_check_owner(struct vhost_dev *); diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb5fc0e..47c6d4d 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -21,6 +21,14 @@ #include "vhost.h" #define VHOST_VSOCK_DEFAULT_H...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...; - spinlock_t iotlb_lock; > - struct list_head read_list; > - struct list_head pending_list; > - wait_queue_head_t wait; > -}; > - > -void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, int nvqs); > -long vhost_dev_set_owner(struct vhost_dev *dev); > -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_...
2018 Dec 28
4
[RFC PATCH V2 0/3] vhost: accelerate metadata access through vmap()
Hi: This series tries to access virtqueue metadata through kernel virtual address instead of copy_user() friends since they had too much overheads like checks, spec barriers or even hardware feature toggling. Test shows about 24% improvement on TX PPS. It should benefit other cases as well. Changes from V1: - instead of pinning pages, use MMU notifier to invalidate vmaps and remap duing