Most tests in kvm_update_interrupt_request are unneeded today: - env argument is always non-NULL (caller references it as well) - current_env must have been created when we get here - env->thread can't be zero (initialized early during cpu creation) So simply avoid self signaling and multiple kicks, drop the rest. Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx> --- cpus.c | 23 +++-------------------- 1 files changed, 3 insertions(+), 20 deletions(-) diff --git a/cpus.c b/cpus.c index bf666b0..152b596 100644 --- a/cpus.c +++ b/cpus.c @@ -1250,26 +1250,9 @@ void on_vcpu(CPUState *env, void (*func)(void *data), void *data) void kvm_update_interrupt_request(CPUState *env) { - int signal = 0; - - if (env) { - if (!current_env || !current_env->created) { - signal = 1; - } - /* - * Testing for created here is really redundant - */ - if (current_env && current_env->created && - env != current_env && !env->thread_kicked) { - signal = 1; - } - - if (signal) { - env->thread_kicked = true; - if (env->thread) { - pthread_kill(env->thread->thread, SIG_IPI); - } - } + if (!qemu_cpu_is_self(env) && !env->thread_kicked) { + env->thread_kicked = true; + pthread_kill(env->thread->thread, SIG_IPI); } } -- 1.7.1 -- 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