]> git.proxmox.com Git - qemu.git/commitdiff
kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 15 Mar 2011 11:26:18 +0000 (12:26 +0100)
committerMarcelo Tosatti <mtosatti@redhat.com>
Wed, 16 Mar 2011 20:11:05 +0000 (17:11 -0300)
With in-kernel irqchip support enabled, the vcpu threads sleep in kernel
space while halted. Account for this difference in cpu_thread_is_idle.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
cpus.c

diff --git a/cpus.c b/cpus.c
index 975a6ce9491c5531aa51ab6b2ce98f840bbbb45a..d310b7e3bd6391ccbd7be3f07dc0bade4c47775f 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -148,7 +148,8 @@ static bool cpu_thread_is_idle(CPUState *env)
     if (env->stopped || !vm_running) {
         return true;
     }
-    if (!env->halted || qemu_cpu_has_work(env)) {
+    if (!env->halted || qemu_cpu_has_work(env) ||
+        (kvm_enabled() && kvm_irqchip_in_kernel())) {
         return false;
     }
     return true;