[PATCH/RFC] iommu/dma: Per-domain flag to control size-alignment

2017-01-26 Thread Magnus Damm
From: Magnus Damm Introduce the flag "no_size_align" to allow disabling size-alignment on a per-domain basis. This follows the suggestion by the comment in the code, however a per-device control may be preferred? Needed to make virtual space contiguous for certain

[PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Opt-in slave devices based on ES version

2017-01-26 Thread Magnus Damm
From: Magnus Damm Match on r8a7795 ES2 and enable a certain DMA controller. In other cases the IPMMU driver remains disabled. Signed-off-by: Magnus Damm --- Changes since V1: - Perform white list check in ->xlate() instead of

[PATCH/RFC v2 1/4] iommu/of: Skip IOMMU devices disabled in DT

2017-01-26 Thread Magnus Damm
From: Magnus Damm Extend the shared IOMMU code to skip over ->xlate() in case the IOMMU device pointed to by a slave device has been disabled in DT. Difficult to trigger in case a single IOMMU device is used, however when multiple IOMMUs are used and some of them are

[PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Check devices in xlate()

2017-01-26 Thread Magnus Damm
From: Magnus Damm Rework the IPMMU code to validate devices in ->xlate() instead of accepting all devices in xlate() and instead validating devices in ->add_device(). This makes it possible for the IPMMU device driver to reject slave devices based on software policy.

[PATCH/RFC v2 2/4] iommu/ipmmu-vmsa: Get rid of disabled device check

2017-01-26 Thread Magnus Damm
From: Magnus Damm Since of_iommu_configure() now skips over disabled devices we can simply drop this check in the IPMMU driver. Signed-off-by: Magnus Damm --- drivers/iommu/ipmmu-vmsa.c |7 --- 1 file changed, 7 deletions(-)

[PATCH/RFC v2 0/4] iommu/ipmmu-vmsa: IPMMU slave device whitelist V2

2017-01-26 Thread Magnus Damm
iommu/ipmmu-vmsa: IPMMU slave device whitelist V2 [PATCH/RFC v2 1/4] iommu/of: Skip IOMMU devices disabled in DT [PATCH/RFC v2 2/4] iommu/ipmmu-vmsa: Get rid of disabled device check [PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Check devices in xlate() [PATCH/RFC v2 3/4] iommu/ipmmu-vmsa: Opt-in slave

[PATCH 1/2] iommu/vt-d: Fix some macros that are incorrectly specified in intel-iommu

2017-01-26 Thread Ashok Raj
From: CQ Tang Some of the macros are incorrect with wrong bit-shifts resulting in picking the incorrect invalidation granularity. Incorrect Source-ID in extended devtlb invalidation caused device side errors. To: Joerg Roedel To: David Woodhouse

[PATCH 2/2] iommu/vt-d: tylersburg isoch identity map check is done too late.

2017-01-26 Thread Ashok Raj
The check to set identity map for tylersburg is done too late. It needs to be done before the check for identity_map domain is done. To: Joerg Roedel To: David Woodhouse Cc: iommu@lists.linux-foundation.org Cc: linux-ker...@vger.kernel.org Cc:

Re: [PATCH 4/5] arm64: dma-mapping: Only swizzle DMA ops for IOMMU_DOMAIN_DMA

2017-01-26 Thread Will Deacon
On Thu, Jan 19, 2017 at 07:00:25PM +, Robin Murphy wrote: > On 19/01/17 18:19, Will Deacon wrote: > > The arm64 DMA-mapping implementation sets the DMA ops to the IOMMU DMA > > ops if we detect that an IOMMU is present for the master and the DMA > > ranges are valid. > > > > In the case when

Re: [PATCH 1/5] iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains

2017-01-26 Thread Will Deacon
On Thu, Jan 26, 2017 at 06:03:30PM +0100, Joerg Roedel wrote: > On Thu, Jan 19, 2017 at 06:19:11PM +, Will Deacon wrote: > > The ARM SMMU drivers provide a DOMAIN_ATTR_NESTING domain attribute, > > which allows callers of the IOMMU API to request that the page table > > for a domain is

Re: [PATCH 5/5] iommu: Allow default domain type to be set on the kernel command line

2017-01-26 Thread Will Deacon
On Thu, Jan 26, 2017 at 06:15:55PM +0100, Joerg Roedel wrote: > On Thu, Jan 19, 2017 at 06:19:15PM +, Will Deacon wrote: > > Rather than modify each IOMMU driver to provide different semantics for > > DMA domains, instead we introduce a command line parameter that can be > > used to change the

Re: [PATCH 5/5] iommu: Allow default domain type to be set on the kernel command line

2017-01-26 Thread Robin Murphy
On 26/01/17 17:15, Joerg Roedel wrote: > On Thu, Jan 19, 2017 at 06:19:15PM +, Will Deacon wrote: >> Rather than modify each IOMMU driver to provide different semantics for >> DMA domains, instead we introduce a command line parameter that can be >> used to change the type of the default

Re: [PATCH 0/5] Implement SMMU passthrough using the default domain

2017-01-26 Thread Joerg Roedel
On Tue, Jan 24, 2017 at 08:42:23PM +0530, Sricharan wrote: > Thanks for this series. We had a case with the GPU. > The GPU's iommu was setup by kernel and the GPU > also does dynamic updates for on-the-fly switching between > process pagetables. GPU driver was not using DMA domain and > the GPU's

Re: [PATCH 5/5] iommu: Allow default domain type to be set on the kernel command line

2017-01-26 Thread Joerg Roedel
On Thu, Jan 19, 2017 at 06:19:15PM +, Will Deacon wrote: > Rather than modify each IOMMU driver to provide different semantics for > DMA domains, instead we introduce a command line parameter that can be > used to change the type of the default domain. Passthrough can then be > specified using

Re: [PATCH 1/5] iommu: Generalize MSM_IOMMU config to ARCH_QCOM

2017-01-26 Thread Joerg Roedel
On Wed, Jan 18, 2017 at 03:27:22PM -0800, Stephen Boyd wrote: > We want to get rid of the ARCH_MSM* configs in the future, but > this still depends on them. Generalize to the ARCH_QCOM config, > which isn't going away. > > Cc: Joerg Roedel > Signed-off-by: Stephen Boyd

Re: [PATCH 1/5] iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains

2017-01-26 Thread Joerg Roedel
On Thu, Jan 19, 2017 at 06:41:34PM +, Robin Murphy wrote: > For the sake of discussion, would it make sense to enforce this in > domain_set_attr() itself? The intersection of drivers providing these > callbacks and drivers supporting anything other than unmanaged domains > is currently these

Re: [PATCH 1/5] iommu/arm-smmu: Restrict domain attributes to UNMANAGED domains

2017-01-26 Thread Joerg Roedel
On Thu, Jan 19, 2017 at 06:19:11PM +, Will Deacon wrote: > The ARM SMMU drivers provide a DOMAIN_ATTR_NESTING domain attribute, > which allows callers of the IOMMU API to request that the page table > for a domain is installed at stage-2, if supported by the hardware. > > Since setting this

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Geert Uytterhoeven
Hi Robin, On Thu, Jan 26, 2017 at 12:23 PM, Robin Murphy wrote: > On 26/01/17 09:53, Geert Uytterhoeven wrote: >> Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses >> only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force >> a 32-bit

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Robin Murphy
On 26/01/17 09:53, Geert Uytterhoeven wrote: > Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses > only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force > a 32-bit IOVA space through the IOMMU Domain Geometry. > > Hence if a device (e.g. SYS-DMAC) rightfully

Re: [PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Magnus Damm
Hi Geert, On Thu, Jan 26, 2017 at 6:53 PM, Geert Uytterhoeven wrote: > Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses > only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force > a 32-bit IOVA space through the IOMMU Domain

[PATCH/RFC] iommu/ipmmu-vmsa: Restrict IOMMU Domain Geometry to 32-bit address space

2017-01-26 Thread Geert Uytterhoeven
Currently, the IPMMU/VMSA driver supports 32-bit I/O Virtual Addresses only, and thus sets io_pgtable_cfg.ias = 32. However, it doesn't force a 32-bit IOVA space through the IOMMU Domain Geometry. Hence if a device (e.g. SYS-DMAC) rightfully configures a 40-bit DMA mask, it will still be handed