Otherwise cpu is always unhalted by call to kvm_arch_get_registers() Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx> --- qemu-kvm.c | 10 ++++++++++ qemu-kvm.h | 9 +-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/qemu-kvm.c b/qemu-kvm.c index 6511cb6..2a7fe3d 100644 --- a/qemu-kvm.c +++ b/qemu-kvm.c @@ -1605,6 +1605,16 @@ static void on_vcpu(CPUState *env, void (*func)(void *data), void *data) qemu_cond_wait(&qemu_work_cond); } +void kvm_arch_get_registers(CPUState *env) +{ + kvm_arch_save_regs(env); + kvm_arch_save_mpstate(env); +#ifdef KVM_CAP_MP_STATE + if (kvm_irqchip_in_kernel(kvm_context)) + env->halted = (env->mp_state == KVM_MP_STATE_HALTED); +#endif +} + static void do_kvm_cpu_synchronize_state(void *_env) { CPUState *env = _env; diff --git a/qemu-kvm.h b/qemu-kvm.h index b2c8c35..4523e25 100644 --- a/qemu-kvm.h +++ b/qemu-kvm.h @@ -1181,14 +1181,7 @@ static inline int kvm_sync_vcpus(void) } #ifndef QEMU_KVM_NO_CPU -static inline void kvm_arch_get_registers(CPUState *env) -{ - kvm_arch_save_regs(env); - kvm_arch_save_mpstate(env); -#ifdef KVM_CAP_MP_STATE - env->halted = (env->mp_state == KVM_MP_STATE_HALTED); -#endif -} +void kvm_arch_get_registers(CPUState *env); static inline void kvm_arch_put_registers(CPUState *env) { -- 1.6.3.3 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html