Patchwork [04/15] kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle

login
register
mail settings
Submitter Jan Kiszka
Date March 4, 2011, 10:20 a.m.
Message ID <292b73d63764053717f57369633ed51fd944eb78.1299233998.git.jan.kiszka@siemens.com>
Download mbox | patch
Permalink /patch/85409/
State New
Headers show

Comments

Jan Kiszka - March 4, 2011, 10:20 a.m.
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>
---
 cpus.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/cpus.c b/cpus.c
index 0f33945..66f6b5a 100644
--- a/cpus.c
+++ b/cpus.c
@@ -147,7 +147,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;