Patchwork s390x kvm and smp

login
register
mail settings
Submitter Christian Borntraeger
Date May 4, 2011, 10:43 a.m.
Message ID <4DC12DE4.80702@de.ibm.com>
Download mbox | patch
Permalink /patch/93999/
State New
Headers show

Comments

Christian Borntraeger - May 4, 2011, 10:43 a.m.
Alex,

I have trouble getting kvm smp support running. Turns out that 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 KVM_RUN. (these CPUs will be started by a SIGP
restart later during the boot process)

This patch seems to help (it allows me to boot and use more than 1 cpu)


but it does not look like the right solution. What are the proper
definitions for halted and stopped?

Christian
Jan Kiszka - May 4, 2011, 10:59 a.m.
On 2011-05-04 12:43, Christian Borntraeger wrote:
> Alex,
> 
> I have trouble getting kvm smp support running. Turns out that 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 KVM_RUN. (these CPUs will be started by a SIGP
> restart later during the boot process)
> 
> This patch seems to help (it allows me to boot and use more than 1 cpu)
> 
> --- a/cpus.c
> +++ b/cpus.c
> @@ -131,6 +131,10 @@ static void do_vm_stop(int reason)
>  
>  static int cpu_can_run(CPUState *env)
>  {
> +    if (env->halted) {
> +        return 0;
> +    }
> +
>      if (env->stop) {
>          return 0;
>      }
> 
> but it does not look like the right solution. What are the proper
> definitions for halted and stopped?

s390 just need to return a meaningful value from
kvm_arch_process_async_events, e.g. env->halted, see other archs.

Jan

Patch

--- a/cpus.c
+++ b/cpus.c
@@ -131,6 +131,10 @@  static void do_vm_stop(int reason)
 
 static int cpu_can_run(CPUState *env)
 {
+    if (env->halted) {
+        return 0;
+    }
+
     if (env->stop) {
         return 0;
     }