Re: [RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2015-08-27 Thread Antonios Motakis
-up? Thank you in advance Best Regards Eric On 12/19/2014 10:20 PM, Antonios Motakis wrote: This RFC's intention is to show what an interface to access device properties for the VFIO platform driver can look like. These properties can be from the device tree node describing the device

Re: [PATCH v11 00/20] VFIO support for platform and ARM AMBA devices

2015-01-21 Thread Antonios Motakis
Hello Alex, On Mon, Jan 19, 2015 at 7:39 PM, Alex Williamson alex.william...@redhat.com wrote: On Tue, 2015-01-06 at 11:48 +0100, Antonios Motakis wrote: This patch series aims to implement VFIO support for platform devices that reside behind an IOMMU. Examples of such devices are devices

Re: [PATCH v11 00/20] VFIO support for platform and ARM AMBA devices

2015-01-09 Thread Antonios Motakis
, Antonios Motakis wrote: 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. The API used is based on the existing VFIO API that is also used with PCI devices

[PATCH v11 01/20] vfio/platform: initial skeleton of VFIO support for platform devices

2015-01-06 Thread Antonios Motakis
will reside. This will allow us to implement support for also discovering AMBA devices and their resources, but still reuse a large part of the VFIO_PLATFORM implementation. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 121

[PATCH v11 02/20] vfio: platform: probe to devices on the platform bus

2015-01-06 Thread Antonios Motakis
Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO PLATFORM code. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 103 ++ include/uapi/linux

[PATCH v11 00/20] VFIO support for platform and ARM AMBA devices

2015-01-06 Thread Antonios Motakis
- Interrupts support - Interrupt masking/unmasking - Automask level sensitive interrupts - Introduced VFIO_DMA_MAP_FLAG_EXEC - Code clean ups Antonios Motakis (20): vfio/platform: initial skeleton of VFIO support for platform devices vfio: platform: probe to devices on the platform bus vfio

[PATCH v11 08/20] vfio/platform: read and write support for the device fd

2015-01-06 Thread Antonios Motakis
. For this reason we also allow to use read and write functions to the file descriptor pointing to the memory regions. We implement this functionality only for MMIO regions of platform devices; PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis a.mota

[PATCH v11 07/20] vfio/platform: return info for device memory mapped IO regions

2015-01-06 Thread Antonios Motakis
This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 106

[PATCH v11 06/20] vfio/platform: return info for bound device

2015-01-06 Thread Antonios Motakis
-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index

[PATCH v11 05/20] vfio: amba: add the VFIO for AMBA devices module to Kconfig

2015-01-06 Thread Antonios Motakis
Enable building the VFIO AMBA driver. VFIO_AMBA depends on VFIO_PLATFORM, since it is sharing a portion of the code, and it is essentially implemented as a platform device whose resources are discovered via AMBA specific APIs in the kernel. Signed-off-by: Antonios Motakis a.mota

[PATCH v11 04/20] vfio: amba: VFIO support for AMBA devices

2015-01-06 Thread Antonios Motakis
Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_amba.c | 115 ++ include/uapi/linux/vfio.h | 1

[PATCH v11 09/20] vfio/platform: support MMAP of MMIO regions

2015-01-06 Thread Antonios Motakis
Allow to memory map the MMIO regions of the device so userspace can directly access them. PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 65 1 file

[PATCH v11 10/20] vfio/platform: return IRQ info

2015-01-06 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 +- drivers

[PATCH v11 03/20] vfio: platform: add the VFIO PLATFORM module to Kconfig

2015-01-06 Thread Antonios Motakis
Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers

[PATCH v11 12/20] vfio/platform: trigger an interrupt via eventfd

2015-01-06 Thread Antonios Motakis
and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 102 +- drivers/vfio/platform/vfio_platform_private.h | 2 + 2 files changed, 102 insertions(+), 2

[PATCH v11 13/20] vfio/platform: support for level sensitive interrupts

2015-01-06 Thread Antonios Motakis
Level sensitive interrupts are exposed as maskable and automasked interrupts and are masked and disabled automatically when they fire. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 99 ++- drivers/vfio

[PATCH v11 18/20] vfio: move eventfd support code for VFIO_PCI to a separate file

2015-01-06 Thread Antonios Motakis
The virqfd functionality that is used by VFIO_PCI to implement interrupt masking and unmasking via an eventfd, is generic enough and can be reused by another driver. Move it to a separate file in order to allow the code to be shared. Signed-off-by: Antonios Motakis a.mota

[PATCH v11 11/20] vfio/platform: initial interrupts support code

2015-01-06 Thread Antonios Motakis
This patch is a skeleton for the VFIO_DEVICE_SET_IRQS IOCTL, around which most IRQ functionality is implemented in VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 52 +-- drivers/vfio/platform

[PATCH v11 16/20] vfio: add local lock for virqfd instead of depending on VFIO PCI

2015-01-06 Thread Antonios Motakis
The Virqfd code needs to keep accesses to any struct *virqfd safe, but this comes into play only when creating or destroying eventfds, so sharing the same spinlock with the VFIO bus driver is not necessary. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci

[PATCH v11 15/20] vfio: virqfd: rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit

2015-01-06 Thread Antonios Motakis
The functions vfio_pci_virqfd_init and vfio_pci_virqfd_exit are not really PCI specific, since we plan to reuse the virqfd code with more VFIO drivers in addition to VFIO_PCI. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci/vfio_pci.c | 6

[PATCH v11 20/20] vfio/platform: implement IRQ masking/unmasking via an eventfd

2015-01-06 Thread Antonios Motakis
With this patch the VFIO user will be able to set an eventfd that can be used in order to mask and unmask IRQs of platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio

[PATCH v11 19/20] vfio: initialize the virqfd workqueue in VFIO generic code

2015-01-06 Thread Antonios Motakis
Now we have finally completely decoupled virqfd from VFIO_PCI. We can initialize it from the VFIO generic code, in order to safely use it from multiple independent VFIO bus drivers. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Makefile | 4 +++- drivers

[RFC PATCH v3 0/3] vfio: platform: return device properties for a platform device

2014-12-19 Thread Antonios Motakis
of available properties and device tree full_name Changes since v1: - Updated for VFIO platform patch series v8: VFIO AMBA devices now supported in addition to VFIO PLATFORM devices - Refactored and cleaned up the code Antonios Motakis (3): vfio: platform: add device properties skeleton and user API

[RFC PATCH v3 1/3] vfio: platform: add device properties skeleton and user API

2014-12-19 Thread Antonios Motakis
VFIO_DEVICE_GET_DEV_PROPERTY. The user needs to know the name and the data type of the property he is accessing. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/Makefile| 3 +- drivers/vfio/platform/properties.c| 61

[RFC PATCH v3 2/3] vfio: platform: access device property as a list of strings

2014-12-19 Thread Antonios Motakis
Certain device properties (e.g. the device node name, the compatible string), are available as a list of strings (separated by the null terminating character). Let the VFIO user query this type of properties. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio

Re: [PATCH v10 00/20] VFIO support for platform and ARM AMBA devices

2014-12-10 Thread Antonios Motakis
-09 at 15:24 +0100, Antonios Motakis wrote: On Sun, Dec 7, 2014 at 8:12 PM, Alex Williamson alex.william...@redhat.com wrote: On Thu, 2014-11-27 at 18:32 +0100, Antonios Motakis wrote: This patch series aims to implement VFIO support for platform devices that reside behind an IOMMU

Re: [REPORT PATCH] driver core: amba: add device binding path 'driver_override'

2014-12-10 Thread Antonios Motakis
Dear Russel, Do you think this patch can be included eventually? If not, what would we still need to change, or is there another approach you would accept? Thanks and best regards, Antonios On Thu, Nov 27, 2014 at 6:25 PM, Antonios Motakis a.mota...@virtualopensystems.com wrote: As already

[PATCH v10 04/20] vfio: amba: VFIO support for AMBA devices

2014-12-09 Thread Antonios Motakis
Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_amba.c | 115 ++ include/uapi/linux/vfio.h | 1

Re: [PATCH v10 00/20] VFIO support for platform and ARM AMBA devices

2014-12-09 Thread Antonios Motakis
On Sun, Dec 7, 2014 at 8:12 PM, Alex Williamson alex.william...@redhat.com wrote: On Thu, 2014-11-27 at 18:32 +0100, Antonios Motakis wrote: 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

Re: [PATCH v10 00/20] VFIO support for platform and ARM AMBA devices

2014-12-01 Thread Antonios Motakis
the rest of the patches on that, until eventually they are pulled in mainline. There are also some other dependencies in there as well for the new type1 for ARM patch series. Best regards Antonios Best Regards Eric On 11/27/2014 06:32 PM, Antonios Motakis wrote: This patch series aims

[PATCH v3 1/6] vfio: implement iommu driver capabilities with an enum

2014-11-27 Thread Antonios Motakis
Currently a VFIO driver's IOMMU capabilities are encoded as a series of numerical defines. Replace this with an enum for future maintainability. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- include/uapi/linux/vfio.h | 24 +++- 1 file changed, 11

[PATCH v3 6/6] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag

2014-11-27 Thread Antonios Motakis
flag has been set. The flag can be used only if all IOMMU domains behind the container support the IOMMU_NOEXEC flag. Also, if any mappings are created with the flag, any new domains with devices will have to support it as well. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com

[PATCH v3 4/6] vfio: type1: replace domain wide protection flags with supported capabilities

2014-11-27 Thread Antonios Motakis
, and applying the IOMMU_CACHE protection flag when doing the actual DMA mappings. This will allow us to reuse the behavior for IOMMU_CAP_NOEXEC, which we also want to keep track of, but without applying it to all domains that support it unless the user explicitly requests it. Signed-off-by: Antonios

[PATCH v3 2/6] vfio: type1: support for ARM SMMUs

2014-11-27 Thread Antonios Motakis
This allows to make use of the VFIO_IOMMU_TYPE1 driver with devices behind an IOMMU on ARM platforms. The driver can then be used with an Exynos SMMU, or ARM SMMU driver. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 2 +- 1 file changed, 1 insertion

[PATCH v3 5/6] vfio: type1: replace vfio_domains_have_iommu_cache with generic function

2014-11-27 Thread Antonios Motakis
Replace the function vfio_domains_have_iommu_cache() with a more generic function vfio_domains_have_iommu_cap() which allows to check all domains of an vfio_iommu structure for a given cached capability. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio

[PATCH v10 02/20] vfio: platform: probe to devices on the platform bus

2014-11-27 Thread Antonios Motakis
Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO PLATFORM code. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 103 ++ include/uapi/linux

[PATCH v10 04/20] vfio: amba: VFIO support for AMBA devices

2014-11-27 Thread Antonios Motakis
Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_amba.c | 110 ++ include/uapi/linux/vfio.h | 1

[PATCH v10 03/20] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-11-27 Thread Antonios Motakis
Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers

[PATCH v10 05/20] vfio: amba: add the VFIO for AMBA devices module to Kconfig

2014-11-27 Thread Antonios Motakis
Enable building the VFIO AMBA driver. VFIO_AMBA depends on VFIO_PLATFORM, since it is sharing a portion of the code, and it is essentially implemented as a platform device whose resources are discovered via AMBA specific APIs in the kernel. Signed-off-by: Antonios Motakis a.mota

[PATCH v10 01/20] vfio/platform: initial skeleton of VFIO support for platform devices

2014-11-27 Thread Antonios Motakis
will reside. This will allow us to implement support for also discovering AMBA devices and their resources, but still reuse a large part of the VFIO_PLATFORM implementation. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 121

[PATCH v10 07/20] vfio/platform: return info for device memory mapped IO regions

2014-11-27 Thread Antonios Motakis
This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 106

[PATCH v10 08/20] vfio/platform: read and write support for the device fd

2014-11-27 Thread Antonios Motakis
. For this reason we also allow to use read and write functions to the file descriptor pointing to the memory regions. We implement this functionality only for MMIO regions of platform devices; PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis a.mota

[PATCH v10 11/20] vfio/platform: initial interrupts support code

2014-11-27 Thread Antonios Motakis
This patch is a skeleton for the VFIO_DEVICE_SET_IRQS IOCTL, around which most IRQ functionality is implemented in VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 52 +-- drivers/vfio/platform

[PATCH v10 09/20] vfio/platform: support MMAP of MMIO regions

2014-11-27 Thread Antonios Motakis
Allow to memory map the MMIO regions of the device so userspace can directly access them. PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 65 1 file

[PATCH v10 13/20] vfio/platform: support for level sensitive interrupts

2014-11-27 Thread Antonios Motakis
Level sensitive interrupts are exposed as maskable and automasked interrupts and are masked and disabled automatically when they fire. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 99 ++- drivers/vfio

[PATCH v10 14/20] vfio: add a vfio_ prefix to virqfd_enable and virqfd_disable and export

2014-11-27 Thread Antonios Motakis
We want to reuse virqfd functionality in multiple VFIO drivers; before moving these functions to core VFIO, add the vfio_ prefix to the virqfd_enable and virqfd_disable functions, and export them so they can be used from other modules. Signed-off-by: Antonios Motakis a.mota

[PATCH v10 17/20] vfio: pass an opaque pointer on virqfd initialization

2014-11-27 Thread Antonios Motakis
VFIO_PCI passes the VFIO device structure *vdev via eventfd to the handler that implements masking/unmasking of IRQs via an eventfd. We can replace it in the virqfd infrastructure with an opaque type so we can make use of the mechanism from other VFIO bus drivers. Signed-off-by: Antonios Motakis

[PATCH v10 16/20] vfio: add local lock for virqfd instead of depending on VFIO PCI

2014-11-27 Thread Antonios Motakis
The Virqfd code needs to keep accesses to any struct *virqfd safe, but this comes into play only when creating or destroying eventfds, so sharing the same spinlock with the VFIO bus driver is not necessary. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci

[PATCH v10 15/20] vfio: virqfd: rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit

2014-11-27 Thread Antonios Motakis
The functions vfio_pci_virqfd_init and vfio_pci_virqfd_exit are not really PCI specific, since we plan to reuse the virqfd code with more VFIO drivers in addition to VFIO_PCI. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci/vfio_pci.c | 6

[PATCH v10 12/20] vfio/platform: trigger an interrupt via eventfd

2014-11-27 Thread Antonios Motakis
and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 93 ++- drivers/vfio/platform/vfio_platform_private.h | 2 + 2 files changed, 93 insertions(+), 2

[PATCH v10 19/20] vfio: initialize the virqfd workqueue in VFIO generic code

2014-11-27 Thread Antonios Motakis
Now we have finally completely decoupled virqfd from VFIO_PCI. We can initialize it from the VFIO generic code, in order to safely use it from multiple independent VFIO bus drivers. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Makefile | 4 +++- drivers

[PATCH v10 20/20] vfio/platform: implement IRQ masking/unmasking via an eventfd

2014-11-27 Thread Antonios Motakis
With this patch the VFIO user will be able to set an eventfd that can be used in order to mask and unmask IRQs of platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio

[PATCH v10 18/20] vfio: move eventfd support code for VFIO_PCI to a separate file

2014-11-27 Thread Antonios Motakis
The virqfd functionality that is used by VFIO_PCI to implement interrupt masking and unmasking via an eventfd, is generic enough and can be reused by another driver. Move it to a separate file in order to allow the code to be shared. Signed-off-by: Antonios Motakis a.mota

Re: [PATCH v9 01/19] vfio/platform: initial skeleton of VFIO support for platform devices

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 5:49 PM, Alex Williamson alex.william...@redhat.com wrote: On Wed, 2014-11-12 at 11:05 +0100, Eric Auger wrote: Hi Antonios, On 10/27/2014 07:07 PM, Antonios Motakis wrote: This patch forms the common skeleton code for platform devices support with VFIO

Re: [PATCH v9 03/19] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-11-20 Thread Antonios Motakis
On Thu, Nov 13, 2014 at 9:05 AM, Hongbo Zhang hongbo.zh...@linaro.org wrote: On 12 November 2014 17:57, Antonios Motakis a.mota...@virtualopensystems.com wrote: Hello Hongbo, On Wed, Nov 12, 2014 at 10:52 AM, Hongbo Zhang hongbo.zh...@linaro.org wrote: On 28 October 2014 02:07, Antonios

Re: [PATCH v9 07/19] vfio/platform: return info for device memory mapped IO regions

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 11:58 AM, Eric Auger eric.au...@linaro.org wrote: On 10/27/2014 07:07 PM, Antonios Motakis wrote: This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off

Re: [PATCH v9 06/19] vfio/platform: return info for bound device

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 5:36 PM, Alex Williamson alex.william...@redhat.com wrote: On Wed, 2014-11-12 at 11:32 +0100, Eric Auger wrote: On 10/27/2014 07:07 PM, Antonios Motakis wrote: A VFIO userspace driver will start by opening the VFIO device that corresponds to an IOMMU group

Re: [PATCH v9 08/19] vfio/platform: read and write support for the device fd

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 4:46 PM, Eric Auger eric.au...@linaro.org wrote: On 10/27/2014 07:07 PM, Antonios Motakis wrote: VFIO returns a file descriptor which we can use to manipulate the memory regions of the device. Usually, the user will mmap memory regions that are addressable on page

Re: [PATCH v9 12/19] vfio/platform: trigger an interrupt via eventfd

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 3:22 PM, Eric Auger eric.au...@linaro.org wrote: On 10/31/2014 08:36 PM, Alex Williamson wrote: On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: This patch allows to set an eventfd for a patform device's interrupt, platform device (typo) Ack. and also

Re: [PATCH v9 03/19] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-11-12 Thread Antonios Motakis
Hello Hongbo, On Wed, Nov 12, 2014 at 10:52 AM, Hongbo Zhang hongbo.zh...@linaro.org wrote: On 28 October 2014 02:07, Antonios Motakis a.mota...@virtualopensystems.com wrote: Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off

Re: [PATCH v2 1/6] vfio: implement iommu driver capabilities with an enum

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 9:04 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:05 +0100, Antonios Motakis wrote: Currently a VFIO driver's IOMMU capabilities are encoded as a series of numerical defines. Replace this with an enum for future maintainability

Re: [PATCH v9 04/19] vfio: amba: VFIO support for AMBA devices

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 7:40 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis a.mota

Re: [PATCH v9 07/19] vfio/platform: return info for device memory mapped IO regions

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 7:58 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device

Re: [PATCH v9 15/19] vfio: add local lock in virqfd instead of depending on VFIO PCI

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:43 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:08 +0100, Antonios Motakis wrote: Virqfd just needs to keep accesses to any struct *virqfd safe, but this comes into play only when creating or destroying eventfds, so sharing the same

Re: [PATCH v9 10/19] vfio/platform: return IRQ info

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:11 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:07 +0100, 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

Re: [PATCH v9 12/19] vfio/platform: trigger an interrupt via eventfd

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:36 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: This patch allows to set an eventfd for a patform device's interrupt, and also to trigger the interrupt eventfd from userspace for testing. Level

Re: [PATCH v9 13/19] vfio/platform: support for level sensitive interrupts

2014-11-05 Thread Antonios Motakis
On Fri, Oct 31, 2014 at 8:36 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-27 at 19:07 +0100, Antonios Motakis wrote: Level sensitive interrupts are exposed as maskable and automasked interrupts and are masked and disabled automatically when they fire. Signed-off

Re: [RFC PATCH v2 0/4] vfio: platform: return device tree info for a platform device node

2014-10-31 Thread Antonios Motakis
On Wed, Oct 22, 2014 at 11:56 PM, Alex Williamson alex.william...@redhat.com wrote: On Thu, 2014-10-16 at 17:54 +0200, Antonios Motakis wrote: This RFC's intention is to show what an interface to access device node properties for the VFIO platform driver can look like. If a device tree node

Re: [PATCH v9 17/19] vfio: virqfd: add vfio_ prefix to virqfd_enable and virqfd_disable

2014-10-31 Thread Antonios Motakis
On Mon, Oct 27, 2014 at 9:12 PM, Bjorn Helgaas bhelg...@google.com wrote: On Mon, Oct 27, 2014 at 12:08 PM, Antonios Motakis a.mota...@virtualopensystems.com wrote: The virqfd_enable and virqfd_disable functions are now global. Add the vfio_ prefix to those functions. Wouldn't it be better

[PATCH v2 0/6] vfio: type1: support for ARM SMMUS with VFIO_IOMMU_TYPE1

2014-10-27 Thread Antonios Motakis
behind the SMMU. Changes from v1: - Bugfixes and corrected some typos - Use enum for VFIO IOMMU driver capabilities Antonios Motakis (6): vfio: implement iommu driver capabilities with an enum vfio: type1: support for platform bus devices on ARM vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC

[PATCH v2 3/6] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag

2014-10-27 Thread Antonios Motakis
of the container used. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- include/uapi/linux/vfio.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 1e39842..06d66c9 100644 --- a/include/uapi/linux/vfio.h +++ b

[PATCH v2 6/6] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag

2014-10-27 Thread Antonios Motakis
flag has been set. The flag can be used only if all IOMMU domains behind the container support the IOMMU_NOEXEC flag. Also, if any mappings are created with the flag, any new domains with devices will have to support it as well. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com

[PATCH v2 2/6] vfio: type1: support for platform bus devices on ARM

2014-10-27 Thread Antonios Motakis
This allows to make use of the VFIO_IOMMU_TYPE1 driver with platform devices on ARM. The driver can then be used with an Exynos SMMU, or ARM SMMU driver. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 1/6] vfio: implement iommu driver capabilities with an enum

