Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-11 Thread Robin Murphy
Hi Joerg, On 11/08/15 10:37, Joerg Roedel wrote: On Fri, Aug 07, 2015 at 02:38:39PM +0100, Robin Murphy wrote: Indeed, DMA_DEBUG will check that a driver is making DMA API calls to the arch code in the right way; this is a different check, to catch things like the arch code passing the wrong do

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-11 Thread Joerg Roedel
On Fri, Aug 07, 2015 at 02:38:39PM +0100, Robin Murphy wrote: > Indeed, DMA_DEBUG will check that a driver is making DMA API calls > to the arch code in the right way; this is a different check, to > catch things like the arch code passing the wrong domain into this > layer, or someone else having

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-07 Thread Robin Murphy
Hi Joerg, Thanks for taking a look, On 07/08/15 09:42, Joerg Roedel wrote: On Fri, Jul 31, 2015 at 06:18:27PM +0100, Robin Murphy wrote: +int iommu_get_dma_cookie(struct iommu_domain *domain) +{ + struct iova_domain *iovad; + + if (domain->dma_api_cookie) + return -EE

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-07 Thread Joerg Roedel
On Fri, Jul 31, 2015 at 06:18:27PM +0100, Robin Murphy wrote: > +int iommu_get_dma_cookie(struct iommu_domain *domain) > +{ > + struct iova_domain *iovad; > + > + if (domain->dma_api_cookie) > + return -EEXIST; Why do you call that dma_api_cookie? It is just a pointer to an iov

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-06 Thread j...@8bytes.org
Hi Will, On Thu, Aug 06, 2015 at 04:23:27PM +0100, Will Deacon wrote: > We're quite keen to get this in for arm64, since we're without IOMMU DMA > ops and need to get something upstream. Do you think this is likely to > be merged for 4.3/4.4 or would we be better off doing our own > arch-private i

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-06 Thread Will Deacon
Joerg, On Fri, Jul 31, 2015 at 06:18:27PM +0100, Robin Murphy wrote: > Taking inspiration from the existing arch/arm code, break out some > generic functions to interface the DMA-API to the IOMMU-API. This will > do the bulk of the heavy lifting for IOMMU-backed dma-mapping. > > Signed-off-by: Ro

Re: [PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-08-03 Thread Catalin Marinas
On Fri, Jul 31, 2015 at 06:18:27PM +0100, Robin Murphy wrote: > Taking inspiration from the existing arch/arm code, break out some > generic functions to interface the DMA-API to the IOMMU-API. This will > do the bulk of the heavy lifting for IOMMU-backed dma-mapping. > > Signed-off-by: Robin Murp

[PATCH v5 1/3] iommu: Implement common IOMMU ops for DMA mapping

2015-07-31 Thread Robin Murphy
Taking inspiration from the existing arch/arm code, break out some generic functions to interface the DMA-API to the IOMMU-API. This will do the bulk of the heavy lifting for IOMMU-backed dma-mapping. Signed-off-by: Robin Murphy --- drivers/iommu/Kconfig | 7 + drivers/iommu/Makefile|