search for: vhost_iotlb_itree_first

Displaying 20 results from an estimated 24 matches for "vhost_iotlb_itree_first".

2020 Sep 17
1
[PATCH v2 -next] vdpa: mlx5: change Kconfig depends to fix build errors
From: Randy Dunlap <rdunlap at infradead.org> drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so add a dependency on VHOST to eliminate build errors. ld: drivers/vdpa/mlx5/core/mr.o: in function `add_direct_chain': mr.c:(.text+0x106): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x1cf): undefined reference to `vhost_iotlb_itree_next' ld: mr.c:(.text+0x30d): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x3e8): undefined reference to `vhost_iotlb_itree_next' ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_m...
2020 Jul 16
0
[PATCH vhost next 05/10] vhost: Fix documentation
...1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c > index 1f0ca6e44410..0d4213a54a88 100644 > --- a/drivers/vhost/iotlb.c > +++ b/drivers/vhost/iotlb.c > @@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_free); > * vhost_iotlb_itree_first - return the first overlapped range > * @iotlb: the IOTLB > * @start: start of IOVA range > - * @end: end of IOVA range > + * @last: last byte in IOVA range > */ > struct vhost_iotlb_map * > vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last) &g...
2020 Jul 21
0
[PATCH V2 vhost next 05/10] vhost: Fix documentation
...1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c > index 1f0ca6e44410..0d4213a54a88 100644 > --- a/drivers/vhost/iotlb.c > +++ b/drivers/vhost/iotlb.c > @@ -149,7 +149,7 @@ EXPORT_SYMBOL_GPL(vhost_iotlb_free); > * vhost_iotlb_itree_first - return the first overlapped range > * @iotlb: the IOTLB > * @start: start of IOVA range > - * @end: end of IOVA range > + * @last: last byte in IOVA range > */ > struct vhost_iotlb_map * > vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last) &g...
2020 Sep 17
0
[PATCH -next] vdpa: mlx5: select VHOST to fix build errors
From: Randy Dunlap <rdunlap at infradead.org> drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so select VHOST to eliminate build errors. ld: drivers/vdpa/mlx5/core/mr.o: in function `add_direct_chain': mr.c:(.text+0x106): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x1cf): undefined reference to `vhost_iotlb_itree_next' ld: mr.c:(.text+0x30d): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x3e8): undefined reference to `vhost_iotlb_itree_next' ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_m...
2020 Sep 18
0
[PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors
From: Randy Dunlap <rdunlap at infradead.org> drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so add a dependency on VHOST to eliminate build errors. ld: drivers/vdpa/mlx5/core/mr.o: in function `add_direct_chain': mr.c:(.text+0x106): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x1cf): undefined reference to `vhost_iotlb_itree_next' ld: mr.c:(.text+0x30d): undefined reference to `vhost_iotlb_itree_first' ld: mr.c:(.text+0x3e8): undefined reference to `vhost_iotlb_itree_next' ld: drivers/vdpa/mlx5/core/mr.o: in function `_mlx5_vdpa_create_m...
2020 Sep 24
0
[PATCH v3 -next] vdpa: mlx5: change Kconfig depends to fix build errors
...t infradead.org> > > > > drivers/vdpa/mlx5/ uses vhost_iotlb*() interfaces, so add a dependency > > on VHOST to eliminate build errors. > > > > ld: drivers/vdpa/mlx5/core/mr.o: in function `add_direct_chain': > > mr.c:(.text+0x106): undefined reference to `vhost_iotlb_itree_first' > > ld: mr.c:(.text+0x1cf): undefined reference to `vhost_iotlb_itree_next' > > ld: mr.c:(.text+0x30d): undefined reference to `vhost_iotlb_itree_first' > > ld: mr.c:(.text+0x3e8): undefined reference to `vhost_iotlb_itree_next' > > ld: drivers/vdpa/mlx5/cor...
2020 Aug 25
0
[PATCH] vhost-iotlb: fix vhost_iotlb_itree_next() documentation
...zarella <sgarzare at redhat.com> --- drivers/vhost/iotlb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c index 1f0ca6e44410..34aec4ba331e 100644 --- a/drivers/vhost/iotlb.c +++ b/drivers/vhost/iotlb.c @@ -159,8 +159,8 @@ vhost_iotlb_itree_first(struct vhost_iotlb *iotlb, u64 start, u64 last) EXPORT_SYMBOL_GPL(vhost_iotlb_itree_first); /** - * vhost_iotlb_itree_first - return the next overlapped range - * @iotlb: the IOTLB + * vhost_iotlb_itree_next - return the next overlapped range + * @map: the starting map node * @start: start of...
2020 Feb 20
0
[PATCH V3 1/5] vhost: factor out IOTLB
..., orig_addr = addr, last = addr + len - 1; if (vhost_vq_meta_fetch(vq, addr, len, type)) return true; while (len > s) { - node = vhost_umem_interval_tree_iter_first(&umem->umem_tree, - addr, - last); - if (node == NULL || node->start > addr) { + map = vhost_iotlb_itree_first(umem, addr, last); + if (map == NULL || map->start > addr) { vhost_iotlb_miss(vq, addr, access); return false; - } else if (!(node->perm & access)) { + } else if (!(map->perm & access)) { /* Report the possible access violation by * request another translatio...
2023 Feb 16
0
[PATCH v2] vhost/vdpa: Add MSI translation tables to iommu for software-managed MSI
...st_iotlb_reset(&v->resv_iotlb); > + > return vdpa_reset(vdpa); > } > > @@ -1013,6 +1016,10 @@ static int vhost_vdpa_process_iotlb_update(struct vhost_vdpa *v, > msg->iova + msg->size - 1 > v->range.last) > return -EINVAL; > > + if (vhost_iotlb_itree_first(&v->resv_iotlb, msg->iova, > + msg->iova + msg->size - 1)) > + return -EINVAL; > + > if (vhost_iotlb_itree_first(iotlb, msg->iova, > msg->iova + msg->size - 1)) > return -EEXIST; > @@ -1103,6 +1110,45 @@ static ssize_t vhost_vdpa_c...
2020 Jul 16
0
[PATCH vhost next 09/10] vdpa/mlx5: Add shared memory registration code
...2 unsigned long size; 223 u64 start = 0; 224 int err; 225 struct page *pg; 226 unsigned int nsg; 227 int sglen; 228 u64 pa; 229 u64 paend; 230 struct scatterlist *sg; 231 struct device *dma = mvdev->mdev->device; 232 int ret; 233 234 for (map = vhost_iotlb_itree_first(iotlb, mr->start, mr->end - 1); 235 map; map = vhost_iotlb_itree_next(map, start, mr->end - 1)) { 236 size = maplen(map, mr); 237 lgcd = gcd(lgcd, size); 238 start += size; 239 } 240 log_entity_size = ilog2(lgcd); 241 242 sglen = 1 << log_entit...
2020 Jul 31
0
[PATCH] vdpasim: protect concurrent access to iommu iotlb
...amp;vdpasim->iommu_lock); + kfree(phys_to_virt((uintptr_t)dma_addr)); } @@ -532,6 +545,7 @@ static int vdpasim_set_map(struct vdpa_device *vdpa, u64 start = 0ULL, last = 0ULL - 1; int ret; + spin_lock(&vdpasim->iommu_lock); vhost_iotlb_reset(vdpasim->iommu); for (map = vhost_iotlb_itree_first(iotlb, start, last); map; @@ -541,10 +555,12 @@ static int vdpasim_set_map(struct vdpa_device *vdpa, if (ret) goto err; } + spin_unlock(&vdpasim->iommu_lock); return 0; err: vhost_iotlb_reset(vdpasim->iommu); + spin_unlock(&vdpasim->iommu_lock); return ret; } @...
2020 Nov 03
0
[PATCH 1/2] Revert "vhost-vdpa: fix page pinning leakage in error path"
...n, last_pfn = 0; > - unsigned long npages, lock_limit; > - unsigned long i, nmap = 0; > + unsigned long npages, cur_base, map_pfn, last_pfn = 0; > + unsigned long locked, lock_limit, pinned, i; > u64 iova = msg->iova; > - long pinned; > int ret = 0; > > if (vhost_iotlb_itree_first(iotlb, msg->iova, > msg->iova + msg->size - 1)) > return -EEXIST; > > + page_list = (struct page **) __get_free_page(GFP_KERNEL); > + if (!page_list) > + return -ENOMEM; > + > if (msg->perm & VHOST_ACCESS_WO) > gup_flags |= FOLL_WR...
2020 Feb 20
5
[PATCH V4 0/5] vDPA support
Hi all: This is an update version of vDPA support in kernel. vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or emulated by software. vDPA hardware devices are usually implemented through PCIE with the following types: - PF (Physical Function) - A single
2020 Feb 10
9
[PATCH V2 0/5] vDPA support
Hi all: This is an updated version of kernel support for vDPA device. Various changes were made based on the feedback since last verion. One major change is to drop the sysfs API and leave the management interface for future development, and introudce the incremental DMA bus operations. Please see changelog for more information. The work on vhost, IFCVF (intel VF driver for vDPA) and qemu is
2020 Feb 20
9
[PATCH V3 0/5] vDPA support
Hi all: This is an update version of vDPA support in kernel. vDPA device is a device that uses a datapath which complies with the virtio specifications with vendor specific control path. vDPA devices can be both physically located on the hardware or emulated by software. vDPA hardware devices are usually implemented through PCIE with the following types: - PF (Physical Function) - A single
2020 Oct 01
0
[PATCH] vhost-vdpa: fix page pinning leakage in error path
...gup_flags = FOLL_LONGTERM; - unsigned long npages, cur_base, map_pfn, last_pfn = 0; - unsigned long locked, lock_limit, pinned, i; + unsigned long map_pfn, last_pfn = 0; + unsigned long npages, lock_limit; + unsigned long i, nmap = 0; u64 iova = msg->iova; + long pinned; int ret = 0; if (vhost_iotlb_itree_first(iotlb, msg->iova, msg->iova + msg->size - 1)) return -EEXIST; - page_list = (struct page **) __get_free_page(GFP_KERNEL); - if (!page_list) - return -ENOMEM; - if (msg->perm & VHOST_ACCESS_WO) gup_flags |= FOLL_WRITE; @@ -614,61 +614,86 @@ static int vhost_vdpa...
2020 Oct 01
0
[PATCH v2] vhost-vdpa: fix page pinning leakage in error path
...gup_flags = FOLL_LONGTERM; - unsigned long npages, cur_base, map_pfn, last_pfn = 0; - unsigned long locked, lock_limit, pinned, i; + unsigned long map_pfn, last_pfn = 0; + unsigned long npages, lock_limit; + unsigned long i, nmap = 0; u64 iova = msg->iova; + long pinned; int ret = 0; if (vhost_iotlb_itree_first(iotlb, msg->iova, msg->iova + msg->size - 1)) return -EEXIST; - page_list = (struct page **) __get_free_page(GFP_KERNEL); - if (!page_list) - return -ENOMEM; - if (msg->perm & VHOST_ACCESS_WO) gup_flags |= FOLL_WRITE; @@ -614,61 +614,86 @@ static int vhost_vdpa...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...asim->generation; +} + +static int vdpasim_set_map(struct vdpa_device *vdpa, + struct vhost_iotlb *iotlb) +{ + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct vhost_iotlb_map *map; + u64 start = 0ULL, last = 0ULL - 1; + int ret; + + vhost_iotlb_reset(vdpasim->iommu); + + for (map = vhost_iotlb_itree_first(iotlb, start, last); map; + map = vhost_iotlb_itree_next(map, start, last)) { + ret = vhost_iotlb_add_range(vdpasim->iommu, map->start, + map->last, map->addr, map->perm); + if (ret) + goto err; + } + return 0; + +err: + vhost_iotlb_reset(vdpasim->iommu); + return...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...asim->generation; +} + +static int vdpasim_set_map(struct vdpa_device *vdpa, + struct vhost_iotlb *iotlb) +{ + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct vhost_iotlb_map *map; + u64 start = 0ULL, last = 0ULL - 1; + int ret; + + vhost_iotlb_reset(vdpasim->iommu); + + for (map = vhost_iotlb_itree_first(iotlb, start, last); map; + map = vhost_iotlb_itree_next(map, start, last)) { + ret = vhost_iotlb_add_range(vdpasim->iommu, map->start, + map->last, map->addr, map->perm); + if (ret) + goto err; + } + return 0; + +err: + vhost_iotlb_reset(vdpasim->iommu); + return...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...map(struct vdpa_device *vdpa, > + struct vhost_iotlb *iotlb) > +{ > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + struct vhost_iotlb_map *map; > + u64 start = 0ULL, last = 0ULL - 1; > + int ret; > + > + vhost_iotlb_reset(vdpasim->iommu); > + > + for (map = vhost_iotlb_itree_first(iotlb, start, last); map; > + map = vhost_iotlb_itree_next(map, start, last)) { > + ret = vhost_iotlb_add_range(vdpasim->iommu, map->start, > + map->last, map->addr, map->perm); > + if (ret) > + goto err; > + } > + return 0; > + > +err: &gt...