This series adds rudimentary VFIO support to kvmtool. PCI devices can be assigned to the guest with a new command-line option "--vfio-group". Most of it was written by Will Deacon some time ago, but the kernel was missing crucial features back then. Now that irqfd and MSI pass-through are supported by Linux on ARM, this implementation is complete enough to be merged. It is the minimum to pass a simplified PCI device to a guest, but most hardware devices will probably be missing a few features. For instance, we only pass-through MSI and MSI-X capabilities. Everything else is hidden, including PCIe or vendor-specific caps. Support for platform device assignment is also missing at the moment, although I'd like to work on that for the pl330 when I find some time. Patches 1-5 prepare the ground, patch 6 implements VFIO and patches 7-8 add support for MSIs. Patches 9 and 10 ensure that DMA from passed-through devices won't clash with regions reserved by the IOMMU. They are based on Andre's ITS series: https://www.spinics.net/lists/arm-kernel/msg560227.html I'm lacking hardware, both for ARM and x86, so I can only guarantee that this works on Fast Model. I would greatly appreciate testing and comments. Thanks, Jean-Philippe Jean-Philippe Brucker (10): pci: add config operations callbacks on the PCI header pci: allow to specify IRQ type for PCI devices irq: add irqfd helpers Extend memory bank API with memory types pci: add capability helpers Add PCI device pass-through using VFIO vfio-pci: add MSI-X support vfio-pci: add MSI support Introduce reserved memory regions vfio: check reserved regions before mapping DMA Makefile | 1 + arm/gic.c | 77 ++- arm/include/arm-common/gic.h | 6 + arm/kvm.c | 2 +- arm/pci.c | 4 +- builtin-run.c | 5 + hw/pci-shmem.c | 12 +- hw/vesa.c | 2 +- include/kvm/irq.h | 17 + include/kvm/kvm-config.h | 3 + include/kvm/kvm.h | 54 +- include/kvm/pci.h | 116 ++++- include/kvm/vfio.h | 72 +++ irq.c | 23 + kvm.c | 99 +++- mips/kvm.c | 6 +- pci.c | 105 ++-- powerpc/kvm.c | 2 +- vfio.c | 1178 ++++++++++++++++++++++++++++++++++++++++++ virtio/net.c | 9 +- virtio/scsi.c | 10 +- x86/kvm.c | 6 +- 22 files changed, 1686 insertions(+), 123 deletions(-) create mode 100644 include/kvm/vfio.h create mode 100644 vfio.c -- 2.12.1