kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Update halted state from mpstate only in case of inkernel irq chip
@ 2009-09-22 14:51 Gleb Natapov
  2009-09-22 14:51 ` [PATCH] Don't call kvm_cpu_synchronize_state() if there is no irqchip events to process Gleb Natapov
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Gleb Natapov @ 2009-09-22 14:51 UTC (permalink / raw)
  To: avi; +Cc: kvm

Otherwise cpu is always unhalted by call to kvm_arch_get_registers()

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-09-25 15:04 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-22 14:51 [PATCH] Update halted state from mpstate only in case of inkernel irq chip Gleb Natapov
2009-09-22 14:51 ` [PATCH] Don't call kvm_cpu_synchronize_state() if there is no irqchip events to process Gleb Natapov
2009-09-23  9:00   ` Avi Kivity
2009-09-22 14:51 ` [PATCH] Don't call cpu_synchronize_state() in apic_init_reset() Gleb Natapov
2009-09-23  9:00   ` Avi Kivity
2009-09-23 15:07     ` Jan Kiszka
2009-09-23 15:17       ` Avi Kivity
2009-09-23 15:45         ` Jan Kiszka
2009-09-24  7:53           ` Avi Kivity
2009-09-24  8:03             ` Gleb Natapov
2009-09-24  8:15               ` Jan Kiszka
2009-09-24  8:30                 ` Gleb Natapov
2009-09-24  8:59                   ` Jan Kiszka
2009-09-24  9:11                     ` Gleb Natapov
2009-09-25 15:03                       ` Jan Kiszka
2009-09-24  8:24               ` Avi Kivity
2009-09-23  9:00 ` [PATCH] Update halted state from mpstate only in case of inkernel irq chip Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).