From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFO4f-0001SU-Fg for qemu-devel@nongnu.org; Fri, 30 Aug 2013 08:45:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFO4W-0005hG-Cw for qemu-devel@nongnu.org; Fri, 30 Aug 2013 08:45:13 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:34376) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFO0r-0004YV-67 for qemu-devel@nongnu.org; Fri, 30 Aug 2013 08:41:17 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 30 Aug 2013 13:36:08 +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 D71901B0805F for ; Fri, 30 Aug 2013 13:41:13 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r7UCf1e863111336 for ; Fri, 30 Aug 2013 12:41:01 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r7UCfCKT024850 for ; Fri, 30 Aug 2013 06:41:13 -0600 From: Christian Borntraeger Date: Fri, 30 Aug 2013 14:41:32 +0200 Message-Id: <1377866493-47164-7-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1377866493-47164-1-git-send-email-borntraeger@de.ibm.com> References: <1377866493-47164-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PULLv2 6/7] s390: Implement load normal reset List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf , Anthony Liguori Cc: Cornelia Huck , Christian Borntraeger , Jens Freimann , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel kdump on s390 uses a load normal reset to bring the system in a defined state by doing a subsystem reset. The issuing CPUs will have an initial CPU reset, all other CPUs will have a CPU reset as defined in POP (no register content will change). Implement this as architectured. Signed-off-by: Christian Borntraeger --- target-s390x/misc_helper.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/target-s390x/misc_helper.c b/target-s390x/misc_helper.c index 9b4423a..4afd7da 100644 --- a/target-s390x/misc_helper.c +++ b/target-s390x/misc_helper.c @@ -31,6 +31,7 @@ #if !defined(CONFIG_USER_ONLY) #include "exec/softmmu_exec.h" +#include "sysemu/cpus.h" #include "sysemu/sysemu.h" #endif @@ -180,6 +181,32 @@ uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2) } #ifndef CONFIG_USER_ONLY +static void cpu_reset_all(void) +{ + CPUState *cpu; + S390CPUClass *scc; + + for (cpu = first_cpu; cpu; cpu = cpu->next_cpu) { + scc = S390_CPU_GET_CLASS(CPU(cpu)); + scc->cpu_reset(CPU(cpu)); + } +} + +static int load_normal_reset(S390CPU *cpu) +{ + S390CPUClass *scc = S390_CPU_GET_CLASS(cpu); + + pause_all_vcpus(); + cpu_synchronize_all_states(); + cpu_reset_all(); + io_subsystem_reset(); + scc->initial_cpu_reset(CPU(cpu)); + scc->load_normal(CPU(cpu)); + cpu_synchronize_all_post_reset(); + resume_all_vcpus(); + return 0; +} + #define DIAG_308_RC_NO_CONF 0x0102 #define DIAG_308_RC_INVALID 0x0402 void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3) @@ -198,6 +225,9 @@ void handle_diag_308(CPUS390XState *env, uint64_t r1, uint64_t r3) } switch (subcode) { + case 1: + load_normal_reset(s390_env_get_cpu(env)); + break; case 5: if ((r1 & 1) || (addr & 0x0fffULL)) { program_interrupt(env, PGM_SPECIFICATION, ILEN_LATER_INC); -- 1.8.3.1