Patchwork [06/18] kvm: x86: Prepare kvm_get_mp_state for in-kernel irqchip

login
register
mail settings
Submitter Jan Kiszka
Date Jan. 21, 2011, 8:48 p.m.
Message ID <ffc65e4b81b4ad3ccab5dce6dc12d0c3bf706858.1295642900.git.jan.kiszka@web.de>
Download mbox | patch
Permalink /patch/79925/
State New
Headers show

Comments

Jan Kiszka - Jan. 21, 2011, 8:48 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

This code path will not yet be taken as we still lack in-kernel irqchip
support. But qemu-kvm can already make use of it and drop its own
mp_state access services.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 target-i386/kvm.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 9bb34ab..531b69e 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -1198,6 +1198,9 @@  static int kvm_get_mp_state(CPUState *env)
         return ret;
     }
     env->mp_state = mp_state.mp_state;
+    if (kvm_irqchip_in_kernel()) {
+        env->halted = (mp_state.mp_state == KVM_MP_STATE_HALTED);
+    }
     return 0;
 }