This series adds Mediated device support to Linux host kernel. Purpose of this series is to provide a common interface for mediated device management that can be used by different devices. This series introduces Mdev core module that create and manage mediated devices, VFIO based driver for mediated devices that are created by mdev core module and update VFIO type1 IOMMU module to support pinning & unpinning for mediated devices. This change uses uuid_le_to_bin() to parse UUID string and convert to bin. This requires following commits from linux master branch: * commit bc9dc9d5eec908806f1b15c9ec2253d44dcf7835 : lib/uuid.c: use correct offset in uuid parser * commit 2b1b0d66704a8cafe83be7114ec4c15ab3a314ad : lib/uuid.c: introduce a few more generic helpers Requires below commits from linux master branch for mmap region fault handler that uses remap_pfn_range() to setup EPT properly. * commit add6a0cd1c5ba51b201e1361b05a5df817083618 KVM: MMU: try to fix up page faults before giving up * commit 92176a8ede577d0ff78ab3298e06701f67ad5f51 : KVM: MMU: prepare to support mapping of VM_IO and VM_PFNMAP frames What's new in v7? - Removed 'instance' field from mdev_device structure. - Replaced 'start' and 'stop' with 'online' interface which is per mdev device and takes 1 or 0 as argument. - Removed validate_mmap_request() callback and added mmap() callback to parent_ops. - With above change, removed mapping tracking logic and invalidation function from mdev core module. Vendor driver should have this in their module. - Added get_device_info() callback so that vendor driver can define the device type, number of regions and number of IRQs supported. - Added get_irq_info() callback for vendor driver to define the flags for irqs. - Updated get_region_info() callback so that vendor driver can specify the capabilities. - With all the above changes, VFIO driver is no more PCI driver. It can be used for any type of device. Hence, renamed vfio_mpci module to vfio_mdev and removed match() from driver interface structure. Yet TODO: Need to handle the case in vfio_type1_iommu module that Alex pointed out in v6 review, that is, if the devices attached to the normal IOMMU API domain go away, need to re-establish accounting for local domain. Kirti Wankhede (4): vfio: Mediated device Core driver vfio: VFIO driver for mediated devices vfio iommu: Add support for mediated devices docs: Add Documentation for Mediated devices Documentation/vfio-mediated-device.txt | 203 +++++++++++++ drivers/vfio/Kconfig | 1 + drivers/vfio/Makefile | 1 + drivers/vfio/mdev/Kconfig | 18 ++ drivers/vfio/mdev/Makefile | 6 + drivers/vfio/mdev/mdev_core.c | 509 +++++++++++++++++++++++++++++++++ drivers/vfio/mdev/mdev_driver.c | 131 +++++++++ drivers/vfio/mdev/mdev_private.h | 36 +++ drivers/vfio/mdev/mdev_sysfs.c | 240 ++++++++++++++++ drivers/vfio/mdev/vfio_mdev.c | 467 ++++++++++++++++++++++++++++++ drivers/vfio/pci/vfio_pci_private.h | 6 +- drivers/vfio/vfio.c | 117 ++++++++ drivers/vfio/vfio_iommu_type1.c | 499 +++++++++++++++++++++++++++++--- include/linux/mdev.h | 212 ++++++++++++++ include/linux/vfio.h | 13 +- 15 files changed, 2408 insertions(+), 51 deletions(-) create mode 100644 Documentation/vfio-mediated-device.txt create mode 100644 drivers/vfio/mdev/Kconfig create mode 100644 drivers/vfio/mdev/Makefile create mode 100644 drivers/vfio/mdev/mdev_core.c create mode 100644 drivers/vfio/mdev/mdev_driver.c create mode 100644 drivers/vfio/mdev/mdev_private.h create mode 100644 drivers/vfio/mdev/mdev_sysfs.c create mode 100644 drivers/vfio/mdev/vfio_mdev.c create mode 100644 include/linux/mdev.h -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html