Received: from eggs.gnu.org ([2001:4830:134:3::10]:60311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIGHV-0002St-AU for qemu-devel@nongnu.org; Wed, 29 Jun 2016 10:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bIGHQ-0003f3-Qp for qemu-devel@nongnu.org; Wed, 29 Jun 2016 10:15:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:12607 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bIGHQ-0003et-L6 for qemu-devel@nongnu.org; Wed, 29 Jun 2016 10:15:52 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u5TE4F77099058 for ; Wed, 29 Jun 2016 10:15:52 -0400 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 23utc95hg4-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 29 Jun 2016 10:15:52 -0400 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 Jun 2016 15:15:50 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8FAE8219005E for ; Wed, 29 Jun 2016 15:15:18 +0100 (BST) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u5TEFmiH5571036 for ; Wed, 29 Jun 2016 14:15:48 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u5TEFmtl002100 for ; Wed, 29 Jun 2016 08:15:48 -0600 Date: Wed, 29 Jun 2016 16:15:46 +0200 From: Cornelia Huck In-Reply-To: References: <1467202624-72941-1-git-send-email-cornelia.huck@de.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <20160629161546.21a2e268.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH] virtio: Fix setting up host notifiers for vhost List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau Cc: QEMU , "Michael S. Tsirkin" , Fam Zheng , Stefan Hajnoczi , Jason Wang , pl@kamp.de, Paolo Bonzini On Wed, 29 Jun 2016 14:23:42 +0200 Marc-Andr=C3=A9 Lureau wrote: > Hi >=20 > On Wed, Jun 29, 2016 at 2:17 PM, Cornelia Huck = wrote: > > When setting up host notifiers, virtio_bus_set_host_notifier() > > simply switches the handler. This will only work, however, if > > the ioeventfd has already been setup; this is true for dataplane, > > but not for vhost. > > > > Fix this by starting the ioeventfd if that has not happened > > before. > > > > While we're at it, also fixup the unsetting path of > > set_host_notifier_internal(). > > > > Fixes: 6798e245a3 ("virtio-bus: common ioeventfd infrastructure") > > Reported-by: Jason Wang > > Reported-by: Marc-Andr=C3=A9 Lureau > > Signed-off-by: Cornelia Huck > > --- > > > > This fixes the vhost regression for me, while dataplane continues > > to work. > > >=20 > That doesn't work here, > QTEST_QEMU_BINARY=3Dx86_64-softmmu/qemu-system-x86_64 tests/vhost-user-t= est >=20 > hangs in /x86_64/vhost-user/migrate I can reproduce it, but I have zero ideas on how to proceed. I can see that one of the qemus sits on event_notifier_test_and_clear when vhost tries to shut down. (I am thoroughly confused by all of that qtest setup, so I have no idea which qemu instance this is...) Looking at the code path, we really should switch the handler around, but virtio_queue_set_host_notifier_fd_handler always unsets the handler unless both assign and set_handler are true. Is that really what we want? I fear I have stared at this for so long that I have now lost myself between all these flags, so I hope one of the folks on cc: has a good idea...