qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Bug ?]Qemu segfault because of non-initial kvm_state v


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [Bug ?]Qemu segfault because of non-initial kvm_state variable
Date: Tue, 03 Mar 2015 11:27:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 03/03/2015 11:11, Paolo Bonzini wrote:
> 
> 
> On 03/03/2015 09:01, Gonglei (Arei) wrote:
>> Hi,
>>
>> I encountered a Qemu segfault problem in my environment. 
>>
>> # ./qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name redhat6.2 -drive 
>> file=/home/win2008_ent_r2_64_01,\
>>  if=none,id=drive-ide0-0-0 -device 
>> ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -vnc :10 
>> Segmentation fault

... and here's the right fix:

------------------- 8< ---------------------------
From: Paolo Bonzini <address@hidden>
Subject: [PATCH] vl: take iothread lock very early

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 <address@hidden>

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();



reply via email to

[Prev in Thread] Current Thread [Next in Thread]