search for: vhost_access_wo

Displaying 20 results from an estimated 131 matches for "vhost_access_wo".

Did you mean: vhost_access_ro
2019 Feb 19
2
[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed
...ers/vhost/vhost.c index 24a129fcdd61..a9a1709a859a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1788,7 +1788,7 @@ static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, len, iov, 64, VHOST_ACCESS_WO); - if (ret) + if (ret <= 0) return ret; for (i = 0; i < ret; i++) { -- 2.20.1
2019 Feb 19
2
[PATCH][next] vhost: only return early if ret indicates an error or no iovecs have been processed
...ers/vhost/vhost.c index 24a129fcdd61..a9a1709a859a 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1788,7 +1788,7 @@ static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, len, iov, 64, VHOST_ACCESS_WO); - if (ret) + if (ret <= 0) return ret; for (i = 0; i < ret; i++) { -- 2.20.1
2020 Apr 07
0
[PATCH v7 18/19] vhost: use batched version by default
...cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); - return -EINVAL; - } - - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) - access = VHOST_ACCESS_WO; - else - access = VHOST_ACCESS_RO; - - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), - vhost32_to_cpu(vq, desc.len), iov + iov_count, - iov_size - iov_count, access); - if (unlikely(ret < 0)) { - if (ret != -EAGAIN) - vq_err(vq, "Translation failure %d i...
2020 Apr 07
0
[PATCH v8 18/19] vhost: use batched version by default
...cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); - return -EINVAL; - } - - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) - access = VHOST_ACCESS_WO; - else - access = VHOST_ACCESS_RO; - - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), - vhost32_to_cpu(vq, desc.len), iov + iov_count, - iov_size - iov_count, access); - if (unlikely(ret < 0)) { - if (ret != -EAGAIN) - vq_err(vq, "Translation failure %d i...
2020 Jun 02
0
[PATCH RFC 02/13] vhost: use batched version by default
...cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); - return -EINVAL; - } - - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) - access = VHOST_ACCESS_WO; - else - access = VHOST_ACCESS_RO; - - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), - vhost32_to_cpu(vq, desc.len), iov + iov_count, - iov_size - iov_count, access); - if (unlikely(ret < 0)) { - if (ret != -EAGAIN) - vq_err(vq, "Translation failure %d i...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...IRECT))) { > - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", > - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); > - return -EINVAL; > - } > - > - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) > - access = VHOST_ACCESS_WO; > - else > - access = VHOST_ACCESS_RO; > - > - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), > - vhost32_to_cpu(vq, desc.len), iov + iov_count, > - iov_size - iov_count, access); > - if (unlikely(ret < 0)) { > - if (ret != -EAGAIN) > -...
2020 Jun 10
2
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...IRECT))) { > - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", > - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); > - return -EINVAL; > - } > - > - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) > - access = VHOST_ACCESS_WO; > - else > - access = VHOST_ACCESS_RO; > - > - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), > - vhost32_to_cpu(vq, desc.len), iov + iov_count, > - iov_size - iov_count, access); > - if (unlikely(ret < 0)) { > - if (ret != -EAGAIN) > -...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...nse? >> >> Thanks > to make sure, could you post the suggested argument format for > these ioctls? > It's the existed uapi: /* no alignment requirement */ struct vhost_iotlb_msg { ??? __u64 iova; ??? __u64 size; ??? __u64 uaddr; #define VHOST_ACCESS_RO????? 0x1 #define VHOST_ACCESS_WO????? 0x2 #define VHOST_ACCESS_RW????? 0x3 ??? __u8 perm; #define VHOST_IOTLB_MISS?????????? 1 #define VHOST_IOTLB_UPDATE???????? 2 #define VHOST_IOTLB_INVALIDATE???? 3 #define VHOST_IOTLB_ACCESS_FAIL??? 4 ??? __u8 type; }; #define VHOST_IOTLB_MSG 0x1 #define VHOST_IOTLB_MSG_V2 0x2 struct vhost_...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...nse? >> >> Thanks > to make sure, could you post the suggested argument format for > these ioctls? > It's the existed uapi: /* no alignment requirement */ struct vhost_iotlb_msg { ??? __u64 iova; ??? __u64 size; ??? __u64 uaddr; #define VHOST_ACCESS_RO????? 0x1 #define VHOST_ACCESS_WO????? 0x2 #define VHOST_ACCESS_RW????? 0x3 ??? __u8 perm; #define VHOST_IOTLB_MISS?????????? 1 #define VHOST_IOTLB_UPDATE???????? 2 #define VHOST_IOTLB_INVALIDATE???? 3 #define VHOST_IOTLB_ACCESS_FAIL??? 4 ??? __u8 type; }; #define VHOST_IOTLB_MSG 0x1 #define VHOST_IOTLB_MSG_V2 0x2 struct vhost_...
2020 Jun 11
0
[PATCH RFC v8 02/11] vhost: use batched get_vq_desc version
...cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); - return -EINVAL; - } - - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) - access = VHOST_ACCESS_WO; - else - access = VHOST_ACCESS_RO; - - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), - vhost32_to_cpu(vq, desc.len), iov + iov_count, - iov_size - iov_count, access); - if (unlikely(ret < 0)) { - if (ret != -EAGAIN) - vq_err(vq, "Translation failure %d i...
2020 Jun 08
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
...cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { - vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); - return -EINVAL; - } - - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) - access = VHOST_ACCESS_WO; - else - access = VHOST_ACCESS_RO; - - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), - vhost32_to_cpu(vq, desc.len), iov + iov_count, - iov_size - iov_count, access); - if (unlikely(ret < 0)) { - if (ret != -EAGAIN) - vq_err(vq, "Translation failure %d i...
2020 Jun 10
0
[PATCH RFC v6 02/11] vhost: use batched get_vq_desc version
..."Nested indirect descriptor: idx %d, %zx\n", > > - i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); > > - return -EINVAL; > > - } > > - > > - if (desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_WRITE)) > > - access = VHOST_ACCESS_WO; > > - else > > - access = VHOST_ACCESS_RO; > > - > > - ret = translate_desc(vq, vhost64_to_cpu(vq, desc.addr), > > - vhost32_to_cpu(vq, desc.len), iov + iov_count, > > - iov_size - iov_count, access); > > - if (unlikely(ret < 0)) {...
2019 Feb 15
5
[PATCH net] vhost: correctly check the return value of translate_desc() in log_used()
...ers/vhost/vhost.c index 24a129fcdd61..a2e5dc7716e2 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1788,7 +1788,7 @@ static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, len, iov, 64, VHOST_ACCESS_WO); - if (ret) + if (ret < 0) return ret; for (i = 0; i < ret; i++) { -- 2.17.1
2019 Feb 15
5
[PATCH net] vhost: correctly check the return value of translate_desc() in log_used()
...ers/vhost/vhost.c index 24a129fcdd61..a2e5dc7716e2 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -1788,7 +1788,7 @@ static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len) ret = translate_desc(vq, (uintptr_t)vq->used + used_offset, len, iov, 64, VHOST_ACCESS_WO); - if (ret) + if (ret < 0) return ret; for (i = 0; i < ret; i++) { -- 2.17.1
2019 Oct 11
0
[vhost:vhost 6/6] drivers/vhost/vhost.c:2672:9: error: 'desc' undeclared; did you mean 'rdtsc'?
...(desc->flags & ~VHOST_DESC_FLAGS) { 2621 vq_err(vq, "Unexpected flags: 0x%x at descriptor id 0x%x\n", 2622 desc->flags, desc->id); 2623 ret = -EINVAL; 2624 goto err; 2625 } 2626 if (desc->flags & VRING_DESC_F_WRITE) 2627 access = VHOST_ACCESS_WO; 2628 else 2629 access = VHOST_ACCESS_RO; 2630 ret = translate_desc(vq, desc->addr, 2631 desc->len, iov + iov_count, 2632 iov_size - iov_count, access); 2633 if (unlikely(ret < 0)) { 2634 if (ret != -EAGAIN) 2635 vq_err(vq, "Translatio...
2019 Oct 11
0
[vhost:vhost 6/6] drivers/vhost/vhost.c:2672:9: error: 'desc' undeclared
...(desc->flags & ~VHOST_DESC_FLAGS) { 2621 vq_err(vq, "Unexpected flags: 0x%x at descriptor id 0x%x\n", 2622 desc->flags, desc->id); 2623 ret = -EINVAL; 2624 goto err; 2625 } 2626 if (desc->flags & VRING_DESC_F_WRITE) 2627 access = VHOST_ACCESS_WO; 2628 else 2629 access = VHOST_ACCESS_RO; 2630 ret = translate_desc(vq, desc->addr, 2631 desc->len, iov + iov_count, 2632 iov_size - iov_count, access); 2633 if (unlikely(ret < 0)) { 2634 if (ret != -EAGAIN) 2635 vq_err(vq, "Translatio...
2016 Jun 23
3
[PATCH V2 0/3] basic device IOTLB support for vhost_net
...IOTLB for virtqueue accessing, but I think it's better to do this on top. Changes from V1: - Fix i386 build warnings - Drop access paramter for vhost_get_vq_desc() (fix VHOST SCSI build error) Changes from RFC V3: - rebase on latest - minor tweak on commit log - use VHOST_ACCESS_RO instead of VHOST_ACCESS_WO in vhost_copy_from_user() - switch to use atomic userspace access helper in vhost_get/put_user() - remove debug codes in vhost_iotlb_miss() - use FIFO instead of FILO when doing TLB replacement - fix unbalanced lock in vhost_process_iotlb_msg() Changes from RFC V2: - introduce memory accessors for...
2016 Jun 23
3
[PATCH V2 0/3] basic device IOTLB support for vhost_net
...IOTLB for virtqueue accessing, but I think it's better to do this on top. Changes from V1: - Fix i386 build warnings - Drop access paramter for vhost_get_vq_desc() (fix VHOST SCSI build error) Changes from RFC V3: - rebase on latest - minor tweak on commit log - use VHOST_ACCESS_RO instead of VHOST_ACCESS_WO in vhost_copy_from_user() - switch to use atomic userspace access helper in vhost_get/put_user() - remove debug codes in vhost_iotlb_miss() - use FIFO instead of FILO when doing TLB replacement - fix unbalanced lock in vhost_process_iotlb_msg() Changes from RFC V2: - introduce memory accessors for...
2016 Dec 14
1
[PATCH V2] vhost: introduce O(1) vq metadata cache
...; + void __user *uaddr = vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)to, size, + VHOST_ADDR_DESC); + + if (uaddr) + return __copy_to_user(uaddr, from, size); + ret = translate_desc(vq, (u64)(uintptr_t)to, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_WO); @@ -761,8 +796,14 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, * could be access through iotlb. So -EAGAIN should * not happen in this case. */ - /* TODO: more fast path */ + void __user *uaddr = vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, siz...
2016 Dec 14
1
[PATCH V2] vhost: introduce O(1) vq metadata cache
...; + void __user *uaddr = vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)to, size, + VHOST_ADDR_DESC); + + if (uaddr) + return __copy_to_user(uaddr, from, size); + ret = translate_desc(vq, (u64)(uintptr_t)to, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_WO); @@ -761,8 +796,14 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, * could be access through iotlb. So -EAGAIN should * not happen in this case. */ - /* TODO: more fast path */ + void __user *uaddr = vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, siz...