From patchwork Wed Apr 10 03:33:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hu Tao X-Patchwork-Id: 235279 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 94A8C2C0084 for ; Wed, 10 Apr 2013 13:35:17 +1000 (EST) Received: from localhost ([::1]:60128 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPloZ-0007ei-MP for incoming@patchwork.ozlabs.org; Tue, 09 Apr 2013 23:35:15 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPlnx-0007Zn-In for qemu-devel@nongnu.org; Tue, 09 Apr 2013 23:34:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPlnw-00030T-8C for qemu-devel@nongnu.org; Tue, 09 Apr 2013 23:34:37 -0400 Received: from [222.73.24.84] (port=3996 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPlnv-0002xt-TA for qemu-devel@nongnu.org; Tue, 09 Apr 2013 23:34:36 -0400 X-IronPort-AV: E=Sophos;i="4.87,444,1363104000"; d="scan'208";a="7025417" Received: from unknown (HELO tang.cn.fujitsu.com) ([10.167.250.3]) by song.cn.fujitsu.com with ESMTP; 10 Apr 2013 11:31:51 +0800 Received: from fnstmail02.fnst.cn.fujitsu.com (tang.cn.fujitsu.com [127.0.0.1]) by tang.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id r3A3YQGY015388; Wed, 10 Apr 2013 11:34:28 +0800 Received: from localhost.localdomain ([10.167.233.156]) by fnstmail02.fnst.cn.fujitsu.com (Lotus Domino Release 8.5.3) with ESMTP id 2013041011331658-427420 ; Wed, 10 Apr 2013 11:33:16 +0800 From: Hu Tao To: qemu-devel , "Daniel P. Berrange" , KAMEZAWA Hiroyuki , Jan Kiszka , Gleb Natapov , Blue Swirl , Eric Blake , Andrew Jones , Marcelo Tosatti , Sasha Levin , Luiz Capitulino , Anthony Liguori , Markus Armbruster , Paolo Bonzini , Stefan Hajnoczi , Juan Quintela , Orit Wasserman , Wen Congyang , "Michael S. Tsirkin" , Alexander Graf , Alex Williamson , Peter Maydell , Christian Borntraeger Date: Wed, 10 Apr 2013 11:33:56 +0800 Message-Id: X-Mailer: git-send-email 1.8.1.4 In-Reply-To: References: X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/04/10 11:33:16, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2013/04/10 11:33:18, Serialize complete at 2013/04/10 11:33:18 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 222.73.24.84 Subject: [Qemu-devel] [PATCH v18 7/7] Wire up disabled wait a panicked event on s390 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Christian Borntraeger 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;