From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2Ea-00023k-I6 for qemu-devel@nongnu.org; Fri, 05 Apr 2013 04:43:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UO2ES-0004h4-79 for qemu-devel@nongnu.org; Fri, 05 Apr 2013 04:42:56 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:38546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2ER-0004gO-VM for qemu-devel@nongnu.org; Fri, 05 Apr 2013 04:42:48 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 5 Apr 2013 09:40:14 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6A38B1B08070 for ; Fri, 5 Apr 2013 09:42:42 +0100 (BST) Received: from d06av12.portsmouth.uk.ibm.com (d06av12.portsmouth.uk.ibm.com [9.149.37.247]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r358gWJg32637028 for ; Fri, 5 Apr 2013 08:42:32 GMT Received: from d06av12.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av12.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r358ge1E011695 for ; Fri, 5 Apr 2013 02:42:41 -0600 Message-ID: <515E8E7E.8060504@de.ibm.com> Date: Fri, 05 Apr 2013 10:42:38 +0200 From: Christian Borntraeger MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] [RFC] Wire up disabled wait a panicked event on s390 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hu Tao , Alexander Graf Cc: Peter Maydell , Andrew Jones , Anthony Liguori , Markus Armbruster , Gleb Natapov , Juan Quintela , Jan Kiszka , Marcelo Tosatti , qemu-devel , Luiz Capitulino , Blue Swirl , Orit Wasserman , Alex Williamson , "Michael S. Tsirkin" , Sasha Levin , Stefan Hajnoczi , Paolo Bonzini , KAMEZAWA Hiroyuki 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
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 --- target-s390x/kvm.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 644f484..0c111f0 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -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 */ @@ -705,9 +707,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;