From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhHn-0005zc-Sk for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVhHi-000771-QH for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:06:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48020) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVhHi-00076d-Ib for qemu-devel@nongnu.org; Wed, 11 Mar 2015 10:06:54 -0400 Message-ID: <55004BF4.7090608@redhat.com> Date: Wed, 11 Mar 2015 15:06:44 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] rcu kicking CPU threads before they're set up... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , QEMU Developers On 11/03/2015 11:23, Peter Maydell wrote: > I noticed this while I was trying to debug something and so was > single stepping through the CPU realize function. > > The rcu thread seems to get set up and try to start working too > early in QEMU's initialization process. Specifically, it can try > to do things before we've completed the creation and init of all > the CPUs: I'm seeing call_rcu_thread() calling qemu_mutex_lock_iothread() > calling qemu_cpu_kick_thread() before we've even finished actually > creating and realizing the CPU objects. This segfaults because > cpu->thread isn't set yet. Should be fixed by now: commit 6b49809c597331803ea941eadda813e5bb4e8fe2 Author: Paolo Bonzini Date: Fri Feb 27 19:58:23 2015 +0100 cpus: fix deadlock and segfault in qemu_mutex_lock_iothread commit 21618b3e55ad2c6fede0bffcaea466091811ce59 Author: Paolo Bonzini Date: Fri Feb 27 20:01:03 2015 +0100 cpus: be more paranoid in avoiding deadlocks Paolo