From patchwork Mon Aug 12 12:02:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 266509 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (unknown [IPv6:2001:4830:134:3::12]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 7FC2B2C00D9 for ; Mon, 12 Aug 2013 22:09:56 +1000 (EST) Received: from localhost ([::1]:38802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8qwc-000579-2g for incoming@patchwork.ozlabs.org; Mon, 12 Aug 2013 08:09:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8qw5-0004vh-Ab for qemu-devel@nongnu.org; Mon, 12 Aug 2013 08:09:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8qvz-0003bo-0B for qemu-devel@nongnu.org; Mon, 12 Aug 2013 08:09:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36640) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8qoB-0000Vc-Lg; Mon, 12 Aug 2013 08:01:11 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7CC192f016739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Aug 2013 08:01:09 -0400 Received: from redhat.com (vpn1-6-118.ams2.redhat.com [10.36.6.118]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r7CC17uU014241; Mon, 12 Aug 2013 08:01:08 -0400 Date: Mon, 12 Aug 2013 15:02:46 +0300 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1376308831-19978-5-git-send-email-mst@redhat.com> References: <1376308831-19978-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1376308831-19978-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-stable@nongnu.org Subject: [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org When vhost device stops, its implementation synchronizes kernel state back to virtio.c so we can continue emulating the device in userspace. This patch ensures that virtio.c's signalled_used_valid flag is reset so that userspace does not suppress guest notifications due to stale signalled_used values. Cc: qemu-stable@nongnu.org Signed-off-by: Michael S. Tsirkin --- hw/virtio/vhost.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 8f6ab13..9e336ad 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -762,6 +762,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev, fflush(stderr); } virtio_queue_set_last_avail_idx(vdev, idx, state.num); + virtio_queue_invalidate_signalled_used(vdev, idx); assert (r >= 0); cpu_physical_memory_unmap(vq->ring, virtio_queue_get_ring_size(vdev, idx), 0, virtio_queue_get_ring_size(vdev, idx));