From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9FYh-00035K-Ll for qemu-devel@nongnu.org; Tue, 13 Aug 2013 10:27:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V9FYZ-0002HL-7G for qemu-devel@nongnu.org; Tue, 13 Aug 2013 10:26:51 -0400 Received: from mail-oa0-x22c.google.com ([2607:f8b0:4003:c02::22c]:44764) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V9FYZ-0002H7-2N for qemu-devel@nongnu.org; Tue, 13 Aug 2013 10:26:43 -0400 Received: by mail-oa0-f44.google.com with SMTP id l20so11370035oag.17 for ; Tue, 13 Aug 2013 07:26:42 -0700 (PDT) Sender: fluxion Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Michael Roth In-Reply-To: <1376308831-19978-4-git-send-email-mst@redhat.com> References: <1376308831-19978-1-git-send-email-mst@redhat.com> <1376308831-19978-4-git-send-email-mst@redhat.com> Message-ID: <20130813142639.15605.68796@loki> Date: Tue, 13 Aug 2013 09:26:39 -0500 Subject: Re: [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , qemu-devel@nongnu.org Cc: Anthony Liguori , Stefan Hajnoczi Quoting Michael S. Tsirkin (2013-08-12 07:02:42) > From: Stefan Hajnoczi > = > When the dataplane thread stops, its vring.c implementation synchronizes > vring state back to virtio.c so we can continue emulating the virtio > device. > = > This patch ensures that virtio.c's signalled_used_valid flag is reset so > that we do not suppress guest notifications due to stale signalled_used > values. > = > Suggested-by: Kevin Wolf > Signed-off-by: Stefan Hajnoczi > Signed-off-by: Michael S. Tsirkin Is this applicable for qemu-stable? It's a dependency of 4/4 of this series which I'm planning on pulling in. > --- > hw/virtio/dataplane/vring.c | 1 + > hw/virtio/virtio.c | 5 +++++ > include/hw/virtio/virtio.h | 1 + > 3 files changed, 7 insertions(+) > = > diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c > index 82cc151..351a343 100644 > --- a/hw/virtio/dataplane/vring.c > +++ b/hw/virtio/dataplane/vring.c > @@ -52,6 +52,7 @@ bool vring_setup(Vring *vring, VirtIODevice *vdev, int = n) > void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) > { > virtio_queue_set_last_avail_idx(vdev, n, vring->last_avail_idx); > + virtio_queue_invalidate_signalled_used(vdev, n); > = > hostmem_finalize(&vring->hostmem); > } > diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c > index 09f62c6..706bdf4 100644 > --- a/hw/virtio/virtio.c > +++ b/hw/virtio/virtio.c > @@ -1059,6 +1059,11 @@ void virtio_queue_set_last_avail_idx(VirtIODevice = *vdev, int n, uint16_t idx) > vdev->vq[n].last_avail_idx =3D idx; > } > = > +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n) > +{ > + vdev->vq[n].signalled_used_valid =3D false; > +} > + > VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n) > { > return vdev->vq + n; > diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h > index d7e9e0f..a90522d 100644 > --- a/include/hw/virtio/virtio.h > +++ b/include/hw/virtio/virtio.h > @@ -237,6 +237,7 @@ hwaddr virtio_queue_get_used_size(VirtIODevice *vdev,= int n); > hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n); > uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n); > void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t= idx); > +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n); > VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n); > uint16_t virtio_get_queue_index(VirtQueue *vq); > int virtio_queue_get_id(VirtQueue *vq); > -- = > MST