From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46301) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSkBZ-0000Ja-Qk for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:36:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YSkBV-0006Q0-Bx for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:36:21 -0500 Received: from mail-we0-x234.google.com ([2a00:1450:400c:c03::234]:41701) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YSkBU-0006Pg-T0 for qemu-devel@nongnu.org; Tue, 03 Mar 2015 05:36:17 -0500 Received: by wevm14 with SMTP id m14so38902937wev.8 for ; Tue, 03 Mar 2015 02:36:16 -0800 (PST) Received: from localhost.localdomain (net-37-116-207-136.cust.vodafonedsl.it. [37.116.207.136]) by mx.google.com with ESMTPSA id hl8sm668296wjb.38.2015.03.03.02.36.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2015 02:36:15 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 3 Mar 2015 11:36:09 +0100 Message-Id: <1425378969-9677-1-git-send-email-pbonzini@redhat.com> Subject: [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 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 = NULL; Error *main_loop_err = NULL; + 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) os_set_line_buffering(); - qemu_init_cpu_loop(); - qemu_mutex_lock_iothread(); - #ifdef CONFIG_SPICE /* spice needs the timers to be initialized by this point */ qemu_spice_init(); -- 2.3.0