Re: [PATCH v12 00/31] iommu/exynos: Fixes and Enhancements of System MMU driver with DT

2014-04-28 Thread Arnd Bergmann
On Sunday 27 April 2014 13:07:32 Shaik Ameer Basha wrote: The current exynos-iommu(System MMU) driver does not work autonomously since it is lack of support for power management of peripheral blocks. For example, MFC device driver must ensure that its System MMU is disabled before MFC block is

Re: [PATCH v12 18/31] iommu/exynos: allow having multiple System MMUs for a master H/W

2014-04-28 Thread Tushar Behera
On 04/27/2014 01:07 PM, Shaik Ameer Basha wrote: From: Cho KyongHo pullip@samsung.com Some master device descriptor like fimc-is which is an abstraction of very complex H/W may have multiple System MMUs. For those devices, the design of the link between System MMU and its master H/W is

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Thierry Reding
On Sun, Apr 27, 2014 at 08:23:06PM +0200, Arnd Bergmann wrote: On Sunday 27 April 2014 13:07:43 Shaik Ameer Basha wrote: +- mmu-masters: A phandle to device nodes representing the master for which + the System MMU can provide a translation. Any additional values +

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Arnd Bergmann
On Monday 28 April 2014 12:39:20 Thierry Reding wrote: On Sun, Apr 27, 2014 at 08:23:06PM +0200, Arnd Bergmann wrote: On Sunday 27 April 2014 13:07:43 Shaik Ameer Basha wrote: +- mmu-masters: A phandle to device nodes representing the master for which + the System MMU

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Thierry Reding
On Mon, Apr 28, 2014 at 12:56:03PM +0200, Arnd Bergmann wrote: On Monday 28 April 2014 12:39:20 Thierry Reding wrote: On Sun, Apr 27, 2014 at 08:23:06PM +0200, Arnd Bergmann wrote: On Sunday 27 April 2014 13:07:43 Shaik Ameer Basha wrote: +- mmu-masters: A phandle to device nodes

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Arnd Bergmann
On Monday 28 April 2014 13:18:03 Thierry Reding wrote: On Mon, Apr 28, 2014 at 12:56:03PM +0200, Arnd Bergmann wrote: On Monday 28 April 2014 12:39:20 Thierry Reding wrote: And possibly with a iommu-names property to go along with that. The idea being that a device can be a master on

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Thierry Reding
On Mon, Apr 28, 2014 at 02:05:30PM +0200, Arnd Bergmann wrote: On Monday 28 April 2014 13:18:03 Thierry Reding wrote: On Mon, Apr 28, 2014 at 12:56:03PM +0200, Arnd Bergmann wrote: On Monday 28 April 2014 12:39:20 Thierry Reding wrote: And possibly with a iommu-names property to go along

[RFC PATCH v5 00/11] VFIO support for platform devices

2014-04-28 Thread Antonios Motakis
This patch series aims to implement VFIO support for platform devices that reside behind an IOMMU. Examples of such devices are devices behind an ARM SMMU, or behind a Samsung Exynos System MMU. This v5 of the VFIO_PLATFORN patch series includes a number of fixes and improvements over the

[RFC PATCH v5 03/11] VFIO_IOMMU_TYPE1 for platform bus devices on ARM

2014-04-28 Thread Antonios Motakis
This allows to make use of the VFIO_IOMMU_TYPE1 driver with platform devices on ARM in addition to PCI. This is required in order to use the Exynos SMMU, or ARM SMMU driver with VFIO_IOMMU_TYPE1. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig

[RFC PATCH v5 01/11] driver core: platform: add device binding path 'driver_override'

2014-04-28 Thread Antonios Motakis
From: Kim Phillips kim.phill...@freescale.com Needed by platform device drivers, such as the vfio-platform driver [1], in order to bypass the existing OF, ACPI, id_table and name string matches, and successfully be able to be bound to any device, like so: echo vfio-platform

[RFC PATCH v5 02/11] ARM SMMU: Add capability IOMMU_CAP_DMA_EXEC

2014-04-28 Thread Antonios Motakis
The ARM SMMU can take an IOMMU_EXEC protection flag in addition to IOMMU_READ and IOMMU_WRITE. Expose this as an IOMMU capability. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/iommu/arm-smmu.c | 2 ++ include/linux/iommu.h| 5 +++-- 2 files changed, 5

[RFC PATCH v5 04/11] VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag

2014-04-28 Thread Antonios Motakis
The ARM SMMU driver expects the IOMMU_EXEC flag, otherwise it will set the page tables for a device as XN (execute never). This affects devices such as the ARM PL330 DMA Controller, which fails to operate if the XN flag is set on the memory it tries to fetch its instructions from. We introduce

[RFC PATCH v5 05/11] VFIO_PLATFORM: Initial skeleton of VFIO support for platform devices

2014-04-28 Thread Antonios Motakis
This patch forms the skeleton for platform devices support with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig |

[RFC PATCH v5 07/11] VFIO_PLATFORM: Read and write support for the device fd

2014-04-28 Thread Antonios Motakis
VFIO returns a file descriptor which we can use to manipulate the memory regions of the device. Since some memory regions we cannot mmap due to security concerns, we also allow to read and write to this file descriptor directly. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

[RFC PATCH v5 06/11] VFIO_PLATFORM: Return info for device and its memory mapped IO regions

