]> git.proxmox.com Git - qemu.git/commitdiff
Wire up disabled wait a panicked event on s390
authorChristian Borntraeger <borntraeger@de.ibm.com>
Fri, 26 Apr 2013 03:24:47 +0000 (11:24 +0800)
committerAnthony Liguori <aliguori@us.ibm.com>
Tue, 30 Apr 2013 15:30:01 +0000 (10:30 -0500)
On s390 the disabled wait state indicates a state of attention.
For example Linux uses that state after a panic. Lets
put the system into panicked state.

An alternative implementation would be to state
disabled-wait <address> instead of pause in the action field.
(e.g. z/OS, z/VM and other classic OSes use the address of the
disabled wait to indicate an error code).

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-id: 6cf41156322e27e81a727b69f03728dbc225d5bb.1366945969.git.hutao@cn.fujitsu.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
target-s390x/kvm.c

index fb006eeffd381b5e08810b6ee2dd949f04fdca5f..a585392b93e4d78c8d2bd044047ad0ae6238794f 100644 (file)
@@ -34,6 +34,8 @@
 #include "sysemu/kvm.h"
 #include "cpu.h"
 #include "sysemu/device_tree.h"
+#include "qapi/qmp/qjson.h"
+#include "monitor/monitor.h"
 
 /* #define DEBUG_KVM */
 
@@ -779,9 +781,18 @@ static int handle_intercept(S390CPU *cpu)
             r = handle_instruction(cpu, run);
             break;
         case ICPT_WAITPSW:
-            if (s390_del_running_cpu(cpu) == 0 &&
-                is_special_wait_psw(cs)) {
-                qemu_system_shutdown_request();
+            /* disabled wait, since enabled wait is handled in kernel */
+            if (s390_del_running_cpu(cpu) == 0) {
+                if (is_special_wait_psw(cs)) {
+                    qemu_system_shutdown_request();
+                } else {
+                    QObject *data;
+
+                    data = qobject_from_jsonf("{ 'action': %s }", "pause");
+                    monitor_protocol_event(QEVENT_GUEST_PANICKED, data);
+                    qobject_decref(data);
+                    vm_stop(RUN_STATE_GUEST_PANICKED);
+                }
             }
             r = EXCP_HALTED;
             break;