2014-10-27 Thread Antonios Motakis
Currently a VFIO driver's IOMMU capabilities are encoded as a series of numerical defines. Replace this with an enum for future maintainability. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- include/uapi/linux/vfio.h | 21 ++--- 1 file changed, 10

[PATCH v2 5/6] vfio: type1: replace vfio_domains_have_iommu_cache with generic function

2014-10-27 Thread Antonios Motakis
Replace the function vfio_domains_have_iommu_cache() with a more generic function vfio_domains_have_iommu_cap() which allows to check all domains of an vfio_iommu structure for a given cached capability. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio

[PATCH v2 4/6] vfio: type1: replace domain wide protection flags with supported capabilities

2014-10-27 Thread Antonios Motakis
, and applying the IOMMU_CACHE protection flag when doing the actual DMA mappings. This will allow us to reuse the behavior for IOMMU_CAP_NOEXEC, which we also want to keep track of, but without applying it to all domains that support it unless the user explicitly requests it. Signed-off-by: Antonios

[PATCH v9 00/19] VFIO support for platform and AMBA devices on ARM

2014-10-27 Thread Antonios Motakis
- Interrupt masking/unmasking - Automask level sensitive interrupts - Introduced VFIO_DMA_MAP_FLAG_EXEC - Code clean ups Antonios Motakis (19): vfio/platform: initial skeleton of VFIO support for platform devices vfio: platform: probe to devices on the platform bus vfio: platform: add the VFIO

