diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-06-15 16:23:11 +0300 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-15 16:49:52 +0300 |
commit | 90d9609bebb6af5bfcf3cf1dd1e169c3e964e2c7 (patch) | |
tree | 25a0e75dea05831b2d0f8f0a7d131608a0941882 /qemu-kvm.c | |
parent | Drop unnecessary check of kvm_cpu_state.init (diff) | |
download | qemu-kvm-90d9609bebb6af5bfcf3cf1dd1e169c3e964e2c7.tar.gz qemu-kvm-90d9609bebb6af5bfcf3cf1dd1e169c3e964e2c7.tar.bz2 qemu-kvm-90d9609bebb6af5bfcf3cf1dd1e169c3e964e2c7.zip |
Do not use env->halted to decide where halted state should be handled
Use kvm_irqchip_in_kernel() for that. If irq chip is not handled by
userspace kernel should be entered even when CPU is halted.
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'qemu-kvm.c')
-rw-r--r-- | qemu-kvm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qemu-kvm.c b/qemu-kvm.c index 9dc0a01e6..59de374f3 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1725,6 +1725,8 @@ static int has_work(CPUState *env) { if (!vm_running || (env && env->kvm_cpu_state.stopped)) return 0; + if (kvm_irqchip_in_kernel(kvm_context)) + return 1; if (!env->halted) return 1; return kvm_arch_has_work(env); @@ -1898,8 +1900,6 @@ static int kvm_main_loop_cpu(CPUState *env) setup_kernel_sigmask(env); pthread_mutex_lock(&qemu_mutex); - if (kvm_irqchip_in_kernel(kvm_context)) - env->halted = 0; kvm_qemu_init_env(env); #ifdef TARGET_I386 @@ -1920,7 +1920,7 @@ static int kvm_main_loop_cpu(CPUState *env) if (env->kvm_cpu_state.sipi_needed) update_regs_for_sipi(env); } - if (!env->halted) + if (!env->halted || kvm_irqchip_in_kernel(kvm_context)) kvm_cpu_exec(env); env->exit_request = 0; env->exception_index = EXCP_INTERRUPT; |