RE: [PATCH V7 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-01-27 Thread Sricharan
Hi Robin, [..] >>> +const struct iommu_ops *of_iommu_configure(struct device *dev, >>> + struct device_node *master_np) >>> +{ >>> +const struct iommu_ops *ops; >>> + >>> +if (!master_np) >>> +return NULL; >>> + >>> +if (dev_is_pci(dev)) >>> +ops

Re: [PATCH V7 01/11] iommu/of: Refactor of_iommu_configure() for error handling

2017-01-27 Thread Robin Murphy
On 27/01/17 18:00, Sricharan wrote: > Hi Robin, > > [..] > +const struct iommu_ops *of_iommu_configure(struct device *dev, + struct device_node *master_np) +{ +const struct iommu_ops *ops; + +if (!master_np) +return NULL;

Re: [PATCH v2 2/3] iommu/ipmmu-vmsa: Increase maximum micro-TLBS to 48

2017-01-27 Thread Joerg Roedel
On Mon, Jan 23, 2017 at 08:40:29PM +0900, Magnus Damm wrote: > From: Magnus Damm > > Bump up the maximum numbers of micro-TLBS to 48. > > Each IPMMU device instance get micro-TLB assignment via > the "iommus" property in DT. Older SoCs tend to use a > maximum number

[PATCH] iommu: Better document the IOMMU_PRIV flag

2017-01-27 Thread Robin Murphy
This is a fairly subtle thing - let's make sure it's described as clearly as possible to avoid potential misunderstandings. Signed-off-by: Robin Murphy --- Having another look through the IOMMU_PRIV series, I wasn't convinced that the original comment was really all that

[PATCH v2 0/2] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-27 Thread Geert Uytterhoeven
Hi all, Tis patch series adds helpers for DMA_ATTR_FORCE_CONTIGUOUS to the generic IOMMU DMA code, and support for allocating physically contiguous DMA buffers on arm64 systems with an IOMMU. This can be useful when two or more devices with different memory requirements are involved in

[PATCH v2 2/2] arm64: Add support for DMA_ATTR_FORCE_CONTIGUOUS to IOMMU

2017-01-27 Thread Geert Uytterhoeven
Add support for allocation physically contiguous DMA buffers on arm64 systems with an IOMMU, by dispatching DMA buffer allocations with the DMA_ATTR_FORCE_CONTIGUOUS attribute to the appropriate IOMMU DMA helpers. Note that as this uses the CMA allocator, setting this attribute has a

[PATCH v2 1/2] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-27 Thread Geert Uytterhoeven
Add helpers for allocating physically contiguous DMA buffers to the generic IOMMU DMA code. This can be useful when two or more devices with different memory requirements are involved in buffer sharing. The iommu_dma_{alloc,free}_contiguous() functions complement the existing

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

2017-01-27 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 3/3] mm: wire up GFP flag passing in dma_alloc_from_contiguous

2017-01-27 Thread Michal Hocko
On Thu 19-01-17 18:07:07, Lucas Stach wrote: > The callers of the DMA alloc functions already provide the proper > context GFP flags. Make sure to pass them through to the CMA > allocator, to make the CMA compaction context aware. > > Signed-off-by: Lucas Stach Looks

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

2017-01-27 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

Re: [PATCH 1/3] mm: alloc_contig_range: allow to specify GFP mask

2017-01-27 Thread Michal Hocko
On Fri 20-01-17 13:35:40, Vlastimil Babka wrote: > On 01/19/2017 06:07 PM, Lucas Stach wrote: [...] > > @@ -7255,7 +7256,7 @@ int alloc_contig_range(unsigned long start, unsigned > > long end, > > .zone = page_zone(pfn_to_page(start)), > > .mode = MIGRATE_SYNC, > >

[GIT PULL] iommu/arm-smmu: Updates for 4.11

2017-01-27 Thread Will Deacon
Hi Joerg, Please pull these arm-smmu updates for 4.11. Not much this time around: 16-bit SID support on SMMUv2 and a stream table optimisation on SMMUv3. There's also a trivial cleanup to of_iommu_{set/get}_ops() [they are removed] which we promised to make after the IORT stuff went in last time

[GIT PULL] iommu: IOMMU_PRIV support for 4.11

2017-01-27 Thread Will Deacon
Hi Joerg, Please pull the following IOMMU changes for 4.11. These patches from Sricharan add support for "privileged" IOMMU mappings, which are useful with master devices that support transactions at different privilege levels and want to control the permissions independently. Cheers, Will

[GIT PULL] iommu: KVM PCIe/MSI passthrough on ARM/ARM64 for 4.11

2017-01-27 Thread Will Deacon
Hi Joerg, Please pull Eric's guest-MSI series for 4.11. This has been through considerable review and associated rework (including a session at LPC), but it has stabilised at last and we all seem to be happy with it. Eric's done a great job of respinning these and remaining patient while we

RE: [PATCH] iommu: Better document the IOMMU_PRIV flag

2017-01-27 Thread Sricharan
Hi Robin, >-Original Message- >From: linux-arm-kernel [mailto:linux-arm-kernel-boun...@lists.infradead.org] >On Behalf Of Robin Murphy >Sent: Friday, January 27, 2017 5:53 PM >To: will.dea...@arm.com >Cc: iommu@lists.linux-foundation.org; sricha...@codeaurora.org;

[PATCH v2 1/3] mm: alloc_contig_range: allow to specify GFP mask

2017-01-27 Thread Lucas Stach
Currently alloc_contig_range assumes that the compaction should be done with the default GFP_KERNEL flags. This is probably right for all current uses of this interface, but may change as CMA is used in more use-cases (including being the default DMA memory allocator on some platforms). Change

[PATCH v2 3/3] mm: wire up GFP flag passing in dma_alloc_from_contiguous

2017-01-27 Thread Lucas Stach
The callers of the DMA alloc functions already provide the proper context GFP flags. Make sure to pass them through to the CMA allocator, to make the CMA compaction context aware. Signed-off-by: Lucas Stach Acked-by: Vlastimil Babka Acked-by: Michal Hocko

[PATCH v2 2/3] mm: cma_alloc: allow to specify GFP mask

2017-01-27 Thread Lucas Stach
Most users of this interface just want to use it with the default GFP_KERNEL flags, but for cases where DMA memory is allocated it may be called from a different context. No functional change yet, just passing through the flag to the underlying alloc_contig_range function. Signed-off-by: Lucas

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

2017-01-27 Thread Robin Murphy
Hi Magnus, On 27/01/17 06:24, Magnus Damm wrote: > 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

Re: [PATCH v2 1/2] iommu/dma: Add support for DMA_ATTR_FORCE_CONTIGUOUS

2017-01-27 Thread Robin Murphy
Hi Geert, On 27/01/17 15:34, Geert Uytterhoeven wrote: > Add helpers for allocating physically contiguous DMA buffers to the > generic IOMMU DMA code. This can be useful when two or more devices > with different memory requirements are involved in buffer sharing. > > The