Re: [Patch Part3 v4 18/38] x86: irq_remapping: Clean up unsued code

2014-12-01 Thread Bjorn Helgaas
s/unsued/unused/ in subject (here and other patches). "Clean up" is slightly ambiguous; it could mean either "make better" or "remove." "Remove unused code" would be less ambiguous. On Tue, Nov 25, 2014 at 03:49:42PM +0800, Jiang Liu wrote: > Now we have converted to hierarchy irqdomain, so clea

Re: [PATCH] iommu/vt-d: Fix an off-by-one bug in __domain_mapping()

2014-12-01 Thread Jiang Liu
On 2014/12/2 0:27, Joerg Roedel wrote: > On Wed, Nov 26, 2014 at 09:42:10AM +0800, Jiang Liu wrote: >> There's an off-by-one bug in function __domain_mapping(), which may >> trigger the BUG_ON(nr_pages < lvl_pages) when >> (nr_pages + 1) & superpage_mask == 0 > > What is the superpage_mask?

Re: [PATCH v6 1/8] iommu: provide early initialisation hook for IOMMU drivers

2014-12-01 Thread Rob Herring
Adding Grant and Pantelis... On Mon, Dec 1, 2014 at 10:57 AM, Will Deacon wrote: > IOMMU drivers must be initialised before any of their upstream devices, > otherwise the relevant iommu_ops won't be configured for the bus in > question. To solve this, a number of IOMMU drivers use initcalls to >

Re: [PATCH v6 6/8] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-12-01 Thread Rob Herring
On Mon, Dec 1, 2014 at 10:57 AM, Will Deacon wrote: > This patch extends of_dma_configure so that it sets up the IOMMU for a > device, as well as the coherent/non-coherent DMA mapping ops. > > Acked-by: Arnd Bergmann > Acked-by: Marek Szyprowski > Tested-by: Robin Murphy > Signed-off-by: Will D

Re: [PATCH v6 2/8] dma-mapping: replace set_arch_dma_coherent_ops with arch_setup_dma_ops

2014-12-01 Thread Rob Herring
On Mon, Dec 1, 2014 at 10:57 AM, Will Deacon wrote: > set_arch_dma_coherent_ops is called from of_dma_configure in order to > swizzle the architectural dma-mapping functions over to a cache-coherent > implementation. This is currently implemented only for ARM. > > In anticipation of re-using this

Re: [PATCH 5/7] iommu/arm-smmu: don't bother truncating the s1 output size to VA_BITS

2014-12-01 Thread Andreas Schwab
Will Deacon writes: > diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c > index ecad700cd4f4..2a7e3331b93a 100644 > --- a/drivers/iommu/arm-smmu.c > +++ b/drivers/iommu/arm-smmu.c > @@ -24,7 +24,7 @@ > * - v7/v8 long-descriptor format > * - Non-secure access to the SMMU >

Re: [PATCH 2/4] iommu: add ARM LPAE page table allocator

2014-12-01 Thread Laurent Pinchart
Hi Will, On Monday 01 December 2014 17:23:15 Will Deacon wrote: > On Sun, Nov 30, 2014 at 11:29:46PM +, Laurent Pinchart wrote: > > Hi Will, > > Hello again, > > > On Thursday 27 November 2014 11:51:16 Will Deacon wrote: > > > +static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pg

Re: [PATCH 2/4] iommu: add ARM LPAE page table allocator

