linux-stable/drivers/vfio
Alexey Kardashevskiy 1282ba7fc2 vfio/powerpc/spapr_tce: Enforce IOMMU type compatibility check
The existing SPAPR TCE driver advertises both VFIO_SPAPR_TCE_IOMMU and
VFIO_SPAPR_TCE_v2_IOMMU types to the userspace and the userspace usually
picks the v2.

Normally the userspace would create a container, attach an IOMMU group
to it and only then set the IOMMU type (which would normally be v2).

However a specific IOMMU group may not support v2, in other words
it may not implement set_window/unset_window/take_ownership/
release_ownership and such a group should not be attached to
a v2 container.

This adds extra checks that a new group can do what the selected IOMMU
type suggests. The userspace can then test the return value from
ioctl(VFIO_SET_IOMMU, VFIO_SPAPR_TCE_v2_IOMMU) and try
VFIO_SPAPR_TCE_IOMMU.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2017-04-11 13:38:46 -06:00
..
mdev vfio/mdev: Use a module softdep for vfio_mdev 2017-02-08 13:13:25 -07:00
pci vfio-pci: Handle error from pci_iomap 2017-01-04 08:34:39 -07:00
platform vfio_platform: Updated to use vfio_set_irqs_validate_and_prepare() 2016-11-17 08:33:20 -07:00
Kconfig vfio: Fix build break when SPAPR_TCE_IOMMU=n 2017-02-08 13:13:25 -07:00
Makefile vfio: Mediated device Core driver 2016-11-17 08:24:48 -07:00
vfio.c vfio: Rework group release notifier warning 2017-03-21 13:19:09 -06:00
vfio_iommu_spapr_tce.c vfio/powerpc/spapr_tce: Enforce IOMMU type compatibility check 2017-04-11 13:38:46 -06:00
vfio_iommu_type1.c iommu: Disambiguate MSI region types 2017-03-22 16:16:17 +01:00
vfio_spapr_eeh.c drivers/vfio: Support EEH error injection 2015-05-12 20:33:35 +10:00
virqfd.c vfio: Split virqfd into a separate module for vfio bus drivers 2015-03-17 08:33:38 -06:00