[PATCH] iommu: shmobile: depend on ARCH_SHMOBILE

2014-02-08 Thread Paul Bolle
Commit 78a2e12f51d9 ("iommu: shmobile: Enable driver compilation with COMPILE_TEST") added an optional dependency on SH_MOBILE. But that Kconfig symbol doesn't exist. It seems ARCH_SHMOBILE was intended. Use that. Signed-off-by: Paul Bolle --- Completely untested. drivers/iommu/Kconfig | 2 +-

[RFC PATCH v4 09/10] VFIO_PLATFORM: Initial interrupts support

2014-02-08 Thread Antonios Motakis
This patch allows to set an eventfd for a patform device's interrupt, and also to trigger the interrupt eventfd from userspace for testing. Signed-off-by: Antonios Motakis Tested-by: Alvise Rigo --- drivers/vfio/platform/vfio_platform.c | 36 +++- drivers/vfio/platform/vfio_platfor

[RFC PATCH v4 10/10] VFIO_PLATFORM: Support for maskable and automasked interrupts

2014-02-08 Thread Antonios Motakis
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 Tested-by: Alvise Rigo --- drivers/vfio/platform/vfio_platform_irq.c

[RFC PATCH v4 08/10] VFIO_PLATFORM: Return IRQ info

2014-02-08 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 --- drivers/vfio/platform/Makefile| 2 +- drivers/vfio/platform/vfio_platform.c

[RFC PATCH v4 07/10] VFIO_PLATFORM: Support MMAP of MMIO regions

2014-02-08 Thread Antonios Motakis
Allow to memory map the MMIO regions of the device so userspace can directly access them. Signed-off-by: Antonios Motakis Tested-by: Alvise Rigo --- drivers/vfio/platform/vfio_platform.c | 33 + 1 file changed, 33 insertions(+) diff --git a/drivers/vfio/platform

[RFC PATCH v4 05/10] VFIO_PLATFORM: Return info for device and its memory mapped IO regions

2014-02-08 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 - VFIO_DEV

[RFC PATCH v4 06/10] VFIO_PLATFORM: Read and write support for the device fd

2014-02-08 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 Tested-by: Alvise Rigo --- drivers

[RFC PATCH v4 04/10] VFIO_PLATFORM: Initial skeleton of VFIO support for platform devices

2014-02-08 Thread Antonios Motakis
This patch forms the skeleton for platform devices support with VFIO. We implement a new 'vfio_bind' sysfs file, that, once written with a device ID, binds the platform driver to the device directly. Bypassing the driver core's traditional bind file allows this platform driver to bind to any device

[RFC PATCH v4 02/10] VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag

2014-02-08 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 the

[RFC PATCH v4 01/10] driver core: export driver_probe_device()

2014-02-08 Thread Antonios Motakis
From: Kim Phillips Needed by drivers, such as the vfio platform driver [1], seeking to bypass bind_store()'s driver_match_device(), and bind to any device via a private sysfs bind file. [1] https://lkml.org/lkml/2013/12/11/522 note: the EXPORT_SYMBOL is needed because vfio-platform can be built

[RFC PATCH v4 00/10] VFIO support for platform devices

2014-02-08 Thread Antonios Motakis
v4 of this series is functionally identical to v3 for VFIO_PLATFORM. The only change is the inclusion of Kim Phillips' patch to expose driver_probe_device() and the implementation of a binding mechanism for arbitrary devices via a file in sysfs. The latter has been folded in the skeleton patch (04/

[RFC PATCH v4 03/10] VFIO_IOMMU_TYPE1: workaround to build for platform devices

2014-02-08 Thread Antonios Motakis
This is a workaround to make the VFIO_IOMMU_TYPE1 driver usable with platform devices instead of PCI. A future permanent fix should support both. This is required in order to use the Exynos SMMU, or ARM SMMU driver with VFIO. Signed-off-by: Antonios Motakis --- drivers/vfio/Kconfig|