All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v4 00/10] VFIO support for platform devices
@ 2014-02-08 17:29 ` Antonios Motakis
  0 siblings, 0 replies; 90+ messages in thread
From: Antonios Motakis @ 2014-02-08 17:29 UTC (permalink / raw)
  To: alex.williamson, kvmarm, iommu, linux-kernel, gregkh
  Cc: tech, a.rigo, B08248, kim.phillips, jan.kiszka, kvm, R65777,
	B07421, christoffer.dall, agraf, B16395, will.deacon,
	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/10).

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. Only devices that include a basic set of IRQs and memory regions are
targeted; devices with complex relationships with other devices on a device tree
are not taken into account at this stage.

A copy with all the dependencies applied can be cloned from branch
vfio-platform-v4 at git@github.com:virtualopensystems/linux-kvm-arm.git

This code can also be tested on ARM FastModels using the following test cases:
 - A user space implementation via VFIO for the PL330 on the FastModels:
   git@github.com:virtualopensystems/pl330-vfio-test.git
 - A QEMU prototype, also based on the PL330:
   git@github.com:virtualopensystems/qemu.git pl330-vfio-dev

   We have written detailed instructions on how to build and run these tests:
   http://www.virtualopensystems.com/en/solutions/guides/vfio-on-arm/

The following IOCTLs have been found to be working on FastModels with an
ARM SMMU (MMU400). Testing was based on the ARM PL330 DMA Controller featured
on those models.
 - VFIO_GET_API_VERSION
 - VFIO_CHECK_EXTENSION

The TYPE1 fix proposed here enables the following IOCTLs:
 - VFIO_GROUP_GET_STATUS
 - VFIO_GROUP_SET_CONTAINER
 - VFIO_SET_IOMMU
 - VFIO_IOMMU_GET_INFO
 - VFIO_IOMMU_MAP_DMA
     For this ioctl specifically, a new flag has been added:
     VFIO_DMA_MAP_FLAG_EXEC. This flag is taken into account on systems with an
     ARM SMMU.

The VFIO platform driver proposed here implements the following:
 - VFIO_GROUP_GET_DEVICE_FD
 - VFIO_DEVICE_GET_INFO
 - VFIO_DEVICE_GET_REGION_INFO
 - VFIO_DEVICE_GET_IRQ_INFO
 - VFIO_DEVICE_SET_IRQS
     IRQs are implemented partially using this ioctl. Handling incoming
     interrupts with an eventfd is supported, as is masking and unmasking.
     Level sensitive interrupts are automasked. What is not implemented is
     masking/unmasking via eventfd.

In addition, the VFIO platform driver implements the following through
the VFIO device file descriptor:
 - MMAPing memory regions to the virtual address space of the VFIO user.
 - Read / write of memory regions directly through the file descriptor.

What still needs to be done, includes:
 - Eventfd for masking/unmasking
 - Extend the driver and API for device tree metadata
 - QEMU / KVM integration
 - Device specific functionality (e.g. VFIO_DEVICE_RESET)
 - Improve VFIO_IOMMU_TYPE1 driver to support multiple buses at the same time
 - Bind to ARM AMBA devices
 - IOMMUs with nested page tables (Stage 1 & 2 translation on ARM SMMUs)

Changes since v3:
 - Use Kim Phillips' driver_probe_device()
Changes since v2:
 - Fixed Read/Write and MMAP on device regions
 - Removed dependency on Device Tree
 - Interrupts support
 - Interrupt masking/unmasking
 - Automask level sensitive interrupts
 - Introduced VFIO_DMA_MAP_FLAG_EXEC
 - Code clean ups

Antonios Motakis (9):
  VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag
  VFIO_IOMMU_TYPE1: workaround to build for platform devices
  VFIO_PLATFORM: Initial skeleton of VFIO support for platform devices
  VFIO_PLATFORM: Return info for device and its memory mapped IO regions
  VFIO_PLATFORM: Read and write support for the device fd
  VFIO_PLATFORM: Support MMAP of MMIO regions
  VFIO_PLATFORM: Return IRQ info
  VFIO_PLATFORM: Initial interrupts support
  VFIO_PLATFORM: Support for maskable and automasked interrupts

Kim Phillips (1):
  driver core: export driver_probe_device()

 drivers/base/base.h                           |   1 -
 drivers/base/dd.c                             |   1 +
 drivers/vfio/Kconfig                          |   3 +-
 drivers/vfio/Makefile                         |   1 +
 drivers/vfio/platform/Kconfig                 |   9 +
 drivers/vfio/platform/Makefile                |   4 +
 drivers/vfio/platform/vfio_platform.c         | 493 ++++++++++++++++++++++++++
 drivers/vfio/platform/vfio_platform_irq.c     | 289 +++++++++++++++
 drivers/vfio/platform/vfio_platform_private.h |  50 +++
 drivers/vfio/vfio_iommu_type1.c               |  27 +-
 include/linux/device.h                        |   1 +
 include/uapi/linux/vfio.h                     |   2 +
 12 files changed, 874 insertions(+), 7 deletions(-)
 create mode 100644 drivers/vfio/platform/Kconfig
 create mode 100644 drivers/vfio/platform/Makefile
 create mode 100644 drivers/vfio/platform/vfio_platform.c
 create mode 100644 drivers/vfio/platform/vfio_platform_irq.c
 create mode 100644 drivers/vfio/platform/vfio_platform_private.h

-- 
1.8.3.2


^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2014-03-31 23:52 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-08 17:29 [RFC PATCH v4 00/10] VFIO support for platform devices Antonios Motakis
2014-02-08 17:29 ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 01/10] driver core: export driver_probe_device() Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-14 22:27   ` Greg KH
2014-02-14 22:27     ` Greg KH
     [not found]     ` <20140214222716.GA11838-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-02-14 23:00       ` Stuart Yoder
     [not found]         ` <ba7597fd8c9f4d91bbccfb42e31a165e-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-02-15  2:47           ` Greg KH
2014-02-15  2:47             ` Greg KH
     [not found]             ` <20140215024725.GA2542-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-02-15 16:33               ` Stuart Yoder
