search for: vhost_iotlb_add_range

Displaying 11 results from an estimated 11 matches for "vhost_iotlb_add_range".

2020 Jul 31
0
[PATCH] vdpasim: protect concurrent access to iommu iotlb
...gt;iommu_lock); vdpasim->features = 0; vdpasim->status = 0; @@ -236,8 +240,10 @@ static dma_addr_t vdpasim_map_page(struct device *dev, struct page *page, /* For simplicity, use identical mapping to avoid e.g iova * allocator. */ + spin_lock(&vdpasim->iommu_lock); ret = vhost_iotlb_add_range(iommu, pa, pa + size - 1, pa, dir_to_perm(dir)); + spin_unlock(&vdpasim->iommu_lock); if (ret) return DMA_MAPPING_ERROR; @@ -251,8 +257,10 @@ static void vdpasim_unmap_page(struct device *dev, dma_addr_t dma_addr, struct vdpasim *vdpasim = dev_to_sim(dev); struct vhost_io...
2020 Feb 20
0
[PATCH V3 1/5] vhost: factor out IOTLB
...otlb_msg *msg) { @@ -1117,9 +1053,9 @@ static int vhost_process_iotlb_msg(struct vhost_dev *dev, break; } vhost_vq_meta_reset(dev); - if (vhost_new_umem_range(dev->iotlb, msg->iova, msg->size, - msg->iova + msg->size - 1, - msg->uaddr, msg->perm)) { + if (vhost_iotlb_add_range(dev->iotlb, msg->iova, + msg->iova + msg->size - 1, + msg->uaddr, msg->perm)) { ret = -ENOMEM; break; } @@ -1131,8 +1067,8 @@ static int vhost_process_iotlb_msg(struct vhost_dev *dev, break; } vhost_vq_meta_reset(dev); - vhost_del_umem_range(dev-&...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...sim(vdpa); + struct vhost_iotlb *iommu = vdpasim->iommu; + u64 pa = (page_to_pfn(page) << PAGE_SHIFT) + offset; + int ret, perm = dir_to_perm(dir); + + if (perm < 0) + return DMA_MAPPING_ERROR; + + /* For simplicity, use identical mapping to avoid e.g iova + * allocator. + */ + ret = vhost_iotlb_add_range(iommu, pa, pa + size - 1, + pa, dir_to_perm(dir)); + if (ret) + return DMA_MAPPING_ERROR; + + return (dma_addr_t)(pa); +} + +static void vdpasim_unmap_page(struct device *dev, dma_addr_t dma_addr, + size_t size, enum dma_data_direction dir, + unsigned long attrs) +{ + stru...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
..._sim(dev); + struct vhost_iotlb *iommu = vdpasim->iommu; + u64 pa = (page_to_pfn(page) << PAGE_SHIFT) + offset; + int ret, perm = dir_to_perm(dir); + + if (perm < 0) + return DMA_MAPPING_ERROR; + + /* For simplicity, use identical mapping to avoid e.g iova + * allocator. + */ + ret = vhost_iotlb_add_range(iommu, pa, pa + size - 1, + pa, dir_to_perm(dir)); + if (ret) + return DMA_MAPPING_ERROR; + + return (dma_addr_t)(pa); +} + +static void vdpasim_unmap_page(struct device *dev, dma_addr_t dma_addr, + size_t size, enum dma_data_direction dir, + unsigned long attrs) +{ + stru...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...gt;iommu; > + u64 pa = (page_to_pfn(page) << PAGE_SHIFT) + offset; > + int ret, perm = dir_to_perm(dir); > + > + if (perm < 0) > + return DMA_MAPPING_ERROR; > + > + /* For simplicity, use identical mapping to avoid e.g iova > + * allocator. > + */ > + ret = vhost_iotlb_add_range(iommu, pa, pa + size - 1, > + pa, dir_to_perm(dir)); > + if (ret) > + return DMA_MAPPING_ERROR; > + > + return (dma_addr_t)(pa); > +} > + > +static void vdpasim_unmap_page(struct device *dev, dma_addr_t dma_addr, > + size_t size, enum dma_data_direction d...
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 04
0
[PATCH 5/5] vdpasim: vDPA device simulator
...Jason Wang 2020-01-16 274 *dma_addr = DMA_MAPPING_ERROR; > 55047769b3e974 Jason Wang 2020-01-16 275 else { > 55047769b3e974 Jason Wang 2020-01-16 276 u64 pa = virt_to_phys(addr); > 55047769b3e974 Jason Wang 2020-01-16 277 > 55047769b3e974 Jason Wang 2020-01-16 278 ret = vhost_iotlb_add_range(iommu, (u64)pa, > 55047769b3e974 Jason Wang 2020-01-16 279 (u64)pa + size - 1, > 55047769b3e974 Jason Wang 2020-01-16 280 pa, VHOST_MAP_RW); > 55047769b3e974 Jason Wang 2020-01-16 281 if (ret) { > 55047769b3e974 Jason Wang 2020-01-16 282 kfree(addr); >...
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 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 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is
2020 Sep 24
30
[RFC PATCH 00/24] Control VQ support in vDPA
Hi All: This series tries to add the support for control virtqueue in vDPA. Control virtqueue is used by networking device for accepting various commands from the driver. It's a must to support multiqueue and other configurations. When used by vhost-vDPA bus driver for VM, the control virtqueue should be shadowed via userspace VMM (Qemu) instead of being assigned directly to Guest. This is