aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-03-15 12:26:18 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2011-03-16 17:11:05 -0300
commitf2c1cc81c8229e8c1e26aae517d32aa534936a0c (patch)
tree64dc4e0eca74c41873a55d466e6358baa94e07ae /cpus.c
parentfd28aa132362320f9f3a30b23f634bb14dee528e (diff)
downloadqemu-f2c1cc81c8229e8c1e26aae517d32aa534936a0c.zip
qemu-f2c1cc81c8229e8c1e26aae517d32aa534936a0c.tar.gz
qemu-f2c1cc81c8229e8c1e26aae517d32aa534936a0c.tar.bz2
kvm: Add in-kernel irqchip awareness to cpu_thread_is_idle
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>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c3
1 files changed, 2 insertions, 1 deletions
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;