[3/7] update halted state on mp_state sync

Submitted by Glauber Costa on Nov. 26, 2009, 5:24 p.m.

Details

Message ID 1259256300-23937-4-git-send-email-glommer@redhat.com
State New
Headers show

Commit Message

Glauber Costa Nov. 26, 2009, 5:24 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 hide | download patch | download mbox

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;
 }