Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Borislav Petkov
On Fri, Mar 18, 2016 at 12:11:01PM +0100, Joerg Roedel wrote: > On Fri, Mar 18, 2016 at 11:39:18AM +0100, Borislav Petkov wrote: > > Yeah, so arch/x86/include/asm/ has all the x86-specific stuff which is > > not exported to userspace, so moving stuff there makes sense to me. > > While the AMD IOMM

Re: [RFT] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-03-19 Thread Luis R. Rodriguez
On Wed, Mar 16, 2016 at 05:39:00PM +0100, Joerg Roedel wrote: > On Wed, Mar 16, 2016 at 05:17:37PM +0100, Luis R. Rodriguez wrote: > > On Wed, Mar 16, 2016 at 12:16:57PM +0200, Oded Gabbay wrote: > > > In theory it should, but I would prefer that it would be tested on > > > actual hardware. > > >

Re: [RFT] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-03-19 Thread Joerg Roedel
On Wed, Mar 16, 2016 at 05:17:37PM +0100, Luis R. Rodriguez wrote: > On Wed, Mar 16, 2016 at 12:16:57PM +0200, Oded Gabbay wrote: > > In theory it should, but I would prefer that it would be tested on > > actual hardware. > > Hence, RFT. Anyone have hardware to test ? And would the other hack > me

Re: [PATCH] iommu/vt-d: Ratelimit fault handler

2016-03-19 Thread Alex Williamson
On Tue, 15 Mar 2016 19:47:56 + David Woodhouse wrote: > On Tue, 2016-03-15 at 10:35 -0600, Alex Williamson wrote: > > Fault rates can easily overwhelm the console and make the system > > unresponsive.  Ratelimit to allow an opportunity for maintenance. > > > > Signed-off-by: Alex Williamson

Re: [PATCH 00/04] iommu/ipmmu-vmsa: IPMMU CONFIG_IOMMU_DMA update

2016-03-19 Thread Laurent Pinchart
Hi Magnus, Thank you for the patches. On Wednesday 16 March 2016 02:04:31 Magnus Damm wrote: > iommu/ipmmu-vmsa: IPMMU CONFIG_IOMMU_DMA update > > [PATCH 01/04] iommu/ipmmu-vmsa: 32-bit ARM may have CONFIG_IOMMU_DMA=y > [PATCH 02/04] iommu/ipmmu-vmsa: Break out utlb parsing code > [PATCH 03/04]

Re: [PATCH v2 1/2] iommu/vt-d: Ratelimit fault handler

2016-03-19 Thread Joe Perches
On Thu, 2016-03-17 at 14:12 -0600, Alex Williamson wrote: > Fault rates can easily overwhelm the console and make the system > unresponsive.  Ratelimit to allow an opportunity for maintenance. [] > diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c [] > @@ -1602,10 +1602,17 @@ irqreturn_t dma

Re: [v6, 3/5] dt: move guts devicetree doc out of powerpc directory

2016-03-19 Thread Rob Herring
On Wed, Mar 09, 2016 at 06:08:49PM +0800, Yangbo Lu wrote: > Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/ > since it's used by not only PowerPC but also ARM. And add a specification > for 'little-endian' property. > > Signed-off-by: Yangbo Lu > --- > Changes for v2: >

[PATCH 07/10] iommu/ipmmu-vmsa: Write IMCTR twice

2016-03-19 Thread Magnus Damm
From: Magnus Damm Write IMCTR both in the root device and the leaf node. Signed-off-by: Magnus Damm --- drivers/iommu/ipmmu-vmsa.c | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) --- 0021/drivers/iommu/ipmmu-vmsa.c +++ work/drivers/iommu/ipmmu-vmsa.c 2016-03-18

[PATCH] iommu: remove the iommu_callback_data

2016-03-19 Thread Wei Yang
According to the code path, iommu_callback_data is passed in iommu_bus_init() and just used in {add/remove}_iommu_group, by when the bus->iommu_ops is already set up properly. This patch removes the iommu_callback_data by retrieving iommu_ops from bus->iommu_ops directly. Signed-off-by: Wei Yang

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