[PATCH v9 01/19] vfio/platform: initial skeleton of VFIO support for platform devices

2014-10-27 Thread Antonios Motakis
will reside. This will allow us to implement support for also discovering AMBA devices and their resources, but still reuse a large part of the VFIO_PLATFORM implementation. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 126

[PATCH v9 03/19] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-10-27 Thread Antonios Motakis
Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers

[PATCH v9 04/19] vfio: amba: VFIO support for AMBA devices

2014-10-27 Thread Antonios Motakis
Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_amba.c | 116 ++ include/uapi/linux/vfio.h | 1

[PATCH v9 06/19] vfio/platform: return info for bound device

2014-10-27 Thread Antonios Motakis
-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c index

[PATCH v9 05/19] vfio: amba: add the VFIO for AMBA devices module to Kconfig

2014-10-27 Thread Antonios Motakis
Enable building the VFIO AMBA driver. VFIO_AMBA depends on VFIO_PLATFORM, since it is sharing a portion of the code, and it is essentially implemented as a platform device whose resources are discovered via AMBA specific APIs in the kernel. Signed-off-by: Antonios Motakis a.mota

[PATCH v9 08/19] vfio/platform: read and write support for the device fd

2014-10-27 Thread Antonios Motakis
. For this reason we also need allow to read and write to the memory regions via the file descriptor. Implement this funcionality only for MMIO regions of platform devices; PIO regions are not being handled at this point. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers

