Re: [PATCH] vdpa_sim: get rid of DMA ops

2023-01-28 Thread Jason Wang
On Fri, Jan 27, 2023 at 6:29 PM Michael S. Tsirkin wrote: > > On Mon, Dec 26, 2022 at 12:12:42PM +0800, Jason Wang wrote: > > > >@@ -682,6 +553,11 @@ static int vdpasim_dma_unmap(struct vdpa_device > > > >*vdpa, unsigned int asid, > > > > if (asid >= vdpasim->dev_attr.nas) > > > >

Re: [PATCH] vdpa_sim: get rid of DMA ops

2023-01-27 Thread Michael S. Tsirkin
On Mon, Dec 26, 2022 at 12:12:42PM +0800, Jason Wang wrote: > > >@@ -682,6 +553,11 @@ static int vdpasim_dma_unmap(struct vdpa_device > > >*vdpa, unsigned int asid, > > > if (asid >= vdpasim->dev_attr.nas) > > > return -EINVAL; > > > > > >+ if (vdpasim->iommu_pt[asid]) {

Re: [PATCH] vdpa_sim: get rid of DMA ops

2022-12-25 Thread Jason Wang
On Fri, Dec 23, 2022 at 5:27 PM Stefano Garzarella wrote: > > On Fri, Dec 23, 2022 at 02:00:21PM +0800, Jason Wang wrote: > >We used to (ab)use the DMA ops for setting up identical mappings in > >the IOTLB. This patch tries to get rid of the those unnecessary DMA > >ops by maintaining a simple

Re: [PATCH] vdpa_sim: get rid of DMA ops

2022-12-23 Thread Stefano Garzarella
On Fri, Dec 23, 2022 at 02:00:21PM +0800, Jason Wang wrote: We used to (ab)use the DMA ops for setting up identical mappings in the IOTLB. This patch tries to get rid of the those unnecessary DMA ops by maintaining a simple identical/passthrough mappings by default. When bound to virtio_vdpa

Re: [PATCH] vdpa_sim: get rid of DMA ops

2022-12-22 Thread Christoph Hellwig
Looks good from the DMA subsysten POV: Acked-by: Christoph Hellwig Thanks for doing the work! ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH] vdpa_sim: get rid of DMA ops

2022-12-22 Thread Jason Wang
We used to (ab)use the DMA ops for setting up identical mappings in the IOTLB. This patch tries to get rid of the those unnecessary DMA ops by maintaining a simple identical/passthrough mappings by default. When bound to virtio_vdpa driver, DMA API will simply use PA as the IOVA and we will be all