Re: [PATCH] vfio: platform: mark symbols static where possible

2016-09-01 Thread Baptiste Reynal
; > #endif > > } > > > > -bool vfio_platform_acpi_has_reset(struct vfio_platform_device *vdev) > > +static bool vfio_platform_acpi_has_reset(struct vfio_platform_device *vdev) > > { > > #ifdef CONFIG_ACPI > > struct device *dev = vdev->device; > > @@ -637,7 +637,7 @@ static const struct vfio_device_ops vfio_platform_ops = > > { > > .mmap = vfio_platform_mmap, > > }; > > > > -int vfio_platform_of_probe(struct vfio_platform_device *vdev, > > +static int vfio_platform_of_probe(struct vfio_platform_device *vdev, > > struct device *dev) > > { > > int ret; > > > > Reviewed-by: Eric Auger > > > Thanks! > > Eric Reviewed-by: Baptiste Reynal Thanks, Baptiste

Re: [PATCH] vfio: platform: use vfio_iommu_group_get/put

2016-05-20 Thread Baptiste Reynal
that support. Since safety issues have already been addressed for the PCI patch series, I don't see any reason not to enable it. You might extend the commit message to remind those issues. Best regards, Baptiste > > Best Regards > > Eric > > > > Alex > > > >

[RFC PATCH v5 3/3] vfio: platform: return device properties as arrays of unsigned integers

2015-09-30 Thread Baptiste Reynal
From: Antonios Motakis Certain properties of a device are accessible as an array of unsigned integers, either u64, u32, u16, or u8. Let the VFIO user query this type of device properties. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- v4 -> v5: - fix return error w

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

2015-09-30 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal

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

2015-09-30 Thread Baptiste Reynal
via the introduced ioctl 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 Signed-off-by: Baptiste Reynal --- v4 -> v5: - add a limit size to namesz (128) - remove flags propagation - replace E2

[RFC PATCH v4 3/3] vfio: platform: return device properties as arrays of unsigned integers

2015-09-09 Thread Baptiste Reynal
From: Antonios Motakis Certain properties of a device are accessible as an array of unsigned integers, either u64, u32, u16, or u8. Let the VFIO user query this type of device properties. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/properties.c

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

2015-09-09 Thread Baptiste Reynal
via the introduced ioctl 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 Signed-off-by: Baptiste Reynal --- v3 -> v4: - added flags placeholder in vfio_dev_properties - ioctl returns -E2BIG if

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

2015-09-09 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal

Re: [PATCH] vfio: Drop owner assignment from platform_driver

2015-07-10 Thread Baptiste Reynal
Thanks for the point Krzysztof. Acked-by: Baptiste Reynal On Fri, Jul 10, 2015 at 8:37 AM, Krzysztof Kozlowski wrote: > platform_driver does not need to set an owner because > platform_driver_register() will set it. > > Signed-off-by: Krzysztof Kozlowski > > --- > &g

Re: [PATCH] iommu/arm-smmu: Fix bug in ARM_SMMU_FEAT_TRANS_OPS condition check

2015-06-23 Thread Baptiste Reynal
This issue has already been fixed here : http://www.spinics.net/lists/arm-kernel/msg424824.html Regards, Baptiste On Tue, Jun 23, 2015 at 2:07 PM, Sricharan R wrote: > Patch 'fix ARM_SMMU_FEAT_TRANS_OPS condition' changed the check > for ARM_SMMU_FEAT_TRANS_OPS to be based on presence of stage1

Re: [PATCH] VFIO: platform: enable ARM64 build

2015-06-22 Thread Baptiste Reynal
ks, > > Alex > Indeed, I'd rather wait for someone to show up with some use cases and tests before removing this condition. Regards, Baptiste >> On 06/22/2015 05:49 PM, Baptiste Reynal wrote: >> > Acked-by: Baptiste Reynal >> > Tested-by: Baptiste Reynal >

Re: [PATCH] MAINTAINERS: Add vfio-platform sub-maintainer

2015-06-22 Thread Baptiste Reynal
Acked-by: Baptiste Reynal On Thu, Jun 18, 2015 at 8:06 PM, Alex Williamson wrote: > Add Baptiste Reynal as the VFIO platform driver sub-maintainer. > > Signed-off-by: Alex Williamson > Cc: Baptiste Reynal > --- > MAINTAINERS |6 ++ > 1 file changed, 6 insertion

