From f2c1cc81c8229e8c1e26aae517d32aa534936a0c Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Tue, 15 Mar 2011 12:26:18 +0100 Subject: [PATCH] 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 Signed-off-by: Marcelo Tosatti --- cpus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpus.c b/cpus.c index 975a6ce949..d310b7e3bd 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;