From patchwork Tue Sep 24 07:27:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 277377 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5EE382C00A8 for ; Tue, 24 Sep 2013 17:36:37 +1000 (EST) Received: from localhost ([::1]:44007 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VONAh-0004kn-AI for incoming@patchwork.ozlabs.org; Tue, 24 Sep 2013 03:36:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VON2C-00016N-Fv for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VON1z-0005gx-Er for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:48 -0400 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:59029) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VON1z-0005gB-4j for qemu-devel@nongnu.org; Tue, 24 Sep 2013 03:27:35 -0400 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 24 Sep 2013 08:27:33 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 24 Sep 2013 08:27:32 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id CAE6B219006B for ; Tue, 24 Sep 2013 08:27:31 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8O7RJIm59768974 for ; Tue, 24 Sep 2013 07:27:19 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8O7RVLA026759 for ; Tue, 24 Sep 2013 01:27:31 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r8O7RV8g026745; Tue, 24 Sep 2013 01:27:31 -0600 Received: by tuxmaker.boeblingen.de.ibm.com (Postfix, from userid 25651) id 1681A1224437; Tue, 24 Sep 2013 09:27:31 +0200 (CEST) From: Christian Borntraeger To: Anthony Liguori Date: Tue, 24 Sep 2013 09:27:41 +0200 Message-Id: <1380007671-18976-8-git-send-email-borntraeger@de.ibm.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1380007671-18976-1-git-send-email-borntraeger@de.ibm.com> References: <1380007671-18976-1-git-send-email-borntraeger@de.ibm.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13092407-4966-0000-0000-000006FD6402 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.106 Cc: qemu-devel , Christian Borntraeger , Alexander Graf , Richard Henderson Subject: [Qemu-devel] [PULL 07/17] s390/kexec: Implement diag308 subcode 0 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 This patch implements subcode 0 of diag 308. This is necessary for kexec (without kdump). The main difference to subcode 1 is that all CPUs get a full reset, instead of the architectured CPU reset (which leaves all registers untouched). Signed-off-by: Christian Borntraeger --- target-s390x/misc_helper.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index 1690907..37ea60d 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -192,6 +192,29 @@ static void cpu_reset_all(void) } } +static void cpu_full_reset_all(void) +{ + CPUState *cpu; + + CPU_FOREACH(cpu) { + cpu_reset(cpu); + } +} + +static int modified_clear_reset(S390CPU *cpu) +{ + S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); + + pause_all_vcpus(); + cpu_synchronize_all_states(); + cpu_full_reset_all(); + io_subsystem_reset(); + scc->load_normal(CPU(cpu)); + cpu_synchronize_all_post_reset(); + resume_all_vcpus(); + return 0; +} + static int load_normal_reset(S390CPU *cpu) { S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); @@ -225,6 +248,9 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3) } switch (subcode) { + case 0: + modified_clear_reset(s390_env_get_cpu(env)); + break; case 1: load_normal_reset(s390_env_get_cpu(env)); break;