diff mbox

[22/35] kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle

Message ID 0f8f7e9e1fe974f90d6b4b79d8a4f4e3c1ecc6ba.1300225848.git.mtosatti@redhat.com
State New
Headers show

Commit Message

Marcelo Tosatti March 15, 2011, 9:50 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

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 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/cpus.c b/cpus.c
index 975a6ce..d310b7e 100644
--- 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;