From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQwjG-00007N-Ej for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:35:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQwjD-0000ee-4n for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:35:42 -0500 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:35675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQwjC-0000e8-RH for qemu-devel@nongnu.org; Thu, 26 Feb 2015 06:35:39 -0500 Received: by wggz12 with SMTP id z12so9831771wgg.2 for ; Thu, 26 Feb 2015 03:35:37 -0800 (PST) Sender: Paolo Bonzini Message-ID: <54EF0504.6070401@redhat.com> Date: Thu, 26 Feb 2015 12:35:32 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1424110682-14334-1-git-send-email-pbonzini@redhat.com> <1424110682-14334-9-git-send-email-pbonzini@redhat.com> <54EE0352.4020700@imgtec.com> In-Reply-To: <54EE0352.4020700@imgtec.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 08/21] rcu: run RCU callbacks under the BQL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Alrae , qemu-devel@nongnu.org On 25/02/2015 18:16, Leon Alrae wrote: > Hi, > > On 16/02/2015 18:17, Paolo Bonzini wrote: >> This needs to go away sooner or later, but one complication is the >> complex VFIO data structures that are modified in instance_finalize. >> Take a shortcut for now. > > It looks like this commit introduced a race condition. QEMU segfaults > very early in one of my tests where I boot Linux, and on one of my > machines it's easier to reproduce than on the others. This should be enough to fix it. If it works for you I'll send a pull request as soon as possible. diff --git a/cpus.c b/cpus.c index 1cd9867..7bed67b 100644 --- a/cpus.c +++ b/cpus.c @@ -1115,7 +1115,7 @@ bool qemu_in_vcpu_thread(void) void qemu_mutex_lock_iothread(void) { - if (!tcg_enabled()) { + if (!tcg_enabled() || !first_cpu) { qemu_mutex_lock(&qemu_global_mutex); } else { iothread_requesting_mutex = true; Paolo