Re: [PATCH v2 2/4] iommu/arm-smmu: Invoke DT probe from arm_smmu_of_setup()

2016-02-18 Thread Anup Patel
On Thu, Feb 18, 2016 at 5:30 PM, Sricharan wrote: > Hi, > >> -Original Message- >> From: linux-arm-kernel [mailto:linux-arm-kernel- >> boun...@lists.infradead.org] On Behalf Of Anup Patel >> Sent: Monday, February 08, 2016 10:48 AM >> To: Catalin Marinas; Joerg

RE: RFC: extend IOMMU attributes

2016-02-18 Thread Stuart Yoder
> -Original Message- > From: Will Deacon [mailto:will.dea...@arm.com] > Sent: Thursday, February 18, 2016 10:22 AM > To: Stuart Yoder > Cc: j...@8bytes.org; robin.mur...@arm.com; iommu@lists.linux-foundation.org; > linux-arm- > ker...@lists.infradead.org; Varun

[PATCH V2] iommu/arm-smmu-v2: Workaround for ThunderX errata#27704

2016-02-18 Thread tchalamarla
From: Tirumalesh Chalamarla Due to Errata#27704 CN88xx SMMUv2,supports only shared ASID and VMID namespaces; specifically within a given node SMMU0 and SMMU1 share, as does SMMU2 and SMMU3. This patch tries to address these issuee by supplying asid and vmid base

[PATCH] iommu/arm-smmu-v2: Add support for 16 bit VMID

2016-02-18 Thread tchalamarla
From: Tirumalesh Chalamarla ARM-SMMUv2 supports upto 16 bit VMID. This patch enables 16 bit VMID when requested from device-tree. Signed-off-by: Tirumalesh Chalamarla --- .../devicetree/bindings/iommu/arm,smmu.txt | 2

RFC: extend IOMMU attributes

2016-02-18 Thread Stuart Yoder
Hi Joerg and Will, We are implementing support for some specialized NXP SoC network devices and have the desire to extend the mapping attributes beyond those currently in iommu.h. (I see there is a recent proposal to add an IOMMU_MMIO flag) What we have right now in Linux is a

[GIT PULL] iommu/io-pgtable: Updates for 4.6

2016-02-18 Thread Will Deacon
Hi Joerg, Here are the io-pgtable updates from Robin for 4.6. The bulk of this is adding support for the ARM v7s page table format, which will be used by the Mediatek IOMMU driver from Yong Wu. Subsequent work may also enable this format for the ARM SMMU. Cheers, Will --->8 The following

Re: [RFC v3 07/15] iommu: iommu_get/put_single_reserved

2016-02-18 Thread Eric Auger
Hi Marc, On 02/18/2016 05:51 PM, Marc Zyngier wrote: > On 18/02/16 16:42, Eric Auger wrote: >> Hello, >> On 02/18/2016 12:06 PM, Marc Zyngier wrote: >>> On Fri, 12 Feb 2016 08:13:09 + >>> Eric Auger wrote: >>> This patch introduces iommu_get/put_single_reserved.

Re: [RFC v3 15/15] irqchip/gicv2m/v3-its-pci-msi: IOMMU map the MSI frame when needed

2016-02-18 Thread Eric Auger
Hi Marc, On 02/18/2016 04:47 PM, Marc Zyngier wrote: > On 18/02/16 15:33, Eric Auger wrote: >> Hi Marc, >> On 02/18/2016 12:33 PM, Marc Zyngier wrote: >>> On Fri, 12 Feb 2016 08:13:17 + >>> Eric Auger wrote: >>> In case the msi_desc references a device attached to

Re: [PATCH v8 3/5] memory: mediatek: Add SMI driver

2016-02-18 Thread Philipp Zabel
Hi Joerg, Am Dienstag, den 16.02.2016, 17:26 +0100 schrieb Joerg Roedel: > On Tue, Feb 16, 2016 at 04:20:00PM +, Will Deacon wrote: > > I'm more than happy to bake a branch containing all the page table stuff, > > but Yong's stuff depends on it so I'll work with whatever is easiest for > >