Re: [PATCH] VFIO: platform: enable ARM64 build

2015-06-22 Thread Baptiste Reynal
Acked-by: Baptiste Reynal Tested-by: Baptiste Reynal Out of curiosity, have you get VFIO running on ARM64 without any problems ? On Mon, Jun 15, 2015 at 11:13 AM, Eric Auger wrote: > This patch enables building VFIO platform and derivatives on ARM64. > > Signed-off-by: E

Re: [PATCH v4 0/4] VFIO platform reset

2015-06-19 Thread Baptiste Reynal
[1-4/4] Acked-by: Baptiste Reynal Tested-by: Baptiste Reynal Reviewed-by: Baptiste Reynal On Thu, Jun 18, 2015 at 6:17 PM, Alex Williamson wrote: > On Thu, 2015-06-18 at 17:23 +0200, Baptiste Reynal wrote: >> Hello everyone, >> >> I tested and reviewed the patches, eve

Re: [PATCH v4 0/4] VFIO platform reset

2015-06-18 Thread Baptiste Reynal
also add something like this to MAINTAINERS > before we go much further? > > diff --git a/MAINTAINERS b/MAINTAINERS > index d8afd29..c6bf7f6 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -10545,6 +10545,12 @@ F: drivers/vfio/ > F: include/linux/vfio.h > F:

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

2015-03-18 Thread Baptiste Reynal
-03-02 at 17:59 +0100, Baptiste Reynal wrote: >> > From: 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 independe

[PATCH v5 2/4] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag

2015-03-04 Thread Baptiste Reynal
available for all the IOMMUs of the container used. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- 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 5fb3d46..30801a7 100644 --- a/include

[PATCH v5 4/4] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag

2015-03-04 Thread Baptiste Reynal
: Baptiste Reynal --- drivers/vfio/vfio_iommu_type1.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index a5847e8..ec313e5 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio

[PATCH v5 1/4] vfio: implement iommu driver capabilities with an enum

2015-03-04 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- include/uapi/linux/vfio.h

[PATCH v5 3/4] vfio: type1: replace vfio_domains_have_iommu_cache with generic function

2015-03-04 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal

[PATCH v2 1/1] iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition

2015-03-04 Thread Baptiste Reynal
ned-off-by: Baptiste Reynal --- v1 -> v2: Add domain stage test (Thanks to Will Deacon) --- drivers/iommu/arm-smmu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index fc13dd5..a3adde6 100644 --- a/drivers/iom

[PATCH v4 5/5] vfio: type1: implement the VFIO_DMA_MAP_FLAG_NOEXEC flag

2015-03-02 Thread Baptiste Reynal
: Baptiste Reynal --- drivers/vfio/vfio_iommu_type1.c | 25 - 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 0ea371b..2bbd311 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers

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

2015-03-02 Thread Baptiste Reynal
platform bus specific code 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 [Baptiste Reynal: added includes in vfio_platform_private.h] Signed

[PATCH v4 2/5] vfio: introduce the VFIO_DMA_MAP_FLAG_NOEXEC flag

2015-03-02 Thread Baptiste Reynal
available for all the IOMMUs of the container used. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- 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 5fb3d46..30801a7 100644 --- a/include

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 106

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