2014-02-15 16:33                 ` Stuart Yoder
     [not found]                 ` <7043e1edd9974de590dcb392cd8aff14-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-02-15 17:33                   ` Greg KH
2014-02-15 17:33                     ` Greg KH
     [not found]                     ` <20140215173348.GA8056-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-02-15 18:19                       ` Stuart Yoder
2014-02-15 18:19                         ` Stuart Yoder
     [not found]                         ` <38f0473542954fe8b312a1f7b61a3d21-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-02-18  0:38                           ` Scott Wood
2014-02-18  0:38                             ` Scott Wood
2014-02-20 22:34                     ` Stuart Yoder
2014-02-20 22:34                       ` Stuart Yoder
     [not found]                       ` <b6374a0f30194969ba4622ff2f58ae65-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-02-20 22:43                         ` Greg KH
2014-02-20 22:43                           ` Greg KH
     [not found]                           ` <20140220224337.GA20097-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-03-06 22:25                             ` Stuart Yoder
2014-03-06 22:25                               ` Stuart Yoder
2014-03-26  1:40                           ` mechanism to allow a driver to bind to any device Stuart Yoder
2014-03-26  1:40                             ` Stuart Yoder
     [not found]                             ` <54cd150235ba4954becdd12f725c5ebd-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-03-26 14:40                               ` Konrad Rzeszutek Wilk
     [not found]                                 ` <20140326144025.GA18387-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2014-03-26 15:06                                   ` Alexander Graf
     [not found]                                     ` <D45FC8F2-7807-4BBB-A253-8EFCD091D6BD-l3A5Bk7waGM@public.gmane.org>
2014-03-26 16:21                                       ` Alex Williamson
     [not found]                                         ` <1395850862.632.247.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-03-26 16:32                                           ` Konrad Rzeszutek Wilk
2014-03-26 16:32                                             ` Konrad Rzeszutek Wilk
     [not found]                                             ` <20140326163209.GB21368-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2014-03-26 16:49                                               ` Alex Williamson
2014-03-26 16:49                                                 ` Alex Williamson
     [not found]                                                 ` <1395852592.632.253.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-03-26 17:04                                                   ` Konrad Rzeszutek Wilk