[PATCH v9 07/19] vfio/platform: return info for device memory mapped IO regions

2014-10-27 Thread Antonios Motakis
This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 110

[PATCH v9 10/19] vfio/platform: return IRQ info

2014-10-27 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 +- drivers

[PATCH v9 12/19] vfio/platform: trigger an interrupt via eventfd

2014-10-27 Thread Antonios Motakis
and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 93 ++- drivers/vfio/platform/vfio_platform_private.h | 2 + 2 files changed, 93 insertions(+), 2

[PATCH v9 11/19] vfio/platform: initial interrupts support code

2014-10-27 Thread Antonios Motakis
This patch is a skeleton for the VFIO_DEVICE_SET_IRQS IOCTL, around which most IRQ functionality is implemented in VFIO. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_common.c | 52 +++-- drivers/vfio/platform

[PATCH v9 19/19] vfio/platform: implement IRQ masking/unmasking via an eventfd

2014-10-27 Thread Antonios Motakis
With this patch the VFIO user will be able to set an eventfd that can be used in order to mask and unmask IRQs of platform devices. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio

[PATCH v9 14/19] vfio: move eventfd support code for VFIO_PCI to a separate file

2014-10-27 Thread Antonios Motakis
in the process. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/Makefile | 4 +- drivers/vfio/pci/vfio_pci_intrs.c | 213 --- drivers/vfio/pci/vfio_pci_private.h | 3 - drivers/vfio/virqfd.c | 214

