[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 40/51] vfio-pci: Release all MSI-X vectors when dis
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 40/51] vfio-pci: Release all MSI-X vectors when disabled |
Date: |
Fri, 21 Feb 2014 02:17:16 -0600 |
From: Alex Williamson <address@hidden>
We were relying on msix_unset_vector_notifiers() to release all the
vectors when we disable MSI-X, but this only happens when MSI-X is
still enabled on the device. Perform further cleanup by releasing
any remaining vectors listed as in-use after this call. This caused
a leak of IRQ routes on hotplug depending on how the guest OS prepared
the device for removal.
Signed-off-by: Alex Williamson <address@hidden>
Cc: address@hidden
(cherry picked from commit 3e40ba0faf0822fa78336fe6cd9d677ea9b14f1b)
Signed-off-by: Michael Roth <address@hidden>
---
hw/misc/vfio.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/misc/vfio.c b/hw/misc/vfio.c
index f7f8a19..355b018 100644
--- a/hw/misc/vfio.c
+++ b/hw/misc/vfio.c
@@ -878,8 +878,20 @@ static void vfio_disable_msi_common(VFIODevice *vdev)
static void vfio_disable_msix(VFIODevice *vdev)
{
+ int i;
+
msix_unset_vector_notifiers(&vdev->pdev);
+ /*
+ * MSI-X will only release vectors if MSI-X is still enabled on the
+ * device, check through the rest and release it ourselves if necessary.
+ */
+ for (i = 0; i < vdev->nr_vectors; i++) {
+ if (vdev->msi_vectors[i].use) {
+ vfio_msix_vector_release(&vdev->pdev, i);
+ }
+ }
+
if (vdev->nr_vectors) {
vfio_disable_irqindex(vdev, VFIO_PCI_MSIX_IRQ_INDEX);
}
--
1.7.9.5
- [Qemu-stable] [PATCH 25/51] exec: separate sections and nodes per address space, (continued)
- [Qemu-stable] [PATCH 25/51] exec: separate sections and nodes per address space, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 32/51] tcg/optimize: fix known-zero bits for right shift ops, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 31/51] Fix QEMU build on OpenBSD on x86 archs, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 34/51] block/iscsi: use a bh to schedule co reentrance, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 33/51] hpet: fix build with CONFIG_HPET off, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 35/51] qemu_opts_parse(): always check return value, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 38/51] mainstone: Fix duplicate array values for key 'space', Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 36/51] s390x/kvm: Fix diagnose handling., Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 37/51] seccomp: exit if seccomp_init() fails, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 39/51] migration: qmp_migrate(): keep working after syntax error, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 40/51] vfio-pci: Release all MSI-X vectors when disabled,
Michael Roth <=
- [Qemu-stable] [PATCH 41/51] block/curl: Implement the libcurl timer callback interface, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 43/51] scsi: Assign cancel_io vector for scsi_disk_emulate_ops, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 42/51] scsi: Support TEST UNIT READY in the dummy LUN0, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 44/51] virtio-scsi: Cleanup of I/Os that never started, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 45/51] virtio-scsi: Prevent assertion on missed events, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 47/51] i386: Add missing include file for QEMU_PACKED, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 46/51] KVM: Retry KVM_CREATE_VM on EINTR, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 48/51] linux-user: Fix trampoline code for CRIS, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 50/51] memory: fix limiting of translation at a page boundary, Michael Roth, 2014/02/21
- [Qemu-stable] [PATCH 51/51] tcg-arm: The shift count of op_rotl_i32 is in args[2] not args[1]., Michael Roth, 2014/02/21