search for: vdpasim_free_coherent

Displaying 12 results from an estimated 12 matches for "vdpasim_free_coherent".

2020 Feb 04
2
[PATCH 5/5] vdpasim: vDPA device simulator
On 2020/2/4 ??4:21, Zhu Lingshan wrote: >> +static const struct dma_map_ops vdpasim_dma_ops = { >> +??? .map_page = vdpasim_map_page, >> +??? .unmap_page = vdpasim_unmap_page, >> +??? .alloc = vdpasim_alloc_coherent, >> +??? .free = vdpasim_free_coherent, >> +}; >> + > > Hey Jason, > > IMHO, it would be nice if dma_ops of the parent device could be > re-used. vdpa_device is expecting to represent a physical device > except this simulator, however, there are not enough information in > vdpa_device.dev to indicatin...
2020 Feb 04
2
[PATCH 5/5] vdpasim: vDPA device simulator
On 2020/2/4 ??4:21, Zhu Lingshan wrote: >> +static const struct dma_map_ops vdpasim_dma_ops = { >> +??? .map_page = vdpasim_map_page, >> +??? .unmap_page = vdpasim_unmap_page, >> +??? .alloc = vdpasim_alloc_coherent, >> +??? .free = vdpasim_free_coherent, >> +}; >> + > > Hey Jason, > > IMHO, it would be nice if dma_ops of the parent device could be > re-used. vdpa_device is expecting to represent a physical device > except this simulator, however, there are not enough information in > vdpa_device.dev to indicatin...
2020 Feb 04
0
[PATCH 5/5] vdpasim: vDPA device simulator
...> On 2020/2/4 ??4:21, Zhu Lingshan wrote: > > > +static const struct dma_map_ops vdpasim_dma_ops = { > > > +??? .map_page = vdpasim_map_page, > > > +??? .unmap_page = vdpasim_unmap_page, > > > +??? .alloc = vdpasim_alloc_coherent, > > > +??? .free = vdpasim_free_coherent, > > > +}; > > > + > > > > Hey Jason, > > > > IMHO, it would be nice if dma_ops of the parent device could be re-used. > > vdpa_device is expecting to represent a physical device except this > > simulator, however, there are not enough informa...
2020 Jul 31
0
[PATCH] vdpasim: protect concurrent access to iommu iotlb
...irt_to_phys(addr); ret = vhost_iotlb_add_range(iommu, (u64)pa, @@ -279,6 +288,7 @@ static void *vdpasim_alloc_coherent(struct device *dev, size_t size, } else *dma_addr = (dma_addr_t)pa; } + spin_unlock(&vdpasim->iommu_lock); return addr; } @@ -290,8 +300,11 @@ static void vdpasim_free_coherent(struct device *dev, size_t size, struct vdpasim *vdpasim = dev_to_sim(dev); struct vhost_iotlb *iommu = vdpasim->iommu; + spin_lock(&vdpasim->iommu_lock); vhost_iotlb_del_range(iommu, (u64)dma_addr, (u64)dma_addr + size - 1); + spin_unlock(&vdpasim->iommu_lock); +...
2020 Feb 10
0
[PATCH V2 5/5] vdpasim: vDPA device simulator
...64 pa = virt_to_phys(addr); + + ret = vhost_iotlb_add_range(iommu, (u64)pa, + (u64)pa + size - 1, + pa, VHOST_MAP_RW); + if (ret) { + *dma_addr = DMA_MAPPING_ERROR; + kfree(addr); + addr = NULL; + } else + *dma_addr = (dma_addr_t)pa; + } + + return addr; +} + +static void vdpasim_free_coherent(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_addr, + unsigned long attrs) +{ + struct vdpa_device *vdpa = dev_to_vdpa(dev); + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); + struct vhost_iotlb *iommu = vdpasim->iommu; + + vhost_iotlb_del_range(iommu, (u64)dma_addr, +...
2020 Feb 20
0
[PATCH V3 5/5] vdpasim: vDPA device simulator
...64 pa = virt_to_phys(addr); + + ret = vhost_iotlb_add_range(iommu, (u64)pa, + (u64)pa + size - 1, + pa, VHOST_MAP_RW); + if (ret) { + *dma_addr = DMA_MAPPING_ERROR; + kfree(addr); + addr = NULL; + } else + *dma_addr = (dma_addr_t)pa; + } + + return addr; +} + +static void vdpasim_free_coherent(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_addr, + unsigned long attrs) +{ + struct vdpasim *vdpasim = dev_to_sim(dev); + struct vhost_iotlb *iommu = vdpasim->iommu; + + vhost_iotlb_del_range(iommu, (u64)dma_addr, + (u64)dma_addr + size - 1); + kfree(phys_to_vir...
2020 Feb 10
1
[PATCH V2 5/5] vdpasim: vDPA device simulator
...64)pa, > + (u64)pa + size - 1, > + pa, VHOST_MAP_RW); > + if (ret) { > + *dma_addr = DMA_MAPPING_ERROR; > + kfree(addr); > + addr = NULL; > + } else > + *dma_addr = (dma_addr_t)pa; > + } > + > + return addr; > +} > + > +static void vdpasim_free_coherent(struct device *dev, size_t size, > + void *vaddr, dma_addr_t dma_addr, > + unsigned long attrs) > +{ > + struct vdpa_device *vdpa = dev_to_vdpa(dev); > + struct vdpasim *vdpasim = vdpa_to_sim(vdpa); > + struct vhost_iotlb *iommu = vdpasim->iommu; > + > + vhost_iotlb...
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
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