search for: vhost_access_ro

Displaying 20 results from an estimated 128 matches for "vhost_access_ro".

2018 May 16
0
[RFC V4 PATCH 8/8] vhost: event suppression for packed ring
...virtqueue *vq, unsigned int num, @@ -1186,14 +1191,27 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) +{ + int num = vq->num; + + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_RO, + (u6...
2018 Mar 26
0
[RFC PATCH V2 8/8] vhost: event suppression for packed ring
..._virtqueue *vq, unsigned int num, @@ -1222,14 +1227,27 @@ static int iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) +{ + int num = vq->num; + + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_RO, + (u6...
2018 Jul 03
0
[PATCH net-next 8/8] vhost: event suppression for packed ring
...virtqueue *vq, unsigned int num, @@ -1193,14 +1198,27 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) +{ + int num = vq->num; + + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_RO, + (u6...
2016 Dec 14
1
[PATCH V2] vhost: introduce O(1) vq metadata cache
...vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, size, + VHOST_ADDR_DESC); struct iov_iter f; + + if (uaddr) + return __copy_from_user(to, uaddr, size); + ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_RO); @@ -782,17 +823,12 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, return ret; } -static void __user *__vhost_get_user(struct vhost_virtqueue *vq, - void *addr, unsigned size) +static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, + void...
2016 Dec 14
1
[PATCH V2] vhost: introduce O(1) vq metadata cache
...vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, size, + VHOST_ADDR_DESC); struct iov_iter f; + + if (uaddr) + return __copy_from_user(to, uaddr, size); + ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_RO); @@ -782,17 +823,12 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, return ret; } -static void __user *__vhost_get_user(struct vhost_virtqueue *vq, - void *addr, unsigned size) +static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, + void...
2018 May 29
0
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...virtqueue *vq, unsigned int num, @@ -1190,14 +1195,27 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, return true; } -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) +{ + int num = vq->num; + + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + iotlb_access_ok(vq, VHOST_ACCESS_RO, + (u6...
2016 Jun 22
0
[PATCH 3/3] vhost: device IOTLB API
...CE_IOTLB) }; enum { @@ -334,7 +335,8 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net, { unsigned long uninitialized_var(endtime); int r = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - out_num, in_num, NULL, NULL); + out_num, in_num, NULL, NULL, + VHOST_ACCESS_RO); if (r == vq->num && vq->busyloop_timeout) { preempt_disable(); @@ -344,7 +346,8 @@ static int vhost_net_tx_get_vq_desc(struct vhost_net *net, cpu_relax_lowlatency(); preempt_enable(); r = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), - out_num, in_nu...
2016 Dec 14
2
[PATCH] vhost: introduce O(1) vq metadata cache
...vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, size, + VHOST_ADDR_DESC); struct iov_iter f; + + if (uaddr) + return __copy_from_user(to, uaddr, size); + ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_RO); @@ -782,17 +823,12 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, return ret; } -static void __user *__vhost_get_user(struct vhost_virtqueue *vq, - void *addr, unsigned size) +static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, + void...
2016 Dec 14
2
[PATCH] vhost: introduce O(1) vq metadata cache
...vhost_vq_meta_fetch(vq, + (u64)(uintptr_t)from, size, + VHOST_ADDR_DESC); struct iov_iter f; + + if (uaddr) + return __copy_from_user(to, uaddr, size); + ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, ARRAY_SIZE(vq->iotlb_iov), VHOST_ACCESS_RO); @@ -782,17 +823,12 @@ static int vhost_copy_from_user(struct vhost_virtqueue *vq, void *to, return ret; } -static void __user *__vhost_get_user(struct vhost_virtqueue *vq, - void *addr, unsigned size) +static void __user *__vhost_get_user_slow(struct vhost_virtqueue *vq, + void...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...+1195,27 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, > return true; > } > > -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) > +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) > +{ > + int num = vq->num; > + > + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, > + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, > + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + iotlb_access_ok(vq, VHOST_ACCES...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...+1195,27 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, > return true; > } > > -int vq_iotlb_prefetch(struct vhost_virtqueue *vq) > +int vq_iotlb_prefetch_packed(struct vhost_virtqueue *vq) > +{ > + int num = vq->num; > + > + return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, > + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + iotlb_access_ok(vq, VHOST_ACCESS_WO, (u64)(uintptr_t)vq->desc, > + num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + iotlb_access_ok(vq, VHOST_ACCES...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...chael, do you think this makes sense? >> >> 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 VHOS...
2020 Feb 05
2
[PATCH] vhost: introduce vDPA based backend
...chael, do you think this makes sense? >> >> 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 VHOS...
2019 Dec 18
0
[PATCH 1/1] drivers/vhost : Removes unnecessary 'else' in vhost_copy_from_user
...h time a new updating is coming. We can optimize this by only reset the metadata IOTLB when the updating is for metdata. Want to try this? Thanks > > - ret = translate_desc(vq, (u64)(uintptr_t)from, size, vq->iotlb_iov, > - ARRAY_SIZE(vq->iotlb_iov), > - VHOST_ACCESS_RO); > - if (ret < 0) { > - vq_err(vq, "IOTLB translation failure: uaddr " > - "%p size 0x%llx\n", from, > - (unsigned long long) size); > - goto out; > - } > - iov_iter_init(&f, READ, vq->iotlb_iov, ret, size); > - ret =...
2019 Mar 06
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...1311,22 +1328,18 @@ static bool iotlb_access_ok(struct vhost_virtqueue *vq, int vq_meta_prefetch(struct vhost_virtqueue *vq) { - size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; unsigned int num = vq->num; if (!vq->iotlb) return 1; return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, - num * sizeof(*vq->desc), VHOST_ADDR_DESC) && + vhost_get_desc_size(vq, num), VHOST_ADDR_DESC) && iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->avail, - sizeof *vq->avail + - num * sizeof...
2019 Mar 07
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...st_virtqueue *vq) >> { >> - size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; >> unsigned int num = vq->num; >> >> if (!vq->iotlb) >> return 1; >> >> return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, >> - num * sizeof(*vq->desc), VHOST_ADDR_DESC) && >> + vhost_get_desc_size(vq, num), VHOST_ADDR_DESC) && >> iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...ess_ok(struct vhost_virtqueue *vq, > > int vq_meta_prefetch(struct vhost_virtqueue *vq) > { > - size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > unsigned int num = vq->num; > > if (!vq->iotlb) > return 1; > > return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, > - num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + vhost_get_desc_size(vq, num), VHOST_ADDR_DESC) && > iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->avail, > - sizeof *vq->avail + >...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...ess_ok(struct vhost_virtqueue *vq, > > int vq_meta_prefetch(struct vhost_virtqueue *vq) > { > - size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > unsigned int num = vq->num; > > if (!vq->iotlb) > return 1; > > return iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->desc, > - num * sizeof(*vq->desc), VHOST_ADDR_DESC) && > + vhost_get_desc_size(vq, num), VHOST_ADDR_DESC) && > iotlb_access_ok(vq, VHOST_ACCESS_RO, (u64)(uintptr_t)vq->avail, > - sizeof *vq->avail + >...
2016 Jun 22
4
[PATCH 0/3] basic device IOTLB support
..., no difference in 64B performance and I notice a 4%-5% drop for 1500B performance compare to UIO in guest. We can add some shortcut to bypass the IOTLB for virtqueue accessing, but I think it's better to do this on top. 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: - int...
2016 Jun 22
4
[PATCH 0/3] basic device IOTLB support
..., no difference in 64B performance and I notice a 4%-5% drop for 1500B performance compare to UIO in guest. We can add some shortcut to bypass the IOTLB for virtqueue accessing, but I think it's better to do this on top. 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: - int...