vfio/pci: Restore MSIx message prior to enabling
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Mon, 29 Sep 2014 16:16:24 +0000 (10:16 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 29 Sep 2014 16:16:24 +0000 (10:16 -0600)
commitb8f02af096b1fc9fd46680cbe55214e477eb76d3
tree4f579b40a558d0ad1ad38b032bfb1f72a0d5cf21
parent3b307ffe3faad60aeda0e9a4f661d5c1edbd761e
vfio/pci: Restore MSIx message prior to enabling

The MSIx vector table lives in device memory, which may be cleared as
part of a backdoor device reset. This is the case on the IBM IPR HBA
when the BIST is run on the device. When assigned to a QEMU guest,
the guest driver does a pci_save_state(), issues a BIST, then does a
pci_restore_state(). The BIST clears the MSIx vector table, but due
to the way interrupts are configured the pci_restore_state() does not
restore the vector table as expected. Eventually this results in an
EEH error on Power platforms when the device attempts to signal an
interrupt with the zero'd table entry.

Fix the problem by restoring the host cached MSI message prior to
enabling each vector.

Reported-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_intrs.c