From 8a83632bef178b0d83ea883db58584a25132751b Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 27 May 2011 14:19:11 +0200 Subject: [PATCH] qemu-kvm: Clean up kvm_update_interrupt_request 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 Signed-off-by: Marcelo Tosatti --- cpus.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/cpus.c b/cpus.c index bf666b0e92..152b596778 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); } } -- 2.11.4.GIT