From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7k4O-0005ty-WB for qemu-devel@nongnu.org; Fri, 18 Nov 2016 09:23:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7k4K-00079s-PA for qemu-devel@nongnu.org; Fri, 18 Nov 2016 09:23:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59300) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c7k4K-00079d-Ia for qemu-devel@nongnu.org; Fri, 18 Nov 2016 09:23:08 -0500 Date: Fri, 18 Nov 2016 16:23:06 +0200 From: "Michael S. Tsirkin" Message-ID: <20161118162253-mutt-send-email-mst@kernel.org> References: <20161116180551.9611-1-pbonzini@redhat.com> <20161116180551.9611-2-pbonzini@redhat.com> <32da704e-4472-2afa-109f-185575d9f39f@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <32da704e-4472-2afa-109f-185575d9f39f@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/3] virtio: introduce grab/release_ioeventfd to fix vhost List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christian Borntraeger Cc: Paolo Bonzini , qemu-devel@nongnu.org, alex.williamson@redhat.com, felipe@nutanix.com On Fri, Nov 18, 2016 at 09:15:32AM +0100, Christian Borntraeger wrote: > On 11/16/2016 07:05 PM, Paolo Bonzini wrote: > > Following the recent refactoring of virtio notifiers [1], more specifically > > the patch ed08a2a0b ("virtio: use virtio_bus_set_host_notifier to > > start/stop ioeventfd") that uses virtio_bus_set_host_notifier [2] > > by default, core virtio code requires 'ioeventfd_started' to be set > > to true/false when the host notifiers are configured. > > > > When vhost is stopped and started, however, there is a stop followed by > > another start. Since ioeventfd_started was never set to true, the 'stop' > > operation triggered by virtio_bus_set_host_notifier() will not result > > in a call to virtio_pci_ioeventfd_assign(assign=false). This leaves > > the memory regions with stale notifiers and results on the next start > > triggering the following assertion: > > > > kvm_mem_ioeventfd_add: error adding ioeventfd: File exists > > Aborted > > > > This patch reintroduces (hopefully in a cleaner way) the concept > > that was present with ioeventfd_disabled before the refactoring. > > When ioeventfd_grabbed>0, ioeventfd_started tracks whether ioeventfd > > should be enabled or not, but ioeventfd is actually not started at > > all until vhost releases the host notifiers. > > > > [1] http://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg07748.html > > [2] http://lists.nongnu.org/archive/html/qemu-devel/2016-10/msg07760.html > > > > Reported-by: Felipe Franciosi > > Reported-by: Christian Borntraeger > > Reported-by: Alex Williamson > > Fixes: ed08a2a0b ("virtio: use virtio_bus_set_host_notifier to start/stop ioeventfd") > > Signed-off-by: Paolo Bonzini > > Message-Id: <20161111192855.26350-1-pbonzini@redhat.com> > > Signed-off-by: Paolo Bonzini > > --- > > v1->v2: more comments [Cornelia] > > > As this seems to fix a functional issues, is there any chance to apply this > patch now and not wait for the discussion about patch 2 and 3 to calm down? It's in my tree, will be in the next pull.