Skip to content

Commit

Permalink
cpus: CPU threads are always created initially for one CPU only
Browse files Browse the repository at this point in the history
It can never happen for single-threaded TCG that we have more than one
CPU in the list, while the first one has not been marked as "created".

Signed-off-by: David Hildenbrand <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
davidhildenbrand authored and bonzini committed Mar 6, 2018
1 parent 81e9631 commit 5a9c973
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1383,11 +1383,9 @@ static void *qemu_tcg_rr_cpu_thread_fn(void *arg)
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);

CPU_FOREACH(cpu) {
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
cpu->can_do_io = 1;
}
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
cpu->can_do_io = 1;
qemu_cond_signal(&qemu_cpu_cond);

/* wait for initial kick-off after machine start */
Expand Down

0 comments on commit 5a9c973

Please sign in to comment.