[PATCH v9 17/19] vfio: virqfd: add vfio_ prefix to virqfd_enable and virqfd_disable

2014-10-27 Thread Antonios Motakis
The virqfd_enable and virqfd_disable functions are now global. Add the vfio_ prefix to those functions. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci/vfio_pci_intrs.c | 18 +- drivers/vfio/virqfd.c | 14 +++--- include

[PATCH v9 13/19] vfio/platform: support for level sensitive interrupts

2014-10-27 Thread Antonios Motakis
Level sensitive interrupts are exposed as maskable and automasked interrupts and are masked and disabled automatically when they fire. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform_irq.c | 102 +- drivers/vfio

[PATCH v9 02/19] vfio: platform: probe to devices on the platform bus

2014-10-27 Thread Antonios Motakis
Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO PLATFORM code. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/platform/vfio_platform.c | 114 ++ include/uapi/linux

[PATCH v9 15/19] vfio: add local lock in virqfd instead of depending on VFIO PCI

2014-10-27 Thread Antonios Motakis
Virqfd just needs to keep accesses to any struct *virqfd safe, but this comes into play only when creating or destroying eventfds, so sharing the same spinlock with the VFIO bus driver is not necessary. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci

[PATCH v9 18/19] vfio: initialize the virqfd workqueue in VFIO generic code

