Patchwork s390x: fix smp support for kvm

login
register
mail settings
Submitter Christian Borntraeger
Date May 5, 2011, 7:29 a.m.
Message ID <4DC251F5.1000204@de.ibm.com>
Download mbox | patch
Permalink /patch/94206/
State New
Headers show

Comments

Christian Borntraeger - May 5, 2011, 7:29 a.m.
Currently smp support for kvm does not work. Qemu does a kvm run even on
secondary CPUs which dont have a sane state (initial psw == 0)
triggering some program faults. Architecturally these cpus are in the stopped
state, so we should not do the kvm run ioctl. (these CPUs will be started
by a SIGP restart later during the boot process)

We need to tell the loop that this cpu should not run. Jan Kiszka pointed
out that kvm_arch_process_async_events is the right place to do.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>

Patch

--- a/target-s390x/kvm.c
+++ b/target-s390x/kvm.c
@@ -172,7 +172,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;
 }
 
 void kvm_s390_interrupt_internal(CPUState *env, int type, uint32_t parm,