iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v5 00/11] VFIO support for platform devices
@ 2014-04-28 15:52 Antonios Motakis
       [not found] ` <1398700371-20096-1-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
  0 siblings, 1 reply; 42+ messages in thread
From: Antonios Motakis @ 2014-04-28 15:52 UTC (permalink / raw)
  To: alex.williamson-H+wXaHxf7aLQT0dZR+AlfA,
	kvmarm-FPEHb7Xf0XXUo1n7N8X6UoWGPAHP3yOg,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
  Cc: kvm-u79uwXL29TY76Z2rM5mHXA, will.deacon-5wv7dgnIgG8,
	a.rigo-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J,
	stuart.yoder-KZfg59tc24xl57MIdRCFDg, Antonios Motakis,
	tech-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J,
	christoffer.dall-QSEj5FYQhm4dnm+yROfE0A

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 features already implemented in the series. The next
version v6 of the VFIO_PLATFORM patch series is planned to introduce more
complete functionality with more comprehensive eventfd support.

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-v5 at git-9UaJU3cA/F/QT0dZR+AlfA@public.gmane.org:virtualopensystems/linux-kvm-arm.git

For those who want to apply manually, these patches are based on Alex
Williamson's 'next' branch available from https://github.com/awilliam/linux-vfio
which includes the multi domain support patches for VFIO_IOMMU_TYPE1.
Kim Phillip's driver_override patch for platform bus devices is also
included here for convenience.

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
 - 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 availability of this flag is exposed via the capability
     VFIO_IOMMU_PROT_EXEC.

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. More comprehensive support for eventfd
     functionality is planned for v6.

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 (IRQFD and IOEVENTFD from the KVM side)
 - Extend the driver and API for device tree metadata
 - Support ARM AMBA devices natively
 - Device specific functionality (e.g. VFIO_DEVICE_RESET)
 - IOMMUs with nested page tables (Stage 1 & 2 translation on ARM SMMUs)

Changes since v4:
 - Use static offsets for each region in the VFIO device fd
 - Include patch in the series for the ARM SMMU to expose IOMMU_EXEC
   availability via IOMMU_CAP_DMA_EXEC
 - Rebased on VFIO multi domain support:
   - IOMMU_EXEC is now available if at least one IOMMU in the container
     supports it
   - Expose IOMMU_EXEC if available via the capability VFIO_IOMMU_PROT_EXEC
 - Some bug fixes
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 (10):
  ARM SMMU: Add capability IOMMU_CAP_DMA_EXEC
  VFIO_IOMMU_TYPE1 for platform bus devices on ARM
  VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag
  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: platform: add device binding path 'driver_override'

 Documentation/ABI/testing/sysfs-bus-platform  |  20 ++
 drivers/base/platform.c                       |  46 +++
 drivers/iommu/arm-smmu.c                      |   2 +
 drivers/vfio/Kconfig                          |   3 +-
 drivers/vfio/Makefile                         |   1 +
 drivers/vfio/platform/Kconfig                 |   9 +
 drivers/vfio/platform/Makefile                |   4 +
 drivers/vfio/platform/vfio_platform.c         | 436 ++++++++++++++++++++++++++
 drivers/vfio/platform/vfio_platform_irq.c     | 289 +++++++++++++++++
 drivers/vfio/platform/vfio_platform_private.h |  59 ++++
 drivers/vfio/vfio_iommu_type1.c               |  39 ++-
 include/linux/iommu.h                         |   5 +-
 include/linux/platform_device.h               |   1 +
 include/uapi/linux/vfio.h                     |   3 +
 14 files changed, 910 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-platform
 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] 42+ messages in thread

end of thread, other threads:[~2014-07-08 22:37 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-28 15:52 [RFC PATCH v5 00/11] VFIO support for platform devices Antonios Motakis
     [not found] ` <1398700371-20096-1-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 15:52   ` [RFC PATCH v5 01/11] driver core: platform: add device binding path 'driver_override' Antonios Motakis
2014-05-21  0:25     ` [RFC PATCH v5_v2 " Kim Phillips
     [not found]       ` <20140520192537.bab9fa2088c1cd5da3f92639-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-05-29 19:43         ` Alex Williamson
     [not found]           ` <1401392619.2412.102.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-05-29 21:24             ` Alexander Graf
2014-05-30  0:36         ` Stuart Yoder
2014-06-03  0:42     ` [PATCH] " Kim Phillips
     [not found]       ` <20140602194258.5135925bf3c71b9c010fb409-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2014-06-03  4:28         ` Greg KH
     [not found]           ` <20140603042842.GD14668-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-06-26  1:08             ` Kim Phillips
2014-07-07 21:19             ` Kim Phillips
2014-07-08 22:37         ` Greg KH
2014-04-28 15:52   ` [RFC PATCH v5 02/11] ARM SMMU: Add capability IOMMU_CAP_DMA_EXEC Antonios Motakis
     [not found]     ` <1398700371-20096-3-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 19:37       ` Will Deacon
     [not found]         ` <20140428193709.GE22135-5wv7dgnIgG8@public.gmane.org>
2014-04-28 20:20           ` Alex Williamson
2014-04-29  9:49           ` Antonios Motakis
2014-04-29  9:52           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 03/11] VFIO_IOMMU_TYPE1 for platform bus devices on ARM Antonios Motakis
     [not found]     ` <1398700371-20096-4-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 16:43       ` Alex Williamson
     [not found]         ` <1398703421.24318.262.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-28 19:19           ` Will Deacon
     [not found]             ` <20140428191920.GC22135-5wv7dgnIgG8@public.gmane.org>
2014-04-28 20:08               ` Alex Williamson
     [not found]                 ` <1398715690.24318.321.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-30 13:08                   ` Will Deacon
