From patchwork Fri May 27 12:19:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 823742 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4RCK4d6003906 for ; Fri, 27 May 2011 12:20:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754046Ab1E0MT4 (ORCPT ); Fri, 27 May 2011 08:19:56 -0400 Received: from thoth.sbs.de ([192.35.17.2]:17286 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753633Ab1E0MT3 (ORCPT ); Fri, 27 May 2011 08:19:29 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id p4RCJP7k012066; Fri, 27 May 2011 14:19:25 +0200 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p4RCJOKi005557; Fri, 27 May 2011 14:19:25 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org Subject: [PATCH 08/20] qemu-kvm: Replace kvm_update_interrupt_request with qemu_cpu_kick Date: Fri, 27 May 2011 14:19:12 +0200 Message-Id: <4f71a2111ae8c62ef042ec81563411789c00d7dc.1306498737.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 27 May 2011 12:20:04 +0000 (UTC) Activate the iothread version of qemu_cpu_kick. We just need to initialize the yet unused CPUState::halt_cond for it. This finally obsoletes kvm_update_interrupt_request, so drop it. Signed-off-by: Jan Kiszka --- cpus.c | 15 ++++----------- kvm-all.c | 1 - qemu-kvm.h | 1 - 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/cpus.c b/cpus.c index 152b596..2f72243 100644 --- a/cpus.c +++ b/cpus.c @@ -590,11 +590,11 @@ void resume_all_vcpus(void) void pause_all_vcpus(void) { } +#ifndef CONFIG_IOTHREAD void qemu_cpu_kick(void *env) { } -#ifndef CONFIG_IOTHREAD void qemu_cpu_kick_self(void) { @@ -879,7 +879,6 @@ static void qemu_cpu_kick_thread(CPUState *env) #endif } -#ifdef UNUSED_IOTHREAD_IMPL void qemu_cpu_kick(void *_env) { CPUState *env = _env; @@ -890,7 +889,6 @@ void qemu_cpu_kick(void *_env) env->thread_kicked = true; } } -#endif /* UNUSED_IOTHREAD_IMPL */ void qemu_cpu_kick_self(void) { @@ -1248,14 +1246,6 @@ void on_vcpu(CPUState *env, void (*func)(void *data), void *data) } } -void kvm_update_interrupt_request(CPUState *env) -{ - if (!qemu_cpu_is_self(env) && !env->thread_kicked) { - env->thread_kicked = true; - pthread_kill(env->thread->thread, SIG_IPI); - } -} - static int kvm_cpu_is_stopped(CPUState *env) { return !vm_running || env->stopped; @@ -1448,6 +1438,9 @@ static void *ap_main_loop(void *_env) current_env = env; env->thread_id = kvm_get_thread_id(); + env->halt_cond = qemu_mallocz(sizeof(QemuCond)); + qemu_cond_init(env->halt_cond); + qemu_mutex_lock(&qemu_global_mutex); if (kvm_create_vcpu(env) < 0) { diff --git a/kvm-all.c b/kvm-all.c index bd53422..8bef14a 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -703,7 +703,6 @@ static void kvm_handle_interrupt(CPUState *env, int mask) if (!qemu_cpu_is_self(env)) { qemu_cpu_kick(env); } - kvm_update_interrupt_request(env); } int kvm_init(void) diff --git a/qemu-kvm.h b/qemu-kvm.h index 0ebd3eb..20e24e7 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -275,7 +275,6 @@ void kvm_hpet_enable_kpit(void); void kvm_hpet_disable_kpit(void); void on_vcpu(CPUState *env, void (*func)(void *data), void *data); -void kvm_update_interrupt_request(CPUState *env); int kvm_set_boot_cpu_id(KVMState *s, uint32_t id);