[patch 4/6] kvm_init_vcpu requires global lock held

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

 



Since it accesses data protected by the lock.

Index: qemu-uq/vl.c
===================================================================
--- qemu-uq.orig/vl.c
+++ qemu-uq/vl.c
@@ -2447,6 +2447,7 @@ static void *kvm_cpu_thread_fn(void *arg
 {
     CPUState *env = arg;
 
+    qemu_mutex_lock(&qemu_global_mutex);
     qemu_thread_self(env->thread);
     if (kvm_enabled())
         kvm_init_vcpu(env);
@@ -2454,7 +2455,6 @@ static void *kvm_cpu_thread_fn(void *arg
     kvm_block_io_signals(env);
 
     /* signal CPU creation */
-    qemu_mutex_lock(&qemu_global_mutex);
     env->created = 1;
     qemu_cond_signal(&qemu_cpu_cond);
 


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux