Received: from eggs.gnu.org ([2001:4830:134:3::10]:45363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMzMp-0001mZ-Ru for qemu-devel@nongnu.org; Fri, 20 Sep 2013 07:59:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMzMg-0001ha-VF for qemu-devel@nongnu.org; Fri, 20 Sep 2013 07:59:23 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:51735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMzMg-0001hD-KZ for qemu-devel@nongnu.org; Fri, 20 Sep 2013 07:59:14 -0400 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 20 Sep 2013 12:59:11 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 92DD71B0805F for ; Fri, 20 Sep 2013 12:59:11 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r8KBww7625231502 for ; Fri, 20 Sep 2013 11:58:58 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r8KBxAE5000677 for ; Fri, 20 Sep 2013 05:59:10 -0600 From: Christian Borntraeger Date: Fri, 20 Sep 2013 13:59:30 +0200 Message-Id: <1379678370-30257-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [Patch] s390/kexec: Implement diag308 subcode 0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Christian Borntraeger , qemu-devel 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; -- 1.8.3.1