alistair23-linux/drivers/vfio
Alexey Kardashevskiy a32295c612 vfio-pci: Allow mapping MSIX BAR
By default VFIO disables mapping of MSIX BAR to the userspace as
the userspace may program it in a way allowing spurious interrupts;
instead the userspace uses the VFIO_DEVICE_SET_IRQS ioctl.
In order to eliminate guessing from the userspace about what is
mmapable, VFIO also advertises a sparse list of regions allowed to mmap.

This works fine as long as the system page size equals to the MSIX
alignment requirement which is 4KB. However with a bigger page size
the existing code prohibits mapping non-MSIX parts of a page with MSIX
structures so these parts have to be emulated via slow reads/writes on
a VFIO device fd. If these emulated bits are accessed often, this has
serious impact on performance.

This allows mmap of the entire BAR containing MSIX vector table.

This removes the sparse capability for PCI devices as it becomes useless.

As the userspace needs to know for sure whether mmapping of the MSIX
vector containing data can succeed, this adds a new capability -
VFIO_REGION_INFO_CAP_MSIX_MAPPABLE - which explicitly tells the userspace
that the entire BAR can be mmapped.

This does not touch the MSIX mangling in the BAR read/write handlers as
we are doing this just to enable direct access to non MSIX registers.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
[aw - fixup whitespace, trim function name]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2017-12-20 10:05:06 -07:00
..
mdev vfio/mdev: Use a module softdep for vfio_mdev 2017-02-08 13:13:25 -07:00
pci vfio-pci: Allow mapping MSIX BAR 2017-12-20 10:05:06 -07:00
platform VFIO Updates for Linux v4.15 2017-11-14 16:47:47 -08:00
Kconfig vfio: Fix build break when SPAPR_TCE_IOMMU=n 2017-02-08 13:13:25 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio.c vfio: Simplify capability helper 2017-12-20 09:53:54 -07:00
vfio_iommu_spapr_tce.c vfio/spapr: Add cond_resched() for huge updates 2017-10-02 12:39:11 -06:00
vfio_iommu_type1.c vfio/type1: silence integer overflow warning 2017-10-20 11:41:56 -06:00
vfio_spapr_eeh.c
virqfd.c sched/wait: Rename wait_queue_t => wait_queue_entry_t 2017-06-20 12:18:27 +02:00