From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSpIU-0004Tr-Bo for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:03:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSpIN-0000Wx-IR for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:03:50 -0500 Received: from mail-2.de-punkt.de ([93.190.64.238]:40490 helo=mail-99.de-punkt.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSpIN-0000Vn-6i for qemu-devel@nongnu.org; Tue, 03 Mar 2015 11:03:43 -0500 Received: from localhost (localhost [127.0.0.1]) by mail-99.de-punkt.de (Postfix) with ESMTP id 01E9C3A2E3 for ; Tue, 3 Mar 2015 17:03:40 +0100 (CET) Received: from mail-99.de-punkt.de ([127.0.0.1]) by localhost (mail-2.de-punkt.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id C6M2ESFMRfe4 for ; Tue, 3 Mar 2015 17:03:39 +0100 (CET) Received: from [192.168.1.152] (92.39.19.242.fixip.bitel.net [92.39.19.242]) (Authenticated sender: oliver.francke@filoo.de) by mail-99.de-punkt.de (Postfix) with ESMTPSA id B92943A2D7 for ; Tue, 3 Mar 2015 17:03:39 +0100 (CET) Message-ID: <54F5DB5B.4070506@filoo.de> Date: Tue, 03 Mar 2015 17:03:39 +0100 From: Oliver Francke MIME-Version: 1.0 References: <1425378969-9677-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <1425378969-9677-1-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] vl: take iothread lock very early List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, just brief, this small one breaks my qemu-system-x86_64 with: qemu: qemu_cond_wait: Operation not permitted My most complete qemu-starter: /usr/local/qemu-2.3.0/bin/qemu-system-x86_64 -daemonize -usbdevice=20 tablet -enable-kvm -pidfile /var/run/qemu-server/3371.pid -monitor=20 unix:/var/run/qemu-server/3371.mon,server,nowait -vnc=20 unix:/var/run/qemu-server/3371.vnc,password -qmp=20 unix:/var/run/qemu-server/3371.qmp,server,nowait -nodefaults -serial=20 none -parallel none -device rtl8139,mac=3D00:F1:70:00:D2:B0,netdev=3Dvlan= 0d0=20 -netdev=20 type=3Dtap,id=3Dvlan0d0,ifname=3Dtap3371i0d0,script=3D/etc/fcms/add_if.sh= ,downscript=3D/etc/fcms/downscript.sh=20 -name 1155823384-7 -vga cirrus -k de -smp sockets=3D1,cores=3D1 -m 512=20 -device virtio-blk-pci,drive=3Dvirtio0 -drive=20 format=3Draw,file=3Drbd:4/vm-3371-disk-1.rbd:rbd_cache=3Dtrue:rbd_cache_s= ize=3D16777216:rbd_cache_max_dirty=3D12582912:rbd_cache_target_dirty=3D83= 88608,cache=3Dwriteback,if=3Dnone,id=3Dvirtio0,media=3Ddisk,index=3D0=20 -drive=20 format=3Draw,file=3Drbd:4/vm-3371-swap-1.rbd:rbd_cache=3Dtrue:rbd_cache_s= ize=3D16777216:rbd_cache_max_dirty=3D12582912:rbd_cache_target_dirty=3D83= 88608,cache=3Dwriteback,if=3Dvirtio,media=3Ddisk,index=3D1=20 -drive if=3Dide,media=3Dcdrom,id=3Dide1-cd0,readonly=3Don -drive=20 if=3Dide,media=3Dcdrom,id=3Dide1-cd1,readonly=3Don -boot order=3Ddc Up to the former commit everything works well as expected. Hope it helps, Oliver. On 03/03/2015 11:36 AM, Paolo Bonzini wrote: > If the iothread lock isn't taken by the main thread, the RCU callbacks > might run concurrently with the main thread. QEMU's not ready for that= . > > Signed-off-by: Paolo Bonzini > --- > vl.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/vl.c b/vl.c > index 09693f5..d743727 100644 > --- a/vl.c > +++ b/vl.c > @@ -2763,6 +2763,9 @@ int main(int argc, char **argv, char **envp) > FILE *vmstate_dump_file =3D NULL; > Error *main_loop_err =3D NULL; > =20 > + qemu_init_cpu_loop(); > + qemu_mutex_lock_iothread(); > + > atexit(qemu_run_exit_notifiers); > error_set_progname(argv[0]); > qemu_init_exec_dir(argv[0]); > @@ -4098,9 +4101,6 @@ int main(int argc, char **argv, char **envp) > =20 > os_set_line_buffering(); > =20 > - qemu_init_cpu_loop(); > - qemu_mutex_lock_iothread(); > - > #ifdef CONFIG_SPICE > /* spice needs the timers to be initialized by this point */ > qemu_spice_init(); --=20 Oliver Francke filoo GmbH Moltkestra=DFe 25a 33330 G=FCtersloh HRB4355 AG G=FCtersloh Gesch=E4ftsf=FChrer: J.Rehp=F6hler | C.Kunz Folgen Sie uns auf Twitter: http://twitter.com/filoogmbh