2014-10-27 Thread Antonios Motakis
Now we have finally completely decoupled virqfd from VFIO_PCI. We can initialize it from the VFIO generic code, in order to safely use it from multiple independent VFIO bus drivers. Signed-off-by: Antonios Motakis a.mota...@virtualopensystems.com --- drivers/vfio/pci/vfio_pci.c | 8

Re: [PATCH v8 02/18] vfio: platform: probe to devices on the platform bus

2014-10-22 Thread Antonios Motakis
On Tue, Oct 21, 2014 at 6:37 PM, Eric Auger eric.au...@linaro.org wrote: On 10/21/2014 06:17 PM, Alex Williamson wrote: On Mon, 2014-10-13 at 15:10 +0200, Antonios Motakis wrote: Driver to bind to Linux platform devices, and callbacks to discover their resources to be used by the main VFIO

Re: [PATCH v8 07/18] vfio/platform: return info for device memory mapped IO regions

2014-10-22 Thread Antonios Motakis
On Tue, Oct 21, 2014 at 6:34 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-13 at 15:10 +0200, Antonios Motakis wrote: This patch enables the IOCTLs VFIO_DEVICE_GET_REGION_INFO ioctl call, which allows the user to learn about the available MMIO resources of a device

Re: [PATCH v8 09/18] vfio/platform: support MMAP of MMIO regions

