* [PATCH] vfio-pci: Disable INTx after MSI/X teardown
@ 2016-09-22 17:28 Alex Williamson
0 siblings, 0 replies; only message in thread
From: Alex Williamson @ 2016-09-22 17:28 UTC (permalink / raw)
To: kvm; +Cc: alex.williamson, linux-kernel
The MSI/X shutdown path can gratuitously enable INTx, which is not
something we want to happen if we're dealing with broken INTx device.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
drivers/vfio/pci/vfio_pci_intrs.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c
index 152b438..aa23e9a 100644
--- a/drivers/vfio/pci/vfio_pci_intrs.c
+++ b/drivers/vfio/pci/vfio_pci_intrs.c
@@ -414,6 +414,13 @@ static void vfio_msi_disable(struct vfio_pci_device *vdev, bool msix)
} else
pci_disable_msi(pdev);
+ /*
+ * Both disable paths above use pci_intx_for_msi() to clear DisINTx
+ * via their shutdown paths. Restore for NoINTx devices.
+ */
+ if (vdev->nointx)
+ pci_intx(pdev, 0);
+
vdev->irq_type = VFIO_PCI_NUM_IRQS;
vdev->num_ctx = 0;
kfree(vdev->ctx);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-22 17:28 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22 17:28 [PATCH] vfio-pci: Disable INTx after MSI/X teardown Alex Williamson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).