2015-03-02 Thread Baptiste Reynal
From: 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 [Baptiste Reynal: Move masked interrupt initialization from "vfio/platform: trigger an interrup

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

2015-03-02 Thread Baptiste Reynal
ed as maskable and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis [Baptiste Reynal: fix masked interrupt initialization] Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_irq.c | 94 ++- drivers

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

2015-03-02 Thread Baptiste Reynal
Signed-off-by: Baptiste Reynal --- drivers/vfio/pci/vfio_pci_intrs.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index f88bfdf..4d38c93 100644 --- a/drivers/vfio/pci

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

2015-03-02 Thread Baptiste Reynal
Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/Kconfig | 10 ++ drivers/vfio/platform/Makefile | 4 2 files changed, 14 insertions(+) diff --git a/drivers/vfio/platform/Kconfig b/drivers/vfio/platform/Kconfig index c51af17..c0a3bff 100644 --- a/drivers/vfio/platform

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

2015-03-02 Thread Baptiste Reynal
-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- drivers/vfio/pci/vfio_pci_intrs.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index 7d3c135..1a16da3 100644

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_irq.c | 47

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

2015-03-02 Thread Baptiste Reynal
Signed-off-by: Baptiste Reynal --- drivers/vfio/pci/Makefile | 3 +- drivers/vfio/pci/vfio_pci_intrs.c | 215 drivers/vfio/pci/vfio_pci_private.h | 3 - drivers/vfio/virqfd.c | 213 +++ include/linux

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal

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

2015-03-02 Thread Baptiste Reynal
Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 150 ++ drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files changed, 151 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 52

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

2015-03-02 Thread Baptiste Reynal
From: Antonios Motakis Add support for discovering AMBA devices with VFIO and handle them similarly to Linux platform devices. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_amba.c | 115 ++ include/uapi/linux

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 65

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/Makefile

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

2015-03-02 Thread Baptiste Reynal
VFIO_DEVICE_GET_INFO ioctl call. Signed-off-by: Antonios Motakis [Baptiste Reynal: added include in vfio_platform_common.c] Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/vfio

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

2015-03-02 Thread Baptiste Reynal
From: Antonios Motakis Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis Signed-off-by: Baptiste Reynal --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig

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

2015-03-02 Thread Baptiste Reynal
From: 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 [Baptiste Reynal: Move rename vfio_pci_virqfd_init and

[PATCH v4 4/5] vfio: type1: replace vfio_domains_have_iommu_cache with generic function

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal

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

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform.c | 103

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

2015-03-02 Thread Baptiste Reynal
. Signed-off-by: Antonios Motakis [Baptiste Reynal: Use bit shifting for domain->caps] Signed-off-by: Baptiste Reynal --- drivers/vfio/vfio_iommu_type1.c | 31 ++- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/v

[PATCH v4 1/5] vfio: implement iommu driver capabilities with an enum

2015-03-02 Thread Baptiste Reynal
From: 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 Signed-off-by: Baptiste Reynal --- include/uapi/linux/vfio.h

[PATCH 1/1] iommu/arm-smmu: fix ARM_SMMU_FEAT_TRANS_OPS condition

2015-03-02 Thread Baptiste Reynal
This patch is a fix to "iommu/arm-smmu: add support for iova_to_phys through ATS1PR". According to ARM documentation, translation registers are optional even in SMMUv1, so ID0_S1TS needs to be checked to verify their presence. Signed-off-by: Baptiste Reynal --- drivers/iommu/arm-

[PATCH v13 15/18] vfio: pass an opaque pointer on virqfd initialization

2015-01-30 Thread Baptiste Reynal
From: 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-o

[PATCH v13 18/18] vfio/platform: implement IRQ masking/unmasking via an eventfd

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio/platform/v

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

2015-01-30 Thread Baptiste Reynal
From: 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 --- d

[PATCH v13 14/18] vfio: add local lock for virqfd instead of depending on VFIO PCI

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/pci/vfio_pci_in

[PATCH v13 17/18] vfio: initialize the virqfd workqueue in VFIO generic code

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/Makefile | 4 +++- drivers/vfio/pc

[PATCH v13 12/18] vfio: add a vfio_ prefix to virqfd_enable and virqfd_disable and export

2015-01-30 Thread Baptiste Reynal
From: 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 ---

[PATCH v13 10/18] vfio/platform: trigger an interrupt via eventfd

2015-01-30 Thread Baptiste Reynal
ed as maskable and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis [Baptiste Reynal: fix masked interrupt initialization] Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_irq.c | 94 ++- drivers

[PATCH v13 13/18] vfio: virqfd: rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit

2015-01-30 Thread Baptiste Reynal
From: 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 [Baptiste Reynal: Move rename vfio_pci_virqfd_init and

[PATCH v13 11/18] vfio/platform: support for level sensitive interrupts

2015-01-30 Thread Baptiste Reynal
From: 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 [Baptiste Reynal: Move masked interrupt initialization from "vfio/platform: trigger an interrup

[PATCH v13 06/18] vfio/platform: read and write support for the device fd

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis 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 boundaries, however for memory regions where this is not the case we cannot provide mmap functionality due

[PATCH v13 07/18] vfio/platform: support MMAP of MMIO regions

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 65 1 file changed,

[PATCH v13 08/18] vfio/platform: return IRQ info

2015-01-30 Thread Baptiste Reynal
From: 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/plat

[PATCH v13 09/18] vfio/platform: initial interrupts support code

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 52 +-- drivers/vfio/platform/vfio_platform_ir

[PATCH v13 03/18] vfio: platform: add the VFIO PLATFORM module to Kconfig

2015-01-30 Thread Baptiste Reynal
From: Antonios Motakis Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers/vfio/platfo

[PATCH v13 05/18] vfio/platform: return info for device memory mapped IO regions

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 106 +- driver

[PATCH v13 04/18] vfio/platform: return info for bound device

2015-01-30 Thread Baptiste Reynal
VFIO_DEVICE_GET_INFO ioctl call. Signed-off-by: Antonios Motakis [Baptiste Reynal: added include in vfio_platform_common.c] Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_common.c | 24 +--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/vfio

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

2015-01-30 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform.c | 103 ++ include/uapi/linux/vfio.h

[PATCH v13 01/18] vfio/platform: initial skeleton of VFIO support for platform devices

2015-01-30 Thread Baptiste Reynal
platform bus specific code 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 [Baptiste Reynal: added includes in vfio_platform_private.h] Signed

[PATCH v12 05/18] vfio/platform: return info for device memory mapped IO regions

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 106 +- driver

[PATCH v12 07/18] vfio/platform: support MMAP of MMIO regions

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 65 1 file changed,

[PATCH v12 17/18] vfio: initialize the virqfd workqueue in VFIO generic code

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/Makefile | 4 +++- drivers/vfio/pc

[PATCH v12 14/18] vfio: add local lock for virqfd instead of depending on VFIO PCI

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/pci/vfio_pci_in

[PATCH v12 09/18] vfio/platform: initial interrupts support code

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_common.c | 52 +-- drivers/vfio/platform/vfio_platform_ir

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

2015-01-21 Thread Baptiste Reynal
From: 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 --- d

[PATCH v12 15/18] vfio: pass an opaque pointer on virqfd initialization

2015-01-21 Thread Baptiste Reynal
From: 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-o

[PATCH v12 18/18] vfio/platform: implement IRQ masking/unmasking via an eventfd

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_irq.c | 47 --- drivers/vfio/platform/v

[PATCH v12 12/18] vfio: add a vfio_ prefix to virqfd_enable and virqfd_disable and export

2015-01-21 Thread Baptiste Reynal
From: 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 ---

[PATCH v12 11/18] vfio/platform: support for level sensitive interrupts

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform_irq.c | 99 ++- drivers/vfio/platfor

[PATCH v12 13/18] vfio: virqfd: rename vfio_pci_virqfd_init and vfio_pci_virqfd_exit

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/pci/vfio_pci.c | 6 +++--- drivers/vfio/

[PATCH v12 06/18] vfio/platform: read and write support for the device fd

2015-01-21 Thread Baptiste Reynal
From: Antonios Motakis 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 boundaries, however for memory regions where this is not the case we cannot provide mmap functionality due

[PATCH v12 03/18] vfio: platform: add the VFIO PLATFORM module to Kconfig

2015-01-21 Thread Baptiste Reynal
From: Antonios Motakis Enable building the VFIO PLATFORM driver that allows to use Linux platform devices with VFIO. Signed-off-by: Antonios Motakis --- drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/platform/Kconfig | 9 + drivers/vfio/platfo

[PATCH v12 10/18] vfio/platform: trigger an interrupt via eventfd

2015-01-21 Thread Baptiste Reynal
ed as maskable and are implemented here using a simple and efficient IRQ handler. Signed-off-by: Antonios Motakis [Baptiste Reynal: fix masked interrupt initialization] Signed-off-by: Baptiste Reynal --- drivers/vfio/platform/vfio_platform_irq.c | 98 ++- drivers

[PATCH v12 08/18] vfio/platform: return IRQ info

2015-01-21 Thread Baptiste Reynal
From: 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/plat

[PATCH v12 04/18] vfio/platform: return info for bound device

2015-01-21 Thread Baptiste Reynal
From: 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 VFIO_DEVICE_GET_INF

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

2015-01-21 Thread Baptiste Reynal
From: 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 --- drivers/vfio/platform/vfio_platform.c | 103 ++ include/uapi/linux/vfio.h

[PATCH v12 01/18] vfio/platform: initial skeleton of VFIO support for platform devices

2015-01-21 Thread Baptiste Reynal
platform bus specific code 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 [Baptiste Reynal: added includes in vfio_platform_private.h] Signed