[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 22/67] vfio/pci: Fix regression in MSI routing conf
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 22/67] vfio/pci: Fix regression in MSI routing configuration |
Date: |
Wed, 14 Dec 2016 18:44:16 -0600 |
From: David Gibson <address@hidden>
d1f6af6 "kvm-irqchip: simplify kvm_irqchip_add_msi_route" was a cleanup
of kvmchip routing configuration, that was mostly intended for x86.
However, it also contains a subtle change in behaviour which breaks EEH[1]
error recovery on certain VFIO passthrough devices on spapr guests. So far
it's only been seen on a BCM5719 NIC on a POWER8 server, but there may be
other hardware with the same problem. It's also possible there could be
circumstances where it causes a bug on x86 as well, though I don't know of
any obvious candidates.
Prior to d1f6af6, both vfio_msix_vector_do_use() and
vfio_add_kvm_msi_virq() used msg == NULL as a special flag to mark this
as the "dummy" vector used to make the host hardware state sync with the
guest expected hardware state in terms of MSI configuration.
Specifically that flag caused vfio_add_kvm_msi_virq() to become a no-op,
meaning the dummy irq would always be delivered via qemu. d1f6af6 changed
vfio_add_kvm_msi_virq() so it takes a vector number instead of the msg
parameter, and determines the correct message itself. The test for !msg
was removed, and not replaced with anything there or in the caller.
With an spapr guest which has a VFIO device, if an EEH error occurs on the
host hardware, then the device will be isolated then reset. This is a
combination of host and guest action, mediated by some EEH related
hypercalls. I haven't fully traced the mechanics, but somehow installing
the kvm irqchip route for the dummy irq on the BCM5719 means that after EEH
reset and recovery, at least some irqs are no longer delivered to the
guest.
In particular, the guest never gets the link up event, and so the NIC is
effectively dead.
[1] EEH (Enhanced Error Handling) is an IBM POWER server specific PCI-*
error reporting and recovery mechanism. The concept is somewhat
similar to PCI-E AER, but the details are different.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1373802
Cc: Alex Williamson <address@hidden>
Cc: Peter Xu <address@hidden>
Cc: Gavin Shan <address@hidden>
Signed-off-by: David Gibson <address@hidden>
Cc: address@hidden
Fixes: d1f6af6a17a6 ("kvm-irqchip: simplify kvm_irqchip_add_msi_route")
Signed-off-by: Alex Williamson <address@hidden>
(cherry picked from commit 6d17a018d09801a2b18133a4febd81433bb0cf85)
Signed-off-by: Michael Roth <address@hidden>
---
hw/vfio/pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 7bfa17c..a5a620a 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -496,7 +496,9 @@ static int vfio_msix_vector_do_use(PCIDevice *pdev,
unsigned int nr,
vfio_update_kvm_msi_virq(vector, *msg, pdev);
}
} else {
- vfio_add_kvm_msi_virq(vdev, vector, nr, true);
+ if (msg) {
+ vfio_add_kvm_msi_virq(vdev, vector, nr, true);
+ }
}
/*
--
1.9.1
- [Qemu-stable] [PATCH 16/67] crypto: ensure XTS is only used with ciphers with 16 byte blocks, (continued)
- [Qemu-stable] [PATCH 16/67] crypto: ensure XTS is only used with ciphers with 16 byte blocks, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 17/67] iothread: Stop threads before main() quits, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 18/67] scsi-disk: Cleaning up around tray open state, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 19/67] virtio-scsi: Don't abort when media is ejected, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 20/67] ahci: clear aiocb in ncq_cb, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 01/67] linux-headers: update, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 21/67] s390x/css: handle cssid 255 correctly, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 23/67] qcow2: fix encryption during cow of sectors, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 22/67] vfio/pci: Fix regression in MSI routing configuration,
Michael Roth <=
- [Qemu-stable] [PATCH 25/67] block: reintroduce bdrv_flush_all, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 24/67] iscsi: Fix divide-by-zero regression on raw SG devices, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 26/67] qemu: use bdrv_flush_all for vm_stop et al, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 27/67] block-backend: remove blk_flush_all, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 02/67] hw/ppc/spapr: Move code related to "ibm, pa-features" to a separate function, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 30/67] qht: fix unlock-after-free segfault upon resizing, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 29/67] qht: simplify qht_reset_size, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 33/67] qapi: Fix crash when 'any' or 'null' parameter is missing, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 31/67] char: fix missing return in error path for chardev TLS init, Michael Roth, 2016/12/14
- [Qemu-stable] [PATCH 35/67] rbd: shift byte count as a 64-bit value, Michael Roth, 2016/12/14