Re: [PATCH v3 7/8] ARM: dts: r8a7790: add iommus to dmac0 and dmac1

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:57 Niklas Söderlund wrote: No commit message ? I'd at least mention that as a side effect of this patch channel 0 and 15 are disabled, reducing the effective number of channels to 14 per DMAC. > Signed-off-by: Niklas Söde

Re: [PATCH v3 6/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:56 Niklas Söderlund wrote: > Enable slave transfers to devices behind IPMMU:s by mapping the slave > addresses using the dma-mapping API. > > Signed-off-by: Niklas Söderlund > --- > drivers/dma/sh/rcar-dmac.c | 57

Re: [PATCH v3 5/8] dmaengine: rcar-dmac: group slave configuration

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:55 Niklas Söderlund wrote: > Group slave address and transfer size in own structs for source and > destination. This is in preparation for hooking up the dma-mapping API > to the slave addresses. > > Signed-off-by: Niklas Sö

Re: [PATCH v3 4/8] arm: dma-mapping: add {map, unmap}_resource for iommu ops

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:54 Niklas Söderlund wrote: > Add methods to map/unmap device resources addresses for dma_map_ops that > are IOMMU aware. This is needed to map a device MMIO register from a > physical address. > > Signed-off-by: Niklas Söder

Re: [PATCH v3 2/8] dma-mapping: add {map, unmap}_resource to dma_map_ops

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:52 Niklas Söderlund wrote: > Add methods to handle mapping of device resources from a physical > address. This is needed for example to map be able to map MMIO FIFO > registers to a IOMMU. > > Signed-off-by: Niklas Söderlund

Re: [PATCH v3 1/8] iommu: Add MMIO mapping type

2016-02-10 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Wednesday 10 February 2016 01:57:51 Niklas Söderlund wrote: > From: Robin Murphy > > On some platforms, MMIO regions might need slightly different treatment > compared to mapping regular memory; add the notion of MMIO mappings to > the IOMMU API's memory t

[PATCH] iommu/amd: Apply workaround for ATS write permission check

2016-02-10 Thread Jay Cornwall
The AMD Family 15h Models 30h-3Fh (Kaveri) BIOS and Kernel Developer's Guide omitted part of the BIOS IOMMU L2 register setup specification. Without this setup the IOMMU L2 does not fully respect write permissions when handling an ATS translation request. The IOMMU L2 will set PTE dirty bit when h

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 01:56:43AM +0700, Suravee Suthikulpanit wrote: > Ah.. agree then ;) So, I should branch off that tree of yours with the file > already moved. Could you point me to it? Not my tree, tip/master: http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git, the master branch. Jus

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Suravee Suthikulpanit
Hi, On 2/11/16 01:51, Borislav Petkov wrote: So, I thought it might be alright to put the perf_event_amd_iommu.h >here. > >Having the information in the file arch/x86/events/amd/iommu.h seems >strange for having to specify ../../arch/x86/events/amd/iommu.h in the >IOMMU driver. > >So, you think

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 01:42:52AM +0700, Suravee Suthikulpanit wrote: > The reason I picked this location to place the header file is because > there is already an existing include/linux/perf/arm_pmu.h file there. I don't think anything arch-specific belongs in generic kernel header paths. > So,

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Suravee Suthikulpanit
Hi Boris, On 2/10/16 23:41, Borislav Petkov wrote: On Tue, Feb 09, 2016 at 04:53:51PM -0600, Suravee Suthikulpanit wrote: >This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and >"drivers/iommu/amd_iommu_proto.h", which contain duplicate function >declarations, into "include/l

Re: [PATCH V3 5/5] perf/amd/iommu: Enable support for multiple IOMMUs

2016-02-10 Thread Borislav Petkov
On Tue, Feb 09, 2016 at 04:53:55PM -0600, Suravee Suthikulpanit wrote: > The current amd_iommu_pc_get_set_reg_val() does not support muli-IOMMU > system. This patch replace amd_iommu_pc_get_set_reg_val() with > amd_iommu_pc_set_reg_val() and amd_iommu_pc_[set|get]_cnt_vals(). > > Also, the current

Re: [PATCH V3 4/5] perf/amd/iommu: Introduce get_iommu_bnk_cnt_evt_idx

2016-02-10 Thread Borislav Petkov
On Tue, Feb 09, 2016 at 04:53:54PM -0600, Suravee Suthikulpanit wrote: > Introduce a helper function to calculate bit-index for assigning > performance counter assignment. > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/kernel/cpu/perf_event_amd_iommu.c | 20 +++- > 1 f

