virtio: disable notifications again after poll succeeded
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 12 Jan 2017 11:46:11 +0000 (11:46 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 18 Jan 2017 20:59:53 +0000 (22:59 +0200)
While AioContext is in polling mode virtqueue notifications are not
necessary.  Some device virtqueue handlers enable notifications.  Make
sure they stay disabled to avoid unnecessary vmexits.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Richard Henderson <rth@twiddle.net>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio.c

index f04ab7aa6d6889ca2ecf14612fd48ef74c99d539..34065c78f83599aa00f67a0c7fc52ea859b9dbe8 100644 (file)
@@ -2126,6 +2126,9 @@ static bool virtio_queue_host_notifier_aio_poll(void *opaque)
     }
 
     virtio_queue_notify_aio_vq(vq);
+
+    /* In case the handler function re-enabled notifications */
+    virtio_queue_set_notification(vq, 0);
     return true;
 }