2014-03-26 17:04                                                     ` Konrad Rzeszutek Wilk
     [not found]                                                     ` <20140326170406.GA22902-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2014-03-26 17:26                                                       ` Alex Williamson
2014-03-26 17:26                                                         ` Alex Williamson
2014-03-26 17:51                                               ` Stuart Yoder
2014-03-26 22:09                                           ` Alex Williamson
     [not found]                                             ` <1395871761.632.316.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-03-28 16:58                                               ` Konrad Rzeszutek Wilk
2014-03-28 16:58                                                 ` Konrad Rzeszutek Wilk
     [not found]                                                 ` <20140328165809.GA12659-6K5HmflnPlqSPmnEAIUT9EEOCMrvLtNR@public.gmane.org>
2014-03-28 17:10                                                   ` Alex Williamson
2014-03-28 17:10                                                     ` Alex Williamson
2014-03-31 22:36                                                     ` Kim Phillips
2014-03-31 22:36                                                       ` Kim Phillips
2014-03-31 23:52                                                       ` Alex Williamson
2014-03-31 23:52                                                         ` Alex Williamson
2014-03-31 18:47                                             ` Stuart Yoder
2014-03-31 18:47                                               ` Stuart Yoder
     [not found]                                               ` <7d1b495cdb6a415e8d3b7f60f409991c-ufbTtyGzTTT8GZusEWM6WuO6mTEJWrR4XA4E9RH9d+qIuWR1G4zioA@public.gmane.org>
2014-03-31 19:47                                                 ` Greg KH
     [not found]                                                   ` <20140331194705.GA13014-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-03-31 20:23                                                     ` Stuart Yoder
2014-03-31 22:32                                                       ` Kim Phillips
2014-03-31 22:32                                                         ` Kim Phillips
2014-03-31 18:32                                           ` Stuart Yoder
2014-03-31 18:32                                             ` Stuart Yoder
2014-03-26 16:24                                       ` Konrad Rzeszutek Wilk
2014-03-26 15:32                                   ` Stuart Yoder
2014-03-26 21:39                               ` Antonios Motakis
2014-03-26 21:39                                 ` Antonios Motakis
     [not found]                                 ` <CAG8rG2xCvCGJWwZTnkia5GD3BVJZB9SmKOm79T6Q1FnhgB+urw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-28  6:59                                   ` Greg KH
2014-03-28  6:59                                     ` Greg KH
     [not found]                                     ` <20140328065942.GB14619-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-03-31 18:21                                       ` Stuart Yoder
2014-03-26 21:42                               ` Antonios Motakis
2014-03-26 21:42                                 ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 02/10] VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-10 20:04   ` Alex Williamson
2014-02-10 20:04     ` Alex Williamson
2014-02-08 17:29 ` [RFC PATCH v4 03/10] VFIO_IOMMU_TYPE1: workaround to build for platform devices Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 04/10] VFIO_PLATFORM: Initial skeleton of VFIO support " Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 05/10] VFIO_PLATFORM: Return info for device and its memory mapped IO regions Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-10 22:32   ` Alex Williamson
2014-02-10 22:32     ` Alex Williamson
2014-02-08 17:29 ` [RFC PATCH v4 06/10] VFIO_PLATFORM: Read and write support for the device fd Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-10 22:45   ` Alex Williamson
2014-02-10 22:45     ` Alex Williamson
2014-02-10 23:12     ` Scott Wood
2014-02-10 23:12       ` Scott Wood
2014-02-10 23:20       ` Alex Williamson
2014-02-10 23:20         ` Alex Williamson
2014-02-08 17:29 ` [RFC PATCH v4 07/10] VFIO_PLATFORM: Support MMAP of MMIO regions Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 08/10] VFIO_PLATFORM: Return IRQ info Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 09/10] VFIO_PLATFORM: Initial interrupts support Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis
2014-02-08 17:29 ` [RFC PATCH v4 10/10] VFIO_PLATFORM: Support for maskable and automasked interrupts Antonios Motakis
2014-02-08 17:29   ` Antonios Motakis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.