Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Joerg Roedel
Hi Robin, On Tue, Jul 12, 2016 at 12:42:59PM +0100, Robin Murphy wrote: > Ah, that's the angle I was missing, yes. So if, say, someone is mapping > a page at IOVA 0x while someone else is mapping a page at 0x1000, > there could still be a race between both callers writing the non-leaf > PTEs,

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Robin Murphy
On 12/07/16 12:08, Joerg Roedel wrote: > Hi Robin, > > On Tue, Jul 12, 2016 at 11:55:39AM +0100, Robin Murphy wrote: >>> start = address; >>> for (i = 0; i < pages; ++i) { >>> - ret = dma_ops_domain_map(dma_dom, start, paddr, dir); >>> - if (ret == DMA_ERROR_CODE) >>> +

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Joerg Roedel
Hi Robin, On Tue, Jul 12, 2016 at 11:55:39AM +0100, Robin Murphy wrote: > > start = address; > > for (i = 0; i < pages; ++i) { > > - ret = dma_ops_domain_map(dma_dom, start, paddr, dir); > > - if (ret == DMA_ERROR_CODE) > > + ret = iommu_map_page(&dma_dom->dom

Re: [PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-12 Thread Robin Murphy
Hi Joerg, On 08/07/16 12:44, Joerg Roedel wrote: > From: Joerg Roedel > > Use the iommu-api map/unmap functions instead. This will be > required anyway when IOVA code is used for address > allocation. > > Signed-off-by: Joerg Roedel > --- > drivers/iommu/amd_iommu.c | 107 > ++---

[PATCH 07/20] iommu/amd: Remove special mapping code for dma_ops path

2016-07-08 Thread Joerg Roedel
From: Joerg Roedel Use the iommu-api map/unmap functions instead. This will be required anyway when IOVA code is used for address allocation. Signed-off-by: Joerg Roedel --- drivers/iommu/amd_iommu.c | 107 ++ 1 file changed, 14 insertions(+), 93 del