2014-04-28 Thread Antonios Motakis
A VFIO userspace driver will start by opening the VFIO device that corresponds to an IOMMU group, and will use the ioctl interface to get the basic device info, such as number of memory regions and interrupts, and their properties. This patch enables the IOCTLs: - VFIO_DEVICE_GET_INFO -

[RFC PATCH v5 09/11] VFIO_PLATFORM: Return IRQ info

2014-04-28 Thread Antonios Motakis
Return information for the interrupts exposed by the device. This patch extends VFIO_DEVICE_GET_INFO with the number of IRQs and enables VFIO_DEVICE_GET_IRQ_INFO Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/Makefile| 2 +-

[RFC PATCH v5 08/11] VFIO_PLATFORM: Support MMAP of MMIO regions

2014-04-28 Thread Antonios Motakis
Allow to memory map the MMIO regions of the device so userspace can directly access them. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 40 ++- 1 file changed, 39 insertions(+), 1 deletion(-) diff

Re: [RFC PATCH v5 03/11] VFIO_IOMMU_TYPE1 for platform bus devices on ARM

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: This allows to make use of the VFIO_IOMMU_TYPE1 driver with platform devices on ARM in addition to PCI. This is required in order to use the Exynos SMMU, or ARM SMMU driver with VFIO_IOMMU_TYPE1. Signed-off-by: Antonios Motakis

Re: [RFC PATCH v5 04/11] VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: The ARM SMMU driver expects the IOMMU_EXEC flag, otherwise it will set the page tables for a device as XN (execute never). This affects devices such as the ARM PL330 DMA Controller, which fails to operate if the XN flag is set on the

Re: [RFC PATCH v5 05/11] VFIO_PLATFORM: Initial skeleton of VFIO support for platform devices

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: This patch forms the skeleton for platform devices support with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile

Re: [RFC PATCH v5 07/11] VFIO_PLATFORM: Read and write support for the device fd

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: VFIO returns a file descriptor which we can use to manipulate the memory regions of the device. Since some memory regions we cannot mmap due to security concerns, we also allow to read and write to this file descriptor directly. If

Re: [RFC PATCH v5 08/11] VFIO_PLATFORM: Support MMAP of MMIO regions

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: Allow to memory map the MMIO regions of the device so userspace can directly access them. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 40

Re: [RFC PATCH v5 09/11] VFIO_PLATFORM: Return IRQ info

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: Return information for the interrupts exposed by the device. This patch extends VFIO_DEVICE_GET_INFO with the number of IRQs and enables VFIO_DEVICE_GET_IRQ_INFO Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com ---

Re: [RFC PATCH v5 11/11] VFIO_PLATFORM: Support for maskable and automasked interrupts

2014-04-28 Thread Alex Williamson
On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: Adds support to mask interrupts, and also for automasked interrupts. Level sensitive interrupts are exposed as automasked interrupts and are masked and disabled automatically when they fire. Signed-off-by: Antonios Motakis

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Stephen Warren
On 04/28/2014 05:18 AM, Thierry Reding wrote: On Mon, Apr 28, 2014 at 12:56:03PM +0200, Arnd Bergmann wrote: ... A lot of drivers probably only support one master, so they can just set #iommu-cells=0, others might require IDs that do not fit into one cell. You mean #iommu-cells = 1 for

Re: [RFC PATCH v5 03/11] VFIO_IOMMU_TYPE1 for platform bus devices on ARM

2014-04-28 Thread Will Deacon
Hi Alex, On Mon, Apr 28, 2014 at 05:43:41PM +0100, Alex Williamson wrote: On Mon, 2014-04-28 at 17:52 +0200, Antonios Motakis wrote: This allows to make use of the VFIO_IOMMU_TYPE1 driver with platform devices on ARM in addition to PCI. This is required in order to use the Exynos SMMU, or

Re: [PATCH v12 11/31] documentation: iommu: add binding document of Exynos System MMU

2014-04-28 Thread Will Deacon
Hi Arnd, [and thanks Thierry for CCing me -- I have been tangled up with this before :)] On Mon, Apr 28, 2014 at 01:05:30PM +0100, Arnd Bergmann wrote: On Monday 28 April 2014 13:18:03 Thierry Reding wrote: There still has to be one cell to specify which master. Unless perhaps if they can

[PATCH] iommu/amd: Take mmap_sem when calling get_user_pages

2014-04-28 Thread suravee.suthikulpanit
From: Jay Cornwall jay.cornw...@amd.com get_user_pages requires caller to hold a read lock on mmap_sem. Signed-off-by: Jay Cornwall jay.cornw...@amd.com Signed-off-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com --- drivers/iommu/amd_iommu_v2.c |2 ++ 1 file changed, 2 insertions(+)

Re: [PATCH v12 30/31] ARM: dts: add System MMU nodes of exynos5250

2014-04-28 Thread Doug Anderson
Vikas, On Sun, Apr 27, 2014 at 10:39 AM, Vikas Sajjan sajjan.li...@gmail.com wrote: Hi shaik, +Doug, Abhilash, On Sun, Apr 27, 2014 at 1:08 PM, Shaik Ameer Basha shaik.am...@samsung.com wrote: From: Cho KyongHo pullip@samsung.com Signed-off-by: Cho KyongHo pullip@samsung.com