2014-12-01 Thread Will Deacon
On Sun, Nov 30, 2014 at 11:29:46PM +, Laurent Pinchart wrote: > Hi Will, Hello again, > On Thursday 27 November 2014 11:51:16 Will Deacon wrote: > > +static arm_lpae_iopte arm_lpae_prot_to_pte(struct arm_lpae_io_pgtable > > *data, + int prot) > > +{ > >

[PATCH v6 6/8] dma-mapping: detect and configure IOMMU in of_dma_configure

2014-12-01 Thread Will Deacon
This patch extends of_dma_configure so that it sets up the IOMMU for a device, as well as the coherent/non-coherent DMA mapping ops. Acked-by: Arnd Bergmann Acked-by: Marek Szyprowski Tested-by: Robin Murphy Signed-off-by: Will Deacon --- arch/arm/include/asm/dma-mapping.h | 4 +++- drivers/

[PATCH v6 1/8] iommu: provide early initialisation hook for IOMMU drivers

2014-12-01 Thread Will Deacon
IOMMU drivers must be initialised before any of their upstream devices, otherwise the relevant iommu_ops won't be configured for the bus in question. To solve this, a number of IOMMU drivers use initcalls to initialise the driver before anything has a chance to be probed. Whilst this solves the im

[PATCH v6 2/8] dma-mapping: replace set_arch_dma_coherent_ops with arch_setup_dma_ops

2014-12-01 Thread Will Deacon
set_arch_dma_coherent_ops is called from of_dma_configure in order to swizzle the architectural dma-mapping functions over to a cache-coherent implementation. This is currently implemented only for ARM. In anticipation of re-using this mechanism for IOMMU-backed dma-mapping ops too, this patch rep

[PATCH v6 3/8] iommu: add new iommu_ops callback for adding an OF device

2014-12-01 Thread Will Deacon
This patch adds a new function to the iommu_ops structure to allow an OF device to be added to a specific IOMMU instance using the recently merged generic devicetree binding for IOMMUs. The callback (of_xlate) takes a struct device representing the master and an of_phandle_args representing the IOM

[PATCH v6 8/8] arm: dma-mapping: plumb our iommu mapping ops into arch_setup_dma_ops

2014-12-01 Thread Will Deacon
This patch plumbs the existing ARM IOMMU DMA infrastructure (which isn't actually called outside of a few drivers) into arch_setup_dma_ops, so that we can use IOMMUs for DMA transfers in a more generic fashion. Since this significantly complicates the arch_setup_dma_ops function, it is moved out o

[PATCH v6 4/8] iommu: provide helper function to configure an IOMMU for an of master

2014-12-01 Thread Will Deacon
The generic IOMMU device-tree bindings can be used to add arbitrary OF masters to an IOMMU with a compliant binding. This patch introduces of_iommu_configure, which does exactly that. Acked-by: Arnd Bergmann Acked-by: Joerg Roedel Acked-by: Marek Szyprowski Tested-by: Robin Murphy Signed-off-

[PATCH v6 5/8] iommu: fix initialization without 'add_device' callback

2014-12-01 Thread Will Deacon
From: Marek Szyprowski IOMMU drivers can be initialized from of_iommu helpers. Such drivers don't need to provide device_add callbacks to operate properly, so there is no need to fail initialization if the callback is missing. Acked-by: Arnd Bergmann Signed-off-by: Marek Szyprowski Signed-off-

[PATCH v6 7/8] arm: call iommu_init before of_platform_populate

2014-12-01 Thread Will Deacon
We need to ensure that the IOMMUs in the system have a chance to perform some basic initialisation before we start adding masters to them. This patch adds a call to of_iommu_init before of_platform_populate. Acked-by: Russell King Acked-by: Arnd Bergmann Acked-by: Marek Szyprowski Signed-off-b

[PATCH v6 0/8] Introduce automatic DMA configuration for IOMMU masters

2014-12-01 Thread Will Deacon
Hello again, This is version 6 of the patches previously posted here: RFCv1: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/283023.html RFCv2: http://lists.infradead.org/pipermail/linux-arm-kernel/2014-September/283752.html RFCv3: http://lists.infradead.org/pipermail/l

Re: [PATCH] iommu/vt-d: Fix an off-by-one bug in __domain_mapping()

2014-12-01 Thread Joerg Roedel
On Wed, Nov 26, 2014 at 09:42:10AM +0800, Jiang Liu wrote: > There's an off-by-one bug in function __domain_mapping(), which may > trigger the BUG_ON(nr_pages < lvl_pages) when > (nr_pages + 1) & superpage_mask == 0 What is the superpage_mask? > The issue was introduced by commit 9051aa0268

Re: [PATCH v5 0/8] Introduce automatic DMA configuration for IOMMU masters

2014-12-01 Thread Will Deacon
On Mon, Dec 01, 2014 at 01:52:57PM +, Arnd Bergmann wrote: > On Friday 28 November 2014 13:29:38 Will Deacon wrote: > > Here is v5 of the patches I've previously sent here: > > > > RFCv1: > > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/283023.html > > RFCv2: > > htt

Re: [PATCH v10 00/20] VFIO support for platform and ARM AMBA devices

2014-12-01 Thread Eric Auger
On 12/01/2014 01:45 PM, Antonios Motakis wrote: > Hello Eric, > > On Fri, Nov 28, 2014 at 7:05 PM, Eric Auger wrote: >> Hi Antonios, >> >> you can add Tested-by: Eric Auger >> > > Thanks! > >> I added some patches related to IOMMU_CAP_NOEXEC cap to compile your 2 >> series with v3.18-rc5, mayb

Re: [PATCH v5 0/8] Introduce automatic DMA configuration for IOMMU masters

2014-12-01 Thread Arnd Bergmann
On Friday 28 November 2014 13:29:38 Will Deacon wrote: > Hi all, > > Here is v5 of the patches I've previously sent here: > > RFCv1: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-August/283023.html > RFCv2: > http://lists.infradead.org/pipermail/linux-arm-kernel/2014-Septembe

Re: [PATCH 1/4] iommu: introduce generic page table allocation framework

2014-12-01 Thread Will Deacon
On Mon, Dec 01, 2014 at 01:33:09PM +, Laurent Pinchart wrote: > On Monday 01 December 2014 12:13:38 Will Deacon wrote: > > On Sun, Nov 30, 2014 at 10:00:21PM +, Laurent Pinchart wrote: > > > On Thursday 27 November 2014 11:51:15 Will Deacon wrote: > > > > diff --git a/drivers/iommu/io-pgtab

Re: [PATCH 1/4] iommu: introduce generic page table allocation framework

2014-12-01 Thread Laurent Pinchart
Hi Will, On Monday 01 December 2014 12:13:38 Will Deacon wrote: > On Sun, Nov 30, 2014 at 10:00:21PM +, Laurent Pinchart wrote: > > On Thursday 27 November 2014 11:51:15 Will Deacon wrote: > > > diff --git a/drivers/iommu/io-pgtable.c b/drivers/iommu/io-pgtable.c > > > new file mode 100644 > >

Re: [PATCH v10 00/20] VFIO support for platform and ARM AMBA devices

2014-12-01 Thread Antonios Motakis
Hello Eric, On Fri, Nov 28, 2014 at 7:05 PM, Eric Auger wrote: > Hi Antonios, > > you can add Tested-by: Eric Auger > Thanks! > I added some patches related to IOMMU_CAP_NOEXEC cap to compile your 2 > series with v3.18-rc5, maybe due to the fact I did not use some > iommu/vt-d stuff? See my 3.

Re: [PATCH 0/5] iommu/vt-d: Fix crash dump failure caused by legacy DMA/IO

2014-12-01 Thread Joerg Roedel
On Mon, Dec 01, 2014 at 02:31:38PM +0800, Li, ZhenHua wrote: > After I implement these two steps, there comes a new fault: > > [1.594890] dmar: DRHD: handling fault status reg 2 > [1.594894] dmar: INTR-REMAP: Request device [[41:00.0] fault index 4d > [1.594894] INTR-REMAP:[fault reason 34] Presen

Re: [PATCH 1/4] iommu: introduce generic page table allocation framework

2014-12-01 Thread Will Deacon
On Sun, Nov 30, 2014 at 10:00:21PM +, Laurent Pinchart wrote: > Hi Will, Hi Laurent, > Thank you for the patch. Cheers for the review! > On Thursday 27 November 2014 11:51:15 Will Deacon wrote: > > diff --git a/drivers/iommu/io-pgtable.c b/drivers/iommu/io-pgtable.c > > new file mode 100644

Re: [PATCH 0/4] Generic IOMMU page table framework

2014-12-01 Thread Will Deacon
On Sun, Nov 30, 2014 at 10:03:08PM +, Laurent Pinchart wrote: > Hi Will, Hi Laurent, > On Thursday 27 November 2014 11:51:14 Will Deacon wrote: > > Hi all, > > > > This series introduces a generic IOMMU page table allocation framework, > > implements support for ARM long-descriptors and then