qemu-patch-raspberry4/hw/virtio
Paolo Bonzini 83d768b564 virtio: set ISR on dataplane notifications
Dataplane has been omitting forever the step of setting ISR when
an interrupt is raised.  This caused little breakage, because the
specification actually says that ISR may not be updated in MSI mode.

Some versions of the Windows drivers however didn't clear MSI mode
correctly, and proceeded using polling mode (using ISR, not the used
ring index!) for crashdump and hibernation.  If it were just crashdump
and hibernation it would not be a big deal, but recent releases of
Windows do not really shut down, but rather log out and hibernate to
make the next startup faster.  Hence, this manifested as a more serious
hang during shutdown with e.g. Windows 8.1 and virtio-win 1.8.0 RPMs.
Newer versions fixed this, while older versions do not use MSI at all.

The failure has always been there for virtio dataplane, but it became
visible after commits 9ffe337 ("virtio-blk: always use dataplane path
if ioeventfd is active", 2016-10-30) and ad07cd6 ("virtio-scsi: always
use dataplane path if ioeventfd is active", 2016-10-30) made virtio-blk
and virtio-scsi always use the dataplane code under KVM.  The good news
therefore is that it was not a bug in the patches---they were doing
exactly what they were meant for, i.e. shake out remaining dataplane bugs.

The fix is not hard, so it's worth arranging for the broken drivers.
The virtio_should_notify+event_notifier_set pair that is common to
virtio-blk and virtio-scsi dataplane is replaced with a new public
function virtio_notify_irqfd that also sets ISR.  The irqfd emulation
code now need not set ISR anymore, so virtio_irq is removed.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Tested-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Tested-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2016-11-18 17:29:25 +02:00
..
Makefile.objs virtio-crypto-pci: add virtio crypto pci support 2016-11-01 19:21:08 +02:00
trace-events virtio: set ISR on dataplane notifications 2016-11-18 17:29:25 +02:00
vhost-backend.c vhost-vsock: add virtio sockets device 2016-09-10 00:28:08 +03:00
vhost-user.c char: use qemu_chr_fe* functions with CharBackend argument 2016-10-24 15:27:21 +02:00
vhost-vsock.c virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
vhost.c virtio: introduce grab/release_ioeventfd to fix vhost 2016-11-18 17:29:25 +02:00
virtio-balloon.c virtio: rename virtqueue_discard to virtqueue_unpop 2016-11-15 17:20:36 +02:00
virtio-bus.c virtio: introduce grab/release_ioeventfd to fix vhost 2016-11-18 17:29:25 +02:00
virtio-crypto-pci.c virtio-crypto: tag as not hotpluggable and migration 2016-11-15 17:20:36 +02:00
virtio-crypto.c virtio-crypto: fix virtio_queue_set_notification() race 2016-11-18 17:14:10 +02:00
virtio-mmio.c virtio: access ISR atomically 2016-11-18 17:29:25 +02:00
virtio-pci.c virtio: access ISR atomically 2016-11-18 17:29:25 +02:00
virtio-pci.h virtio-crypto-pci: add virtio crypto pci support 2016-11-01 19:21:08 +02:00
virtio-rng.c virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
virtio.c virtio: set ISR on dataplane notifications 2016-11-18 17:29:25 +02:00