]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
S390: dont call system_shutdown on disabled wait
authorChristian Borntraeger <borntraeger@de.ibm.com>
Sun, 22 Apr 2012 23:52:25 +0000 (23:52 +0000)
committerAlexander Graf <agraf@suse.de>
Tue, 1 May 2012 19:04:06 +0000 (21:04 +0200)
A disabled wait usually indicates a guest problem. Dont shutdown the
guest to allow guest dumping.
Have some special cases, e.g. a quiesce disabled wait. In that case
we want to shutdown.

Long term solution might be a crashed/panic indication.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
target-s390x/kvm.c

index 956730d6384c9f51e495012959e2e5ab8f7e52c4..90aad61eb09de6b87118e24aa2299324e9b50787 100644 (file)
@@ -407,6 +407,12 @@ static int handle_instruction(CPUS390XState *env, struct kvm_run *run)
     return 0;
 }
 
+static bool is_special_wait_psw(CPUS390XState *env)
+{
+    /* signal quiesce */
+    return env->kvm_run->psw_addr == 0xfffUL;
+}
+
 static int handle_intercept(CPUS390XState *env)
 {
     struct kvm_run *run = env->kvm_run;
@@ -420,6 +426,12 @@ static int handle_intercept(CPUS390XState *env)
             r = handle_instruction(env, run);
             break;
         case ICPT_WAITPSW:
+            if (s390_del_running_cpu(env) == 0 &&
+                is_special_wait_psw(env)) {
+                qemu_system_shutdown_request();
+            }
+            r = EXCP_HALTED;
+            break;
         case ICPT_CPU_STOP:
             if (s390_del_running_cpu(env) == 0) {
                 qemu_system_shutdown_request();