On 4 October 2011 14:47, Christian Borntraeger <borntrae...@de.ibm.com> wrote: > + * We can only deliver interrupts to (interrupt) enabled CPUs. > + * We dont call kvm_s390_add_running_cpu here, since CPUs in enabled wait > + * will wait inside the kernel (no exit). Therefore, the targeted > + * CPUs was neither disabled waiting or stopped for qemu.
Grammar nits, since I'm commenting anyway: "don't" "neither disabled waiting nor stopped" > @@ -425,16 +432,24 @@ static int handle_intercept(CPUState *en > r = handle_instruction(env, run); > break; > case ICPT_WAITPSW: > - /* XXX What to do on system shutdown? */ > + if (kvm_s390_del_running_cpu(env) == 0) { > + qemu_system_shutdown_request(); > + } > env->halted = 1; > env->exception_index = EXCP_HLT; > + r = EXCP_HALTED; > break; > case ICPT_SOFT_INTERCEPT: > fprintf(stderr, "KVM unimplemented icpt SOFT\n"); > exit(1); > break; > case ICPT_CPU_STOP: > - qemu_system_shutdown_request(); > + if (kvm_s390_del_running_cpu(env) == 0) { > + qemu_system_shutdown_request(); > + } > + env->halted = 1; > + env->exception_index = EXCP_HLT; > + r = EXCP_HALTED; > break; > case ICPT_IO: > fprintf(stderr, "KVM unimplemented icpt IO\n"); This makes the ICPT_CPU_STOP and ICPT_WAITPSW cases identical, right? You should just fold them together. -- PMM