Received: from eggs.gnu.org ([2001:4830:134:3::10]:36600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cUJxM-00007w-13 for qemu-devel@nongnu.org; Thu, 19 Jan 2017 16:09:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cUJxL-0007gB-4a for qemu-devel@nongnu.org; Thu, 19 Jan 2017 16:09:15 -0500 Received: from mail.kernel.org ([198.145.29.136]:56540) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cUJxK-0007ey-Tj for qemu-devel@nongnu.org; Thu, 19 Jan 2017 16:09:15 -0500 Date: Thu, 19 Jan 2017 23:09:10 +0200 From: "Michael S. Tsirkin" Message-ID: <1484860116-25361-4-git-send-email-mst@redhat.com> References: <1484860116-25361-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1484860116-25361-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 03/17] virtio: disable notifications again after poll succeeded List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Stefan Hajnoczi , Richard Henderson , Laszlo Ersek From: Stefan Hajnoczi 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 Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Tested-by: Richard Henderson Tested-by: Laszlo Ersek Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/virtio/virtio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index f04ab7a..34065c7 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -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; } -- MST