For historical reasons, the spapr machine type has two PCI host bridge
implementations: spapr-pci-host-bridge, and
spapr-vfio-pci-host-bridge.  The latter was (duh) designed for VFIO
devices, but later reworks mean it's not necessary for that, and VFIO
can be used on the regular host bridge.

The only remaining difference is that EEH (Enhanced Error Handling -
IBM's interface with similar purpose to AER) is only supported on the
spapr-vfio-pci-host-bridge device.

This series corrects this, allowing EEH operations on the regular host
bridge.  That allows the special VFIO host bridge (we leave a stub,
for backwards compatibility).

EEH is only supported for VFIO devices, for the time being, and due to
bugs in the kernel implementation, it is only usable when the host
bridge only has devices from a single (host-side) IOMMU group
("Partitionable Endpoint", in IBM terminology).  That's an annoying
limitation which we hope to lift someday, but it's no worse than now,
since the spapr-vfio-pci-host-bridge only permits devices from a
single IOMMU group in any case (although it doesn't properly enforce
that).

I wrote these a while back, and I'm not sure why they got sidelined -
I suspect I was looking for testing from Gavin Shan, not realising
then that he was no longer working on EEH.  In any case, I'm hoping we
can squeeze this change into 2.6, so we don't need to carry the broken
spapr-vfio-pci-host-bridge device any longer.

David Gibson (12):
  vfio: Start improving VFIO/EEH interface
  spapr_pci: Switch to vfio_eeh_as_op() interface
  spapr_pci: Eliminate class callbacks
  spapr_pci: Fold spapr_phb_vfio_eeh_configure() into spapr_pci code
  spapr_pci: Fold spapr_phb_vfio_eeh_reset() into spapr_pci code
  spapr_pci: Fold spapr_phb_vfio_eeh_get_state() into spapr_pci code
  spapr_pci: Fold spapr_phb_vfio_eeh_set_option() into spapr_pci code
  spapr_pci: Fold spapr_phb_vfio_reset() into spapr_pci code
  spapr_pci: Allow EEH on spapr-pci-host-bridge
  spapr_pci: (Mostly) remove spapr-pci-vfio-host-bridge
  spapr_pci: Remove finish_realize hook
  vfio: Eliminate vfio_container_ioctl()

 hw/ppc/spapr_pci.c          | 203 +++++++++++++++++++++++++++---------
 hw/ppc/spapr_pci_vfio.c     | 245 +++-----------------------------------------
 hw/vfio/common.c            |  94 +++++++++++------
 include/hw/pci-host/spapr.h |  28 +----
 include/hw/vfio/vfio.h      |   4 +-
 5 files changed, 235 insertions(+), 339 deletions(-)

-- 
2.5.0


Reply via email to