From patchwork Mon Apr 23 09:52:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 154388 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 D9122B6FAA for ; Mon, 23 Apr 2012 20:56:11 +1000 (EST) Received: from localhost ([::1]:53333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMFxp-0008Gu-89 for incoming@patchwork.ozlabs.org; Mon, 23 Apr 2012 05:53:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46153) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMFx3-0006Kg-Ef for qemu-devel@nongnu.org; Mon, 23 Apr 2012 05:53:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SMFwt-00025A-Jg for qemu-devel@nongnu.org; Mon, 23 Apr 2012 05:52:57 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:49540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SMFwt-00023Z-80 for qemu-devel@nongnu.org; Mon, 23 Apr 2012 05:52:47 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 23 Apr 2012 10:52:43 +0100 Received: from d06nrmr1806.portsmouth.uk.ibm.com (9.149.39.193) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 23 Apr 2012 10:52:41 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q3N9qexg2531518 for ; Mon, 23 Apr 2012 10:52:40 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q3N9qdcr008690 for ; Mon, 23 Apr 2012 03:52:40 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q3N9qdYi008677; Mon, 23 Apr 2012 03:52:39 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id A2A46122443C; Mon, 23 Apr 2012 11:52:39 +0200 (CEST) From: Christian Borntraeger To: Alexander Graf Date: Mon, 23 Apr 2012 11:52:25 +0200 Message-Id: <1335174745-45551-8-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.7.9.6 In-Reply-To: <1335174745-45551-1-git-send-email-borntraeger@de.ibm.com> References: <1335174745-45551-1-git-send-email-borntraeger@de.ibm.com> x-cbid: 12042309-1948-0000-0000-000001994477 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 195.75.94.110 Cc: Cornelia Huck , Christian Borntraeger , Jens Freimann , qemu-devel Subject: [Qemu-devel] [PATCH 7/7] [s390] dont call system_shutdown on disabled wait 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 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 --- target-s390x/kvm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 956730d..90aad61 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -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();