This patch set adds support for two VFIO-PCI ioctl flags: VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED and VFIO_DEVICE_FLAGS_PCI_MSIX_MMAP. Note that the kernel bits of this two flags are not in upstream and posted as <Allow to mmap sub-page MMIO BARs and MSI-X table on PPC64 platform>.
VFIO_DEVICE_FLAGS_PCI_PAGE_ALIGNED indicates that platform support all PCI MMIO BARs to be page aligned which means any BARs' mmio page would not be shared with other BARs. So it's allowed to mmap sub-page(size < PAGE_SIZE) MMIO BARs in QEMU. VFIO_DEVICE_FLAGS_PCI_MSIX_MMAP indicates that it's safe to mmap MSI-X table in QEMU. Besides supporting for these two mmapping cases, we also fix some issues which would block KVM to create memory slot for these mmapped sub-page MMIO BARs and mmapped MSI-X table. Posted kernel patches link: - https://www.mail-archive.com/kvm@vger.kernel.org/msg124031.html Yongji Xie (3): linux-headers: Update VFIO headers from linux-next tag ToBeFilled vfio/pci: Add support for mmapped sub-page MMIO BARs vfio/pci: Add support for mmapping MSI-X table hw/vfio/pci.c | 65 ++++++++++++++++++++++++++++++++++++++++---- linux-headers/linux/vfio.h | 4 +++ 2 files changed, 64 insertions(+), 5 deletions(-) -- 1.7.9.5