2016-03-19 Thread Laurent Pinchart
Hello, On Tuesday 15 March 2016 01:22:54 Christoph Hellwig wrote: > On Fri, Mar 11, 2016 at 01:58:46PM +0100, Niklas S?derlund wrote: > > Without an IOMMU this is easy since the phys_addr_t and dma_addr_t are > > the same and no special care is needed. However if you have a IOMMU you > > need to m

Re: [v6, 3/5] dt: move guts devicetree doc out of powerpc directory

2016-03-19 Thread Scott Wood
On 03/17/2016 12:06 PM, Rob Herring wrote: > On Wed, Mar 09, 2016 at 06:08:49PM +0800, Yangbo Lu wrote: >> Move guts devicetree doc to Documentation/devicetree/bindings/soc/fsl/ >> since it's used by not only PowerPC but also ARM. And add a specification >> for 'little-endian' property. >> >> Signe

Re: DMAR error messages after 'shutdown -r'.

2016-03-19 Thread Joerg Roedel
On Mon, Mar 07, 2016 at 04:41:57PM -0500, valdis.kletni...@vt.edu wrote: > > lspci says: > 00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port > SATA Controller [AHCI mode] (rev 04) > > Not sure why I only see it on reboots - that means that when powering up, the > kernel

Re: [v6, 2/5] soc: fsl: add GUTS driver for QorIQ platforms

2016-03-19 Thread Scott Wood
On 03/09/2016 04:18 AM, Yangbo Lu wrote: > +#ifdef CONFIG_FSL_GUTS > +u32 fsl_guts_get_svr(void); > +int fsl_guts_init(void); > +#endif Don't ifdef prototypes (when not providing a stub alternative). -Scott ___ iommu mailing list iommu@lists.linux-foun

[RFT] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-03-19 Thread Luis R. Rodriguez
We need to ensure amd iommu v2 initializes before driver uses such as drivers/gpu/drm/amd/amdkfd/kfd_module.c, to do this make its init routine a subsys_initcall() which ensures its load init is called first than modules when built-in. Signed-off-by: Luis R. Rodriguez --- Can someone test if thi

[PATCH 1/2] of: Implement iterator for phandles

2016-03-19 Thread Joerg Roedel
From: Joerg Roedel Getting the arguments of phandles is somewhat limited at the moement, because the number of arguments supported by core code is limited to MAX_PHANDLE_ARGS, which is set to 16 currently. In case of the arm smmu this is not enough, as the 128 supported stream-ids are encoded in

Re: [v6, 3/5] dt: move guts devicetree doc out of powerpc directory

2016-03-19 Thread Arnd Bergmann
On Thursday 17 March 2016 12:06:40 Rob Herring wrote: > > diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt > > b/Documentation/devicetree/bindings/soc/fsl/guts.txt > > similarity index 91% > > rename from Documentation/devicetree/bindings/powerpc/fsl/guts.txt > > rename to Docum

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
Hi On 03/15/2016 05:53 PM, Peter Zijlstra wrote: On Tue, Mar 15, 2016 at 11:40:17AM +0100, Borislav Petkov wrote: On Tue, Mar 15, 2016 at 07:39:31AM +0700, Suravee Suthikulpanit wrote: What if I just merge the newly introduced arch/x86/include/perf/amd/iommu.h into the include/linux/amd-iommu.

[PATCH v2 2/2] iommu/vt-d: Improve fault handler error messages

2016-03-19 Thread Alex Williamson
Remove new line in error logs, avoid duplicate and explicit pr_fmt. Suggested-by: Joe Perches Signed-off-by: Alex Williamson --- drivers/iommu/dmar.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 8f8bfff..6

[PATCH 2/2] iommu/arm-smmu: Make use of phandle iterators in device-tree parsing