2014-10-22 Thread Antonios Motakis
On Tue, Oct 21, 2014 at 6:51 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-13 at 15:10 +0200, Antonios Motakis wrote: Allow to memory map the MMIO regions of the device so userspace can directly access them. PIO regions are not being handled at this point. Signed-off

Re: [PATCH v8 13/18] vfio/platform: support for maskable and automasked interrupts

2014-10-22 Thread Antonios Motakis
On Tue, Oct 21, 2014 at 7:47 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-13 at 15:10 +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

Re: [PATCH v8 14/18] vfio: move eventfd support code for VFIO_PCI to a separate file

2014-10-22 Thread Antonios Motakis
On Tue, Oct 21, 2014 at 7:55 PM, Alex Williamson alex.william...@redhat.com wrote: On Mon, 2014-10-13 at 15:10 +0200, Antonios Motakis wrote: The virqfd functionality that is used by VFIO_PCI to implement interrupt masking and unmasking via an eventfd, is generic enough and can be reused

Re: [PATCH 3/5] vfio: type1: replace domain wide protection flags with supported capabilities

2014-10-22 Thread Antonios Motakis
On Wed, Oct 22, 2014 at 11:08 AM, Eric Auger eric.au...@linaro.org wrote: On 10/13/2014 03:09 PM, Antonios Motakis wrote: VFIO_IOMMU_TYPE1 keeps track for each domain it knows a list of protection flags it always applies to all mappings in the domain. This is used for domains that support

  1   2   3   >