On 02/06/16 19:00, Alex Bennée wrote: > Sergey Fedorov <serge.f...@gmail.com> writes: >> On 05/04/16 18:32, Alex Bennée wrote: >>> @@ -1179,6 +1198,14 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) >>> } >>> } >>> >>> + /* Set to kick if we have to do more than one vCPU */ >>> + if (CPU_NEXT(first_cpu)) { >>> + kick_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, kick_tcg_thread, >>> &kick_timer); >>> + timer_mod(kick_timer, >>> + qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + >>> + NANOSECONDS_PER_SECOND / 10); >>> + } >>> + >> I think cpu_ticks_init() could be more natural place to put this >> initialization in. > It would be but I need somewhere to keep kick_timer and doing it inside > the thread function keeps it nice and local.
Fair enough. By the way, this kick timer is only required for round-robin single-threaded CPU loop, right? Kind regards, Sergey