qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH for-1.6] virtio: clear signalled_used_valid when switching from dataplane
Date: Tue, 13 Aug 2013 12:27:27 +0300	[thread overview]
Message-ID: <20130813092727.GB25004@redhat.com> (raw)
In-Reply-To: <20130813081411.GA4348@stefanha-thinkpad.redhat.com>

On Tue, Aug 13, 2013 at 10:14:11AM +0200, Stefan Hajnoczi wrote:
> On Mon, Aug 12, 2013 at 05:10:11PM +0300, Michael S. Tsirkin wrote:
> > On Mon, Aug 12, 2013 at 03:39:23PM +0200, Stefan Hajnoczi wrote:
> > > On Mon, Aug 12, 2013 at 11:18 AM, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > On Mon, Aug 12, 2013 at 11:08:09AM +0200, Stefan Hajnoczi wrote:
> > > >> 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>
> > > >
> > > > Good point
> > > >
> > > > Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> > > >
> > > > and we also need this for vhost.c right?
> > > 
> > > I think vhost is not affected by this because virtio.c clears the
> > > signalled_used_valid flag when the device is reset.  Since vhost_net
> > > does not transition back and forth between userspace virtio and vhost
> > > (without a device reset), there is no need to reset the flag.
> > > 
> > > Stefan
> > 
> > Yes it does transition on vm stop/start.
> 
> I see.  Come to think of it maybe dataplane could use virtio.c's vm
> change state handler instead of registering its own.  Anyway, thanks for
> pointing this out.
> 
> Stefan

It probably should esp if you have a handler for virtio status:
this is the only way to guarantee they are called in a sane order.

-- 
MST

  reply	other threads:[~2013-08-13  9:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12  9:08 [Qemu-devel] [PATCH for-1.6] virtio: clear signalled_used_valid when switching from dataplane Stefan Hajnoczi
2013-08-12  9:18 ` Michael S. Tsirkin
2013-08-12 13:39   ` Stefan Hajnoczi
2013-08-12 14:10     ` Michael S. Tsirkin
2013-08-13  8:14       ` Stefan Hajnoczi
2013-08-13  9:27         ` Michael S. Tsirkin [this message]
2013-08-12  9:52 ` Kevin Wolf

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=20130813092727.GB25004@redhat.com \
    --to=mst@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).