]> git.proxmox.com Git - mirror_qemu.git/blobdiff - cpus.c
apic_common: improve readability of apic_reset_common
[mirror_qemu.git] / cpus.c
diff --git a/cpus.c b/cpus.c
index 1ce90a12e8fc99c5b6a460bddcce8fcb42c6d784..e6dcae31f5ad0c058195399eac5084c2a12874d1 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -1119,7 +1119,7 @@ bool qemu_in_vcpu_thread(void)
 void qemu_mutex_lock_iothread(void)
 {
     atomic_inc(&iothread_requesting_mutex);
-    if (!tcg_enabled() || !first_cpu) {
+    if (!tcg_enabled() || !first_cpu || !first_cpu->thread) {
         qemu_mutex_lock(&qemu_global_mutex);
         atomic_dec(&iothread_requesting_mutex);
     } else {
@@ -1353,7 +1353,7 @@ static int tcg_cpu_exec(CPUArchState *env)
     }
     ret = cpu_exec(env);
 #ifdef CONFIG_PROFILER
-    qemu_time += profile_getclock() - ti;
+    tcg_time += profile_getclock() - ti;
 #endif
     if (use_icount) {
         /* Fold pending instructions back into the