]> xenbits.xensource.com Git - people/iwj/qemu.git/commitdiff
cpus: properly inititalize CPU > 1 under single-threaded TCG
authorDavid Hildenbrand <david@redhat.com>
Fri, 9 Feb 2018 19:52:37 +0000 (20:52 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 6 Mar 2018 13:00:59 +0000 (14:00 +0100)
All but the first CPU are currently not fully inititalized (e.g.
cpu->created is never set).

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20180209195239.16048-2-david@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpus.c

diff --git a/cpus.c b/cpus.c
index 4f5f88edba9ebaf7fe4ce7c8efe4b3dd3f1f051c..970390b8a9414c04b6ee72f885d4da9dd00b2d9c 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -1863,6 +1863,9 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
         /* For non-MTTCG cases we share the thread */
         cpu->thread = single_tcg_cpu_thread;
         cpu->halt_cond = single_tcg_halt_cond;
+        cpu->thread_id = first_cpu->thread_id;
+        cpu->can_do_io = 1;
+        cpu->created = true;
     }
 }