This series implements PCI pass-through using VFIO in kvmtool. We introduce a new parameter to lkvm run, --vfio-group, that takes an IOMMU group number as argument, and passes all devices in the group to the guest. Since last version [1], I fixed a few things pointed out by Punit. The series has now been tested on hardware (previously only software model.) * Import VFIO headers from Linux (6/11 is new). * Allow a guest to choose between INTx, MSI and MSI-X instead of presenting only the one we prefer. INTx has to be enabled from the start, since we're not notified when the guest starts using it. When it enables MSI or MSI-X, we disable INTx. * Fixed PCI capability initialization and header parsing. * Tested the MSI support (9/11), since the Intel IGB NIC used for testing has both MSI and MSI-X capabilities. [1] http://www.spinics.net/lists/kvm/msg151823.html [2] git://linux-arm.org/kvmtool-jpb.git vfio/v3 Jean-Philippe Brucker (11): 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 Import VFIO headers Add PCI device passthrough 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 | 2 + arm/gic.c | 74 ++- 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 | 118 ++++- include/kvm/vfio.h | 109 ++++ include/linux/vfio.h | 719 +++++++++++++++++++++++++ irq.c | 24 + kvm.c | 99 +++- mips/kvm.c | 6 +- pci.c | 105 ++-- powerpc/kvm.c | 2 +- vfio/core.c | 430 +++++++++++++++ vfio/pci.c | 1184 ++++++++++++++++++++++++++++++++++++++++++ virtio/net.c | 9 +- virtio/scsi.c | 10 +- x86/kvm.c | 6 +- 24 files changed, 2879 insertions(+), 123 deletions(-) create mode 100644 include/kvm/vfio.h create mode 100644 include/linux/vfio.h create mode 100644 vfio/core.c create mode 100644 vfio/pci.c -- 2.14.3