2014-04-28 15:52   ` [RFC PATCH v5 04/11] VFIO_IOMMU_TYPE1: Introduce the VFIO_DMA_MAP_FLAG_EXEC flag Antonios Motakis
     [not found]     ` <1398700371-20096-5-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 16:53       ` Alex Williamson
     [not found]         ` <1398704036.24318.269.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-29 13:16           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 05/11] VFIO_PLATFORM: Initial skeleton of VFIO support for platform devices Antonios Motakis
     [not found]     ` <1398700371-20096-6-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:04       ` Alex Williamson
     [not found]         ` <1398704642.24318.273.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-29 13:23           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 06/11] VFIO_PLATFORM: Return info for device and its memory mapped IO regions Antonios Motakis
     [not found]     ` <1398700371-20096-7-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:16       ` Alex Williamson
     [not found]         ` <1398705389.24318.279.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-05-02 16:55           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 07/11] VFIO_PLATFORM: Read and write support for the device fd Antonios Motakis
     [not found]     ` <1398700371-20096-8-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:24       ` Alex Williamson
     [not found]         ` <1398705857.24318.284.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-29 13:27           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 08/11] VFIO_PLATFORM: Support MMAP of MMIO regions Antonios Motakis
     [not found]     ` <1398700371-20096-9-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:27       ` Alex Williamson
     [not found]         ` <1398706042.24318.287.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-04-29 13:28           ` Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 09/11] VFIO_PLATFORM: Return IRQ info Antonios Motakis
     [not found]     ` <1398700371-20096-10-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:33       ` Alex Williamson
2014-04-28 15:52   ` [RFC PATCH v5 10/11] VFIO_PLATFORM: Initial interrupts support Antonios Motakis
2014-04-28 15:52   ` [RFC PATCH v5 11/11] VFIO_PLATFORM: Support for maskable and automasked interrupts Antonios Motakis
     [not found]     ` <1398700371-20096-12-git-send-email-a.motakis-lrHrjnjw1UfHK3s98zE1ajGjJy/sRE9J@public.gmane.org>
2014-04-28 17:46       ` Alex Williamson
     [not found]         ` <1398707198.24318.293.camel-85EaTFmN5p//9pzu0YdTqQ@public.gmane.org>
2014-05-02 17:25           ` Antonios Motakis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).