From: Gleb Natapov <g...@redhat.com>

Otherwise cpu is always unhalted by call to kvm_arch_get_registers().

Signed-off-by: Gleb Natapov <g...@redhat.com>
Signed-off-by: Avi Kivity <a...@redhat.com>

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)
 {
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to