2016-03-19 Thread Joerg Roedel
From: Joerg Roedel Remove the usage of of_parse_phandle_with_args() and replace it by the phandle-iterator implementation to be able to parse out all of the potentially present 128 stream-ids. Signed-off-by: Joerg Roedel --- drivers/iommu/arm-smmu.c | 27 +-- 1 file cha

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
Hi Boris, On 03/18/2016 04:04 PM, Borislav Petkov wrote: On Fri, Mar 18, 2016 at 02:07:25PM +0700, Suravee Suthikulpanit wrote: Actually the exposed APIs (in both files) are from the AMD IOMMU driver, which is not necessary x86-specific. They mostly use struct pci_dev, which is also arch-agnost

[PATCH v2] powerpc: Fix incorrect PPC32 PAMU dependency

2016-03-19 Thread Andy Fleming
The Freescale PAMU can be enabled on both 32 and 64-bit Power chips. Commit 477ab7a19cec8409e4e2dd10e7348e4cac3c06e5 (iommu: Make more drivers depend on COMPILE_TEST) restricted PAMU to PPC32. PPC covers both. Signed-off-by: Andy Fleming --- v2: Implemented Michael Ellerman's suggestion to clean

Re: [PATCH v2 03/04] iommu/ipmmu-vmsa: Break out 32-bit ARM mapping code

2016-03-19 Thread Robin Murphy
Hi Magnus, On 15/03/16 04:22, Magnus Damm wrote: From: Magnus Damm Make the driver compile on more than just 32-bit ARM by breaking out and wrapping ARM specific functions in #ifdefs. Not pretty, but needed to be able to use the driver on other architectures like ARM64. Signed-off-by: Magnus

[PATCH v2 1/2] iommu/vt-d: Ratelimit fault handler

2016-03-19 Thread Alex Williamson
Fault rates can easily overwhelm the console and make the system unresponsive. Ratelimit to allow an opportunity for maintenance. Signed-off-by: Alex Williamson --- drivers/iommu/dmar.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/dri

Re: [PATCH 04/04] iommu/ipmmu-vmsa: Add new IOMMU_DOMAIN_DMA ops

2016-03-19 Thread Robin Murphy
On 15/03/16 17:05, Magnus Damm wrote: From: Magnus Damm Introduce a new set of iommu_ops suitable for 64-bit ARM as well as 32-bit ARM when CONFIG_IOMMU_DMA=y. The ->of_xlate() callback is needed by the code exported by of_iommu.h and it is wrapped in #ifdefs to also compile of x86_64. Signed-

Re: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0

2016-03-19 Thread Scott Wood
On 03/14/2016 02:29 AM, Yangbo Lu wrote: >> -Original Message- >> From: Arnd Bergmann [mailto:a...@arndb.de] >> Sent: Monday, March 14, 2016 6:26 AM >> To: linuxppc-...@lists.ozlabs.org >> Cc: Yangbo Lu; devicet...@vger.kernel.org; linux-arm- >> ker...@lists.infradead.org; linux-ker...@vger

Re: [v6, 3/5] dt: move guts devicetree doc out of powerpc directory

2016-03-19 Thread Rob Herring
On Thu, Mar 17, 2016 at 12:11 PM, Arnd Bergmann wrote: > On Thursday 17 March 2016 12:06:40 Rob Herring wrote: >> > diff --git a/Documentation/devicetree/bindings/powerpc/fsl/guts.txt >> > b/Documentation/devicetree/bindings/soc/fsl/guts.txt >> > similarity index 91% >> > rename from Documentatio

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Borislav Petkov
On Fri, Mar 18, 2016 at 02:07:25PM +0700, Suravee Suthikulpanit wrote: > Actually the exposed APIs (in both files) are from the AMD IOMMU driver, > which is not necessary x86-specific. They mostly use struct pci_dev, which > is also arch-agnostic. It is correct that the current IOMMU IP is only > a

[PATCH 1/2] iommu/vt-d: replace *hdr with hdr[0] in struct dmar_drhd_unit

2016-03-19 Thread Wei Yang
hdr in struct dmar_drhd_unit is used to point the DMAR hardware unit copied at the end of struct dmar_drhd_unit. One zero-sized array may be more elegant for this purpose. This patch replace *hdr with hdr[0] in struct dmar_drhd_unit. Besides this, this patch includes other two changes: 1. remove

