qemu/hw/block
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
..
dataplane virtio: set ISR on dataplane notifications 2016-11-18 17:29:25 +02:00
block.c block/qdev: Allow configuring rerror/werror with qdev properties 2016-07-13 13:32:27 +02:00
cdrom.c block: Clean up includes 2016-01-20 13:36:23 +01:00
ecc.c block: Clean up includes 2016-01-20 13:36:23 +01:00
fdc.c fdc: Move qdev properties to FloppyDrive 2016-10-27 16:29:13 -04:00
hd-geometry.c qemu-common: stop including qemu/bswap.h from qemu-common.h 2016-05-19 16:42:28 +02:00
m25p80.c block: m25p80: Fix vmstate structure name 2016-09-06 19:52:18 +01:00
Makefile.objs block: Always compile virtio-blk dataplane 2014-09-22 11:39:51 +01:00
nand.c nand: Switch to byte-based block access 2016-05-12 15:22:09 +02:00
nvme.c hw/block/nvme: Simplify if-statements a little bit 2016-10-28 18:17:23 +03:00
nvme.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
onenand.c onenand: Switch to byte-based block access 2016-05-12 15:22:09 +02:00
pflash_cfi01.c pflash: make TYPE_CFI_PFLASH0{1,2} macros public 2016-06-29 14:03:46 +02:00
pflash_cfi02.c pflash: make TYPE_CFI_PFLASH0{1,2} macros public 2016-06-29 14:03:46 +02:00
tc58128.c block: Use DIV_ROUND_UP 2016-06-07 18:19:24 +03:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
virtio-blk.c virtio-blk: always use dataplane path if ioeventfd is active 2016-10-30 19:51:32 +02:00
xen_blkif.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
xen_disk.c xen: Rename xen_be_send_notify 2016-10-28 17:54:21 -07:00