Re: [PATCH V3 1/5] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-02-10 Thread Borislav Petkov
On Tue, Feb 09, 2016 at 04:53:51PM -0600, Suravee Suthikulpanit wrote: > This patch consolidates "arch/x86/kernel/cpu/perf_event_amd_iommu.h" and > "drivers/iommu/amd_iommu_proto.h", which contain duplicate function > declarations, into "include/linux/perf/perf_event_amd_iommu.h" > > Reviewed-by:

Re: [PATCH v3 1/3] iommu/io-pgtable: Add ARMv7 short descriptor support

2016-02-10 Thread Will Deacon
Hi Robin, On Tue, Jan 26, 2016 at 05:13:13PM +, Robin Murphy wrote: > Add a nearly-complete ARMv7 short descriptor implementation, omitting > only a few legacy and CPU-centric aspects which shouldn't be necessary > for IOMMU API use anyway. > > Signed-off-by: Yong Wu > Signed-off-by: Robin M

[PATCH v2] iommu/arm-smmu: Allow disabling unmatched stream bypass

2016-02-10 Thread Robin Murphy
Borrow the disable_bypass parameter from the SMMUv3 driver as a handy debugging/security feature so that unmatched stream IDs (i.e. devices not attached to an IOMMU domain) may be configured to fault. Rather than introduce unsightly inconsistency, or repeat the existing unnecessary use of module_p

Re: [PATCH v3 3/3] iommu/io-pgtable: Avoid redundant TLB syncs

2016-02-10 Thread Will Deacon
On Tue, Jan 26, 2016 at 05:13:15PM +, Robin Murphy wrote: > In certain unmapping situations it is quite possible to end up issuing > back-to-back TLB synchronisations, which at best is a waste of time and > effort, and at worst causes some hardware to get rather confused. Whilst > the pagetable

Re: [PATCH V3 0/5] perf/amd/iommu: Enable multi-IOMMU support

2016-02-10 Thread Suravee Suthikulpanit
Hi Boris, On 02/09/2016 06:08 PM, Borislav Petkov wrote: You probably want to redo those against latest tip/master: http://git.kernel.org/tip/5b26547dd7faa84e1293baa144a0f3e74ed7d4c7 -- Regards/Gruss, Boris. Sure, I'll re-base this. By the way, do you have any other comments regarding the c

Re: [PATCH v3 2/8] dma-mapping: add {map,unmap}_resource to dma_map_ops

2016-02-10 Thread Sergei Shtylyov
Hello. On 2/10/2016 3:57 AM, Niklas Söderlund wrote: Add methods to handle mapping of device resources from a physical address. This is needed for example to map be able to map MMIO FIFO ^^^ not needed registers to a IOMMU. Signed-off-by: Niklas Söde

Re: [PATCH 2/4] iommu/arm-smmu: Allow disabling unmatched stream bypass

2016-02-10 Thread Robin Murphy
On 09/02/16 14:06, Will Deacon wrote: Hi Robin, On Tue, Jan 26, 2016 at 06:06:35PM +, Robin Murphy wrote: Borrow the disable_bypass parameter from the SMMUv3 driver as a handy debugging/security feature so that unmatched stream IDs (i.e. devices not attached to an IOMMU domain) may be confi

Re: [PATCH 4/4] iommu/arm-smmu: Use per-context TLB sync as appropriate

2016-02-10 Thread Robin Murphy
On 09/02/16 14:15, Will Deacon wrote: On Tue, Jan 26, 2016 at 06:06:37PM +, Robin Murphy wrote: TLB synchronisation is a mighty big hammmer to bring down on the transaction stream, typically stalling all in-flight transactions until the sync completes. Since in most cases (except at stage 2

Re: [PATCH v3 6/8] dmaengine: rcar-dmac: add iommu support for slave transfers

2016-02-10 Thread Robin Murphy
On 10/02/16 00:57, Niklas Söderlund wrote: Enable slave transfers to devices behind IPMMU:s by mapping the slave addresses using the dma-mapping API. Signed-off-by: Niklas Söderlund --- drivers/dma/sh/rcar-dmac.c | 57 ++ 1 file changed, 52 inserti

Re: [PATCH v3 3/8] dma-mapping: add dma_{map,unmap}_resource

2016-02-10 Thread Robin Murphy
Hi Niklas, Thanks for doing this, it looks good. Just a couple of minor comments on this and the next patch... On 10/02/16 00:57, Niklas Söderlund wrote: Map/Unmap a device resource from a physical address. If no dma_map_ops method is available the operation is a no-op. Signed-off-by: Niklas