Re: [PATCH v2 03/04] iommu/ipmmu-vmsa: Break out 32-bit ARM mapping code

2016-03-19 Thread Laurent Pinchart
Hi Magnus, Thank you for the patch. On Tuesday 15 March 2016 13:22:04 Magnus Damm wrote: > From: Magnus Damm > > Make the driver compile on more than just 32-bit ARM > by breaking out and wrapping ARM specific functions > in #ifdefs. Not pretty, but needed to be able to use > the driver on othe

Re: [v6, 5/5] mmc: sdhci-of-esdhc: fix host version for T4240-R1.0-R2.0

2016-03-19 Thread Rob Herring
On Mon, Mar 14, 2016 at 05:45:43PM +, Scott Wood wrote: > On 03/14/2016 02:29 AM, Yangbo Lu wrote: > >> -Original Message- > >> From: Arnd Bergmann [mailto:a...@arndb.de] > >> Sent: Monday, March 14, 2016 6:26 AM > >> To: linuxppc-...@lists.ozlabs.org > >> Cc: Yangbo Lu; devicet...@vger

Re: [PATCH v2 1/2] iommu/vt-d: Ratelimit fault handler

2016-03-19 Thread Alex Williamson
On Thu, 17 Mar 2016 13:33:30 -0700 Joe Perches wrote: > On Thu, 2016-03-17 at 14:12 -0600, Alex Williamson wrote: > > Fault rates can easily overwhelm the console and make the system > > unresponsive.  Ratelimit to allow an opportunity for maintenance. > [] > > diff --git a/drivers/iommu/dmar.c

Re: [PATCH V5 02/10] perf/amd/iommu: Consolidate and move perf_event_amd_iommu header

2016-03-19 Thread Suravee Suthikulpanit
On 03/18/2016 04:29 PM, Borislav Petkov wrote: On Fri, Mar 18, 2016 at 04:09:33PM +0700, Suravee Suthikulpanit wrote: But the whole point is that since we are moving it to consolidate these duplicated declarations, I think we should just put it in the most common place. The include/linux/amd-iom

Re: [PATCH v2 0/2] iommu/vt-d: Fault logging improvements

2016-03-19 Thread Joe Perches
On Thu, 2016-03-17 at 14:12 -0600, Alex Williamson wrote: > Ratelimit and improve formatting. Makes sense, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [RFT] iommu/amd: use subsys_initcall() on amdv2 iommu

2016-03-19 Thread Joerg Roedel
On Wed, Mar 16, 2016 at 05:57:47PM +0100, Luis R. Rodriguez wrote: > I'm afraid I am not sure where that hack is, can someone construct a patch to > revert that so this is a proper RFT series ? Oded mentioned 1bacc894c227fad8a727eb99728df708eba57654, which reverts fine here on v4.5. Joer

Re: [PATCH v5 1/9] iommu: Add MMIO mapping type

2016-03-19 Thread Laurent Pinchart
Hi Niklas, Thank you for the patch. On Tuesday 08 March 2016 03:42:46 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 type f

Re: [PATCH v2 02/04] iommu/ipmmu-vmsa: Rework interrupt code and use bitmap for context

2016-03-19 Thread Laurent Pinchart
Hi Magnus, Thank you for the patch. On Tuesday 15 March 2016 13:21:55 Magnus Damm wrote: > From: Magnus Damm > > Introduce a bitmap for context handing and convert the > interrupt routine to go handle all registered contexts. > > At this point the number of contexts are still limited. > > Als

[PATCH 10/10] iommu/ipmmu-vmsa: Hook up r8a7795 DT matching code

2016-03-19 Thread Magnus Damm
From: Magnus Damm Tie in r8a7795 features and update the IOMMU_OF_DECLARE compat string to hook up the updated compat string. TODO: - Go over init order once more - Consider counting number of IPMMU devices from ->xlate() - Experiment with delaying call to bus_set_iommu() - Poke around with