Patchwork [03/10] kvm-ppc: halt secondary cpus when guest reset

login
register
mail settings
Submitter Alexander Graf
Date Jan. 3, 2012, 3:08 p.m.
Message ID <1325603302-12412-4-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/134018/
State New
Headers show

Comments

Alexander Graf - Jan. 3, 2012, 3:08 p.m.
From: Liu Yu-B13201 <Yu.Liu@freescale.com>

When guest reset, we need to halt secondary cpus until guest kick them.
This already works for tcg. The patch add the support for kvm.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
[agraf: remove in-kernel irqchip code]
---
 hw/ppce500_spin.c |    1 +
 target-ppc/kvm.c  |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/ppce500_spin.c b/hw/ppce500_spin.c
index df74953..e7b1453 100644
--- a/hw/ppce500_spin.c
+++ b/hw/ppce500_spin.c
@@ -112,6 +112,7 @@  static void spin_kick(void *data)
 
     env->halted = 0;
     env->exception_index = -1;
+    env->stopped = 0;
     qemu_cpu_kick(env);
 }
 
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index 429349f..9b2e605 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -504,7 +504,7 @@  void kvm_arch_post_run(CPUState *env, struct kvm_run *run)
 
 int kvm_arch_process_async_events(CPUState *env)
 {
-    return 0;
+    return env->halted;
 }
 
 static int kvmppc_handle_halt(CPUState *env)