All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane
Date: Tue, 13 Aug 2013 17:41:50 +0300	[thread overview]
Message-ID: <20130813144150.GA29482@redhat.com> (raw)
In-Reply-To: <20130813142639.15605.68796@loki>

On Tue, Aug 13, 2013 at 09:26:39AM -0500, Michael Roth wrote:
> Quoting Michael S. Tsirkin (2013-08-12 07:02:42)
> > From: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> > 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 <kwolf@redhat.com>
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Is this applicable for qemu-stable? It's a dependency of 4/4 of this series
> which I'm planning on pulling in.

Certainly does no harm there.

> > ---
> >  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 = idx;
> >  }
> > 
> > +void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n)
> > +{
> > +    vdev->vq[n].signalled_used_valid = 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

  reply	other threads:[~2013-08-13 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 12:02 [Qemu-devel] [PULL for-1.6 0/4] pci,virtio fixes for 1.6 Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 1/4] pc: disable pci-info " Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 2/4] i82801b11: Fix i82801b11 PCI host bridge config space Michael S. Tsirkin
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 3/4] virtio: clear signalled_used_valid when switching from dataplane Michael S. Tsirkin
2013-08-13 14:26   ` Michael Roth
2013-08-13 14:41     ` Michael S. Tsirkin [this message]
2013-08-12 12:02 ` [Qemu-devel] [PULL for-1.6 4/4] vhost: clear signalled_used_valid on vhost stop Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130813144150.GA29482@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.