From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V99kD-000644-L8 for qemu-devel@nongnu.org; Tue, 13 Aug 2013 04:14:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V99k7-00048H-LM for qemu-devel@nongnu.org; Tue, 13 Aug 2013 04:14:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27615) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V99k7-000485-Bl for qemu-devel@nongnu.org; Tue, 13 Aug 2013 04:14:15 -0400 Date: Tue, 13 Aug 2013 10:14:11 +0200 From: Stefan Hajnoczi Message-ID: <20130813081411.GA4348@stefanha-thinkpad.redhat.com> References: <1376298489-13391-1-git-send-email-stefanha@redhat.com> <20130812091818.GA30401@redhat.com> <20130812141011.GA30712@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130812141011.GA30712@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-1.6] 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" Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel 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 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 > > >> Signed-off-by: Stefan Hajnoczi > > > > > > Good point > > > > > > Reviewed-by: Michael S. Tsirkin > > > > > > 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