Re: [RFC v3 07/15] iommu: iommu_get/put_single_reserved

2016-02-18 Thread Eric Auger
Hello, On 02/18/2016 12:06 PM, Marc Zyngier wrote: > On Fri, 12 Feb 2016 08:13:09 + > Eric Auger wrote: > >> This patch introduces iommu_get/put_single_reserved. >> >> iommu_get_single_reserved allows to allocate a new reserved iova page >> and map it onto the physical

Re: RFC: extend IOMMU attributes

2016-02-18 Thread Will Deacon
Hi Stuart, On Thu, Feb 18, 2016 at 04:16:26PM +, Stuart Yoder wrote: > We are implementing support for some specialized NXP SoC network > devices and have the desire to extend the mapping attributes beyond > those currently in iommu.h. (I see there is a recent proposal to > add an IOMMU_MMIO

Re: [RFC v3 05/15] iommu/arm-smmu: implement alloc/free_reserved_iova_domain

2016-02-18 Thread Alex Williamson
On Thu, 18 Feb 2016 11:09:17 + Robin Murphy wrote: > Hi Eric, > > On 12/02/16 08:13, Eric Auger wrote: > > Implement alloc/free_reserved_iova_domain for arm-smmu. we use > > the iova allocator (iova.c). The iova_domain is attached to the > > arm_smmu_domain struct. A

Re: [RFC v3 15/15] irqchip/gicv2m/v3-its-pci-msi: IOMMU map the MSI frame when needed

2016-02-18 Thread Eric Auger
Hi Marc, On 02/18/2016 12:33 PM, Marc Zyngier wrote: > On Fri, 12 Feb 2016 08:13:17 + > Eric Auger wrote: > >> In case the msi_desc references a device attached to an iommu >> domain, the msi address needs to be mapped in the IOMMU. Else any >> MSI write transaction

Re: [RFC v3 02/15] vfio: expose MSI mapping requirement through VFIO_IOMMU_GET_INFO

2016-02-18 Thread Eric Auger
Hi Marc, On 02/18/2016 10:34 AM, Marc Zyngier wrote: > On Fri, 12 Feb 2016 08:13:04 + > Eric Auger wrote: > >> This patch allows the user-space to retrieve whether msi write >> transaction addresses must be mapped. This is returned through the >> VFIO_IOMMU_GET_INFO

Re: [RFC v3 05/15] iommu/arm-smmu: implement alloc/free_reserved_iova_domain

2016-02-18 Thread Eric Auger
Hi Robin, On 02/18/2016 12:09 PM, Robin Murphy wrote: > Hi Eric, > > On 12/02/16 08:13, Eric Auger wrote: >> Implement alloc/free_reserved_iova_domain for arm-smmu. we use >> the iova allocator (iova.c). The iova_domain is attached to the >> arm_smmu_domain struct. A mutex is introduced to

[PATCH v2 10/13] iommu: exynos: update device tree documentation

2016-02-18 Thread Marek Szyprowski
Exynos SYSMMU bindings documentation was merged before generic IOMMU binding have been introduced. This patch updates documentation to match current state. Signed-off-by: Marek Szyprowski --- .../devicetree/bindings/iommu/samsung,sysmmu.txt | 19

[PATCH v2 02/13] iommu: exynos: add support for IOMMU_DOMAIN_DMA domain type

2016-02-18 Thread Marek Szyprowski
This patch adds support for DMA domain type. Such domain have DMA cookie prepared and can be used by generic DMA-IOMMU glue layer. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 19 +++ 1 file changed, 15 insertions(+), 4

[PATCH v2 11/13] iommu: exynos: add support for v5 SYSMMU

2016-02-18 Thread Marek Szyprowski
This patch adds support for v5 of SYSMMU controller, found in Samsung Exynos 5433 SoCs. The main difference of v5 is support for 36-bit physical address space and some changes in register layout and core clocks hanging. This patch also adds support for ARM64 architecture, which is used by Exynos

[PATCH v2 13/13] iommu: exynos: support multiple attach_device calls

2016-02-18 Thread Marek Szyprowski
IOMMU core calls attach_device callback without detaching device from the previous domain. This patch adds support for such unballanced calls. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 72 1 file

[PATCH v2 06/13] iommu: exynos: refactor fault handling code

2016-02-18 Thread Marek Szyprowski
This patch provides a new implementation for page fault handing code. The new implementation is ready for future extensions. No functional changes have been made. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 109

[PATCH v2 09/13] iommu: exynos: add support for SYSMMU controller with bogus version reg

2016-02-18 Thread Marek Szyprowski
SYSMMU on some SoCs reports bogus values in VERSION register. Force hardware version to 1.0 for such controllers. This patch also moves reading version register to driver's probe() function. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 24

[PATCH v2 04/13] iommu: exynos: simplify master clock operations

2016-02-18 Thread Marek Szyprowski
All clock API function can be called on NULL clock, so simplify code avoid checking of master clock presence. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 32 1 file changed, 12 insertions(+), 20 deletions(-) diff

[PATCH v2 07/13] iommu: exynos: refactor init config code

2016-02-18 Thread Marek Szyprowski
This patch rewrites sysmmu_init_config function to make it easier to read and understand. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git

[PATCH v2 08/13] iommu: exynos: unify code for fldp cache invalidation

2016-02-18 Thread Marek Szyprowski
This patch simplifies the code for handling of flpdcache invalidation. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/exynos-iommu.c

[PATCH v2 01/13] iommu: exynos: rework iommu group initialization

2016-02-18 Thread Marek Szyprowski
This patch replaces custom code in add_device implementation with iommu_group_get_for_dev() call and provides the needed callback. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 27 --- 1 file changed, 16 insertions(+), 11

[PATCH v2 05/13] iommu: exynos: refactor code (no direct register access)

2016-02-18 Thread Marek Szyprowski
This patch changes some internal functions to have access to the state of sysmmu device instead of having only it's registers. This will make the code ready for future extensions. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 40

[PATCH v2 00/13] SYSMMU driver update and support for Exynos 5433

2016-02-18 Thread Marek Szyprowski
Hello, This patchset updates Exynos SYSMMU (IOMMU) driver to make use of the new features in the IOMMU core (support for IOMMU_DOMAIN_DMA) and adds support for SYSMMU v5 controllers, which are available in Samsung Exynos 5433 SoCs. The driver has been also updated to compile and work on ARM64

[PATCH v2 03/13] iommu: exynos: remove ARM-specific cache flush interface

2016-02-18 Thread Marek Szyprowski
This patch replaces custom ARM-specific code for performing CPU cache flush operations with generic code based on DMA-mapping. Domain managing code is independent of particular SYSMMU device, so the first registered SYSMMU device is used for DMA-mapping calls. This simplification works fine

Re: [RFC PATCH 1/2] PCI: Add PCI device flag PCI_DEV_FLAGS_BRIDGE_SKIP_ALIAS

2016-02-18 Thread Jayachandran Chandrashekaran Nair
On Wed, Feb 17, 2016 at 8:58 PM, Alex Williamson wrote: > On Wed, 17 Feb 2016 17:15:09 +0530 > Jayachandran Chandrashekaran Nair > wrote: > >> On Wed, Feb 17, 2016 at 3:55 AM, Alex Williamson >>

Re: [PATCH V4 6/6] perf/amd/iommu: Clean up print messages pr_debug

2016-02-18 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 04:15:27PM +0700, Suravee Suthikulpanit wrote: > From: Suravee Suthikulpanit > > This patch declares pr_fmt for perf/amd_iommu, removes unnecessary > pr_debug, and clean up error messages. For the next version, move all the cleanups first

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

2016-02-18 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 04:15:26PM +0700, Suravee Suthikulpanit wrote: > The current amd_iommu_pc_get_set_reg_val() does not support muli-IOMMU multi > system. This patch replace amd_iommu_pc_get_set_reg_val() with You don't need to say in the commit message what this patch does - I think most

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

2016-02-18 Thread Peter Zijlstra
On Thu, Feb 11, 2016 at 04:15:26PM +0700, Suravee Suthikulpanit wrote: > static void perf_iommu_read(struct perf_event *event) > { > + int i; > u64 delta = 0ULL; > struct hw_perf_event *hwc = >hw; > + struct perf_amd_iommu *perf_iommu = container_of(event->pmu, > +

RE: [PATCH v2 2/4] iommu/arm-smmu: Invoke DT probe from arm_smmu_of_setup()

2016-02-18 Thread Sricharan
Hi, > -Original Message- > From: linux-arm-kernel [mailto:linux-arm-kernel- > boun...@lists.infradead.org] On Behalf Of Anup Patel > Sent: Monday, February 08, 2016 10:48 AM > To: Catalin Marinas; Joerg Roedel; Will Deacon; Robin Murphy; Sricharan R; > Linux IOMMU; Linux ARM Kernel > Cc:

Re: [PATCH V4 4/6] perf/amd/iommu: Introduce get_iommu_bnk_cnt_evt_idx

2016-02-18 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 04:15:25PM +0700, Suravee Suthikulpanit wrote: > Introduce a helper function to calculate bit-index for assigning > performance counter assignment. > > Signed-off-by: Suravee Suthikulpanit > --- > arch/x86/events/amd/iommu.c | 19

Re: [RFC v3 15/15] irqchip/gicv2m/v3-its-pci-msi: IOMMU map the MSI frame when needed

2016-02-18 Thread Marc Zyngier
On Fri, 12 Feb 2016 08:13:17 + Eric Auger wrote: > In case the msi_desc references a device attached to an iommu > domain, the msi address needs to be mapped in the IOMMU. Else any > MSI write transaction will cause a fault. > > gic_set_msi_addr detects that case and

Re: [PATCH V4 2/6] perf/amd/iommu: Modify functions to query max banks and counters

2016-02-18 Thread Borislav Petkov
On Thu, Feb 11, 2016 at 04:15:23PM +0700, Suravee Suthikulpanit wrote: > Currently, amd_iommu_pc_get_max_[banks|counters]() require devid, > which should not be the case. Why? Commit message could use an explanation. > Also, these don't properly support > multi-IOMMU system. > > Current and

Re: [RFC v3 05/15] iommu/arm-smmu: implement alloc/free_reserved_iova_domain

2016-02-18 Thread Robin Murphy
Hi Eric, On 12/02/16 08:13, Eric Auger wrote: Implement alloc/free_reserved_iova_domain for arm-smmu. we use the iova allocator (iova.c). The iova_domain is attached to the arm_smmu_domain struct. A mutex is introduced to protect it. The IOMMU API currently leaves IOVA management entirely up

Re: [RFC v3 07/15] iommu: iommu_get/put_single_reserved

2016-02-18 Thread Marc Zyngier
On Fri, 12 Feb 2016 08:13:09 + Eric Auger wrote: > This patch introduces iommu_get/put_single_reserved. > > iommu_get_single_reserved allows to allocate a new reserved iova page > and map it onto the physical page that contains a given physical address. > It returns

Re: [RFC v3 02/15] vfio: expose MSI mapping requirement through VFIO_IOMMU_GET_INFO

2016-02-18 Thread Marc Zyngier
On Fri, 12 Feb 2016 08:13:04 + Eric Auger wrote: > This patch allows the user-space to retrieve whether msi write > transaction addresses must be mapped. This is returned through the > VFIO_IOMMU_GET_INFO API and its new flag: VFIO_IOMMU_INFO_REQUIRE_MSI_MAP. > >