qemu-patch-raspberry4/hw
David Gibson 6d17a018d0 vfio/pci: Fix regression in MSI routing configuration
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 <alex.williamson@redhat.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Gavin Shan <gwshan@au1.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: qemu-stable@nongnu.org
Fixes: d1f6af6a17 ("kvm-irqchip: simplify kvm_irqchip_add_msi_route")
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2016-09-15 10:41:36 -06:00
..
9pfs 9pfs: handle walk of ".." in the root directory 2016-08-30 19:23:00 +01:00
acpi trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
alpha trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
arm hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all 2016-09-13 19:09:42 +02:00
audio portio: keep references on portio 2016-09-08 18:05:21 +04:00
block virtio-blk: rename virtio_device_info to virtio_blk_info 2016-09-13 11:00:56 +01:00
bt hw/bt/hci: spelling fix: endianness 2016-09-13 18:12:34 +03:00
char hw: replace most use of qemu_chr_fe_write with qemu_chr_fe_write_all 2016-09-13 19:09:42 +02:00
core bus: simplify name handling 2016-09-08 18:05:22 +04:00
cpu cpu: Abstract CPU core type 2016-06-17 16:33:48 +10:00
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display virtio-vga: adapt to page-per-vq=off 2016-09-13 09:28:10 +02:00
dma * minor patches here and there 2016-09-15 10:24:22 +01:00
gpio hw/gpio: QOM'ify zaurus.c 2016-06-14 15:59:13 +01:00
i2c i2c: fix migration regression introduced by broadcast support 2016-08-03 18:44:56 +02:00
i386 * minor patches here and there 2016-09-15 10:24:22 +01:00
ide portio: keep references on portio 2016-09-08 18:05:21 +04:00
input pc: simplify passing qemu_irq 2016-09-08 18:05:21 +04:00
intc xics_kvm: drop extra checking of kernel_xics_fd 2016-09-07 09:52:14 +10:00
ipack ipack: Update e-mail address 2016-05-18 15:04:27 +03:00
ipmi ipmi: check return of qemu_chr_fe_write() for errors 2016-09-13 19:09:42 +02:00
isa portio: keep references on portio 2016-09-08 18:05:21 +04:00
lm32 Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
m68k hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
mem nvdimm: fix memory leak in error code path 2016-07-20 19:30:26 +03:00
microblaze Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
mips error: Strip trailing '\n' from error string arguments (again) 2016-08-08 09:00:44 +02:00
misc ppc patch queue for 2016-Sep-7 2016-09-08 11:28:12 +01:00
moxie hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
net hw/net/e1000e: Fix compiler warning 2016-09-13 18:12:34 +03:00
nvram trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
openrisc hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
pci trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
pci-bridge hw/pci-bridge: Convert pxb initialization functions to Error 2016-07-29 00:07:09 +03:00
pci-host apb: convert init to realize 2016-07-29 00:07:09 +03:00
pcmcia hw: Clean up includes 2016-01-29 15:07:25 +00:00
ppc hw/ppc: add a ppc_create_page_sizes_prop() helper routine 2016-09-07 12:40:12 +10:00
s390x vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
scsi Revert "megasas: remove useless check for cmd->frame" 2016-09-13 19:09:43 +02:00
sd sd: free timer 2016-09-08 18:05:22 +04:00
sh4 Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
smbios ipmi: Add SMBIOS table entry 2016-06-24 05:13:57 +03:00
sparc trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
sparc64 util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
ssi ast2400: pretend DMAs are done for U-boot 2016-07-14 16:51:38 +01:00
timer trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
tpm Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
tricore hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
unicore32 hw: explicitly include qemu-common.h and cpu.h 2016-03-22 22:20:17 +01:00
usb usb-mtp: add support for files larger than 4g (gsoc) 2016-09-15 14:56:36 +01:00
vfio vfio/pci: Fix regression in MSI routing configuration 2016-09-15 10:41:36 -06:00
virtio vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
watchdog nmi: remove x86 specific nmi handling 2016-05-23 16:53:46 +02:00
xen Xen: fix converity warning of xen_pt_config_init() 2016-08-12 16:38:18 -07:00
xenpv xen: use a common function for pv and hvm guest backend register calls 2016-08-03 14:52:11 +02:00
xtensa target-xtensa: xtfpga: fix FLASH interface width 2016-07-14 13:59:44 +03:00
Makefile.objs Add a base IPMI interface 2015-12-22 18:39:19 +02:00