spapr_pci: Allow VFIO devices to work on the normal PCI host bridge
authorDavid Gibson <david@gibson.dropbear.id.au>
Thu, 24 Sep 2015 00:34:23 +0000 (10:34 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 22 Oct 2015 23:38:10 +0000 (10:38 +1100)
commit185181f8835b1b68409ac4381688eafdca0172cc
treef720f51b966af91b96b47fb0718598e7ed951c8f
parentc10325d6f9af84444120d8a6d1d59f41a282ae1b
spapr_pci: Allow VFIO devices to work on the normal PCI host bridge

The core VFIO infrastructure more or less allows VFIO devices to work
on any normal guest PCI host bridge (PHB) without extra logic.
However, the "spapr-pci-host-bridge" device (as opposed to the special
"spapr-pci-vfio-host-bridge" device) breaks this by using a partially
KVM accelerated implementation of the guest kernel IOMMU which won't
work with VFIO devices, without additional kernel support.

This patch allows VFIO devices to work on the spapr-pci-host-bridge,
by having it switch off KVM TCE acceleration when a VFIO device is
added to the PHB (either on startup, or by hotplug).

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
hw/ppc/spapr_pci.c