Patchwork [v2,03/11] update halted state on mp_state sync

login
register
mail settings
Submitter Glauber Costa
Date Dec. 1, 2009, 12:51 p.m.
Message ID <1259671897-22232-4-git-send-email-glommer@redhat.com>
Download mbox | patch
Permalink /patch/39900/
State New
Headers show

Comments

Glauber Costa - Dec. 1, 2009, 12:51 p.m.
If we are using in-kernel irqchip, halted state belongs in the kernel.
So everytime we grab kernel's idea of mpstate, we also need to propagate
halted state to userspace.

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 target-i386/kvm.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Patch

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 78f6d65..1c4f660 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -825,6 +825,11 @@  static int kvm_get_mp_state(CPUState *env)
         return ret;
     }
     env->mp_state = mp_state.mp_state;
+
+    if (kvm_irqchip_in_kernel()) {
+        env->halted = (env->mp_state == KVM_MP_STATE_HALTED);
+    }
+
     return 0;
 }