[PATCH 08/20] qemu-kvm: Replace kvm_update_interrupt_request with qemu_cpu_kick

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jan.kiszka@xxxxxxxxxxx>
---
 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);
 
-- 
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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux