[PATCH v2] iommu/dma: Respect IOMMU aperture when allocating

2016-08-09 Thread Robin Murphy
Where a device driver has set a 64-bit DMA mask to indicate the absence of addressing limitations, we still need to ensure that we don't allocate IOVAs beyond the actual input size of the IOMMU. The reported aperture is the most reliable way we have of inferring that input address size, so use that

Re: [PATCH 2/2] iommu/dma: Respect IOMMU aperture when allocating

2016-08-09 Thread Robin Murphy
On 09/08/16 16:36, Joerg Roedel wrote: > On Tue, Aug 09, 2016 at 04:23:18PM +0100, Robin Murphy wrote: >> Where a device driver has set a 64-bit DMA mask to indicate the absence >> of addressing limitations, we still need to ensure that we don't >> allocate IOVAs beyond the actual input size of the

Re: [PATCH 2/2] iommu/dma: Respect IOMMU aperture when allocating

2016-08-09 Thread Joerg Roedel
On Tue, Aug 09, 2016 at 04:23:18PM +0100, Robin Murphy wrote: > Where a device driver has set a 64-bit DMA mask to indicate the absence > of addressing limitations, we still need to ensure that we don't > allocate IOVAs beyond the actual input size of the IOMMU. The reported > aperture is the most

Re: [PATCH 1/2] iommu/dma: Don't put uninitialised IOVA domains

2016-08-09 Thread Joerg Roedel
On Tue, Aug 09, 2016 at 04:23:17PM +0100, Robin Murphy wrote: > Due to the limitations of having to wait until we see a device's DMA > restrictions before we know how we want an IOVA domain initialised, > there is a window for error if a DMA ops domain is allocated but later > freed without ever be

Re: [PATCH] iommu/exynos: Modify error handling

2016-08-09 Thread Joerg Roedel
On Mon, Aug 01, 2016 at 11:48:38AM +0530, Amitoj Kaur Chawla wrote: > of_platform_device_create returns NULL on error so an IS_ERR test is > incorrect here and a NULL check is required. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > @@ > > e = o

[PATCH 2/2] iommu/dma: Respect IOMMU aperture when allocating

2016-08-09 Thread Robin Murphy
Where a device driver has set a 64-bit DMA mask to indicate the absence of addressing limitations, we still need to ensure that we don't allocate IOVAs beyond the actual input size of the IOMMU. The reported aperture is the most reliable way we have of inferring that input address size, so use that

[PATCH 1/2] iommu/dma: Don't put uninitialised IOVA domains

2016-08-09 Thread Robin Murphy
Due to the limitations of having to wait until we see a device's DMA restrictions before we know how we want an IOVA domain initialised, there is a window for error if a DMA ops domain is allocated but later freed without ever being used. In that case, init_iova_domain() was never called, so callin

Re: [PATCH] iommu/dma: Don't put uninitialised IOVA domains

2016-08-09 Thread Robin Murphy
On 09/08/16 16:01, Joerg Roedel wrote: > On Wed, Jul 27, 2016 at 04:46:06PM +0100, Robin Murphy wrote: >> Due to the limitations of having to wait until we see a device's DMA >> restrictions before we know how we want an IOVA domain initialised, >> there is a window for error if a DMA ops domain is

Re: [PATCH -next] iommu/amd: Fix error return code in irq_remapping_alloc()

2016-08-09 Thread Joerg Roedel
On Thu, Jul 28, 2016 at 02:10:26AM +, Wei Yongjun wrote: > Fix to return a negative error code from the alloc_irq_index() error > handling case instead of 0, as done elsewhere in this function. > > Signed-off-by: Wei Yongjun Applied, thanks. ___ i

Re: [PATCH -next] iommu/amd: Fix non static symbol warning

2016-08-09 Thread Joerg Roedel
On Thu, Jul 28, 2016 at 02:09:53AM +, Wei Yongjun wrote: > Fixes the following sparse warning: > > drivers/iommu/amd_iommu.c:106:1: warning: > symbol '__pcpu_scope_flush_queue' was not declared. Should it be static? > > Signed-off-by: Wei Yongjun Applied, thanks. __

Re: [PATCH] iommu/dma: Don't put uninitialised IOVA domains

2016-08-09 Thread Joerg Roedel
On Wed, Jul 27, 2016 at 04:46:06PM +0100, Robin Murphy wrote: > Due to the limitations of having to wait until we see a device's DMA > restrictions before we know how we want an IOVA domain initialised, > there is a window for error if a DMA ops domain is allocated but later > freed without ever be

[PATCH] iommu/mediatek: Mark static functions in headers inline

2016-08-09 Thread Joerg Roedel
From: Joerg Roedel This was an oversight while merging these functions. Fix it. Cc: Honghui Zhang Fixes: 9ca340c98c0d ('iommu/mediatek: move the common struct into header file') Signed-off-by: Joerg Roedel --- drivers/iommu/mtk_iommu.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-08-09 Thread Laurent Pinchart
On Tuesday 09 Aug 2016 16:17:57 Laurent Pinchart wrote: > On Wednesday 08 Jun 2016 18:12:31 Magnus Damm wrote: > > On Wed, Jun 8, 2016 at 5:48 PM, Laurent Pinchart wrote: > >> On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote: > >>> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote: >

Re: [PATCH 3/3] iommu/ipmmu-vmsa: Hook up r8a7796 DT matching code

2016-08-09 Thread Laurent Pinchart
Hi Magnus, On Wednesday 08 Jun 2016 18:12:31 Magnus Damm wrote: > On Wed, Jun 8, 2016 at 5:48 PM, Laurent Pinchart wrote: > > On Wednesday 08 Jun 2016 09:04:17 Geert Uytterhoeven wrote: > >> On Wed, Jun 8, 2016 at 2:18 AM, Laurent Pinchart wrote: > --- 0031/drivers/iommu/ipmmu-vmsa.c > +

Re: [PATCH v12 02/11] genirq/msi: msi_compose wrapper

2016-08-09 Thread Thomas Gleixner
On Tue, 2 Aug 2016, Eric Auger wrote: > Currently the MSI message is composed by directly calling > irq_chip_compose_msi_msg and erased by setting the memory to zero. > > On some platforms, we will need to complexify this composition to > properly handle MSI emission through IOMMU. Also we will n