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

login
register
mail settings
Submitter Marcelo Tosatti
Date March 15, 2011, 9:50 p.m.
Message ID <0f8f7e9e1fe974f90d6b4b79d8a4f4e3c1ecc6ba.1300225848.git.mtosatti@redhat.com>
Download mbox | patch
Permalink /patch/87097/
State New
Headers show

Comments

Marcelo Tosatti - March 15, 2011, 9:50 p.m.
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(-)

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;