From nobody Tue Feb 10 20:06:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1618592196; cv=none; d=zohomail.com; s=zohoarc; b=RAObMutgObYm43NUcH0CuuPD8oiynEchJD8zikTeIFYQxA81b6/bDpkA22032yTWA3Q7XBeUae/lLSQNh5nCem9j43WJfRjWkyntZt0iz/BrRSzKDWi4KV5Pjj9PlP5Nk9zI1awnQF9LsaR12bbDXqruVvVwEk/nhUQSe8aezoY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618592196; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zZaImyYq6sCpptKBMrdzEoQd1KQpP4c/RbQLKAPJOQo=; b=T2OwjeaSO7dumMA1s2A/tbC1rOHAa4O6WWBELsavjJDjyFqGZR/6OTrRDLjECLv8grytButw8GkGNnwcASOBnRs0FQQCoBIuNb6rUoNWxlAOvr7eIKL40/+h2hzb4mxqBPskOJUT7zW75e/Y1xlL0LwPw42nNloRZ/KHUnGrldM= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1618592196597483.3891463914355; Fri, 16 Apr 2021 09:56:36 -0700 (PDT) Received: from localhost ([::1]:47328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXRlj-0005hN-HU for importer@patchew.org; Fri, 16 Apr 2021 12:56:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXRLA-0004GT-0c for qemu-devel@nongnu.org; Fri, 16 Apr 2021 12:29:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:44210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXRL1-0001Sd-7R for qemu-devel@nongnu.org; Fri, 16 Apr 2021 12:29:07 -0400 Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 6C428B2E4; Fri, 16 Apr 2021 16:28:39 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de From: Claudio Fontana To: Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Richard Henderson , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [RFC v14 28/80] target/arm: split 32bit and 64bit arm dump state Date: Fri, 16 Apr 2021 18:27:32 +0200 Message-Id: <20210416162824.25131-29-cfontana@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210416162824.25131-1-cfontana@suse.de> References: <20210416162824.25131-1-cfontana@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=195.135.220.15; envelope-from=cfontana@suse.de; helo=mx2.suse.de X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Roman Bolshakov , Claudio Fontana , Eduardo Habkost , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Signed-off-by: Claudio Fontana --- target/arm/cpu32.h | 2 +- target/arm/cpu.c | 225 --------------------------------------------- target/arm/cpu32.c | 85 ++++++++++++++++- target/arm/cpu64.c | 142 ++++++++++++++++++++++++++++ 4 files changed, 227 insertions(+), 227 deletions(-) diff --git a/target/arm/cpu32.h b/target/arm/cpu32.h index 211fad6f55..128d0c9247 100644 --- a/target/arm/cpu32.h +++ b/target/arm/cpu32.h @@ -21,7 +21,7 @@ #ifndef ARM_CPU32_H #define ARM_CPU32_H =20 -void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags); +void arm32_cpu_dump_state(CPUState *cs, FILE *f, int flags); void arm32_cpu_class_init(ObjectClass *oc, void *data); void arm32_cpu_register(const ARMCPUInfo *info); =20 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index d88074b677..e9dc5da4ca 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -19,7 +19,6 @@ */ =20 #include "qemu/osdep.h" -#include "qemu/qemu-print.h" #include "qemu-common.h" #include "target/arm/idau.h" #include "qemu/module.h" @@ -717,230 +716,6 @@ static void arm_disas_set_info(CPUState *cpu, disasse= mble_info *info) #endif } =20 -#ifdef TARGET_AARCH64 - -static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) -{ - ARMCPU *cpu =3D ARM_CPU(cs); - CPUARMState *env =3D &cpu->env; - uint32_t psr =3D pstate_read(env); - int i; - int el =3D arm_current_el(env); - const char *ns_status; - - qemu_fprintf(f, " PC=3D%016" PRIx64 " ", env->pc); - for (i =3D 0; i < 32; i++) { - if (i =3D=3D 31) { - qemu_fprintf(f, " SP=3D%016" PRIx64 "\n", env->xregs[i]); - } else { - qemu_fprintf(f, "X%02d=3D%016" PRIx64 "%s", i, env->xregs[i], - (i + 2) % 3 ? " " : "\n"); - } - } - - if (arm_feature(env, ARM_FEATURE_EL3) && el !=3D 3) { - ns_status =3D env->cp15.scr_el3 & SCR_NS ? "NS " : "S "; - } else { - ns_status =3D ""; - } - qemu_fprintf(f, "PSTATE=3D%08x %c%c%c%c %sEL%d%c", - psr, - psr & PSTATE_N ? 'N' : '-', - psr & PSTATE_Z ? 'Z' : '-', - psr & PSTATE_C ? 'C' : '-', - psr & PSTATE_V ? 'V' : '-', - ns_status, - el, - psr & PSTATE_SP ? 'h' : 't'); - - if (cpu_isar_feature(aa64_bti, cpu)) { - qemu_fprintf(f, " BTYPE=3D%d", (psr & PSTATE_BTYPE) >> 10); - } - if (!(flags & CPU_DUMP_FPU)) { - qemu_fprintf(f, "\n"); - return; - } - if (fp_exception_el(env, el) !=3D 0) { - qemu_fprintf(f, " FPU disabled\n"); - return; - } - qemu_fprintf(f, " FPCR=3D%08x FPSR=3D%08x\n", - vfp_get_fpcr(env), vfp_get_fpsr(env)); - - if (cpu_isar_feature(aa64_sve, cpu) && sve_exception_el(env, el) =3D= =3D 0) { - int j, zcr_len =3D sve_zcr_len_for_el(env, el); - - for (i =3D 0; i <=3D FFR_PRED_NUM; i++) { - bool eol; - if (i =3D=3D FFR_PRED_NUM) { - qemu_fprintf(f, "FFR=3D"); - /* It's last, so end the line. */ - eol =3D true; - } else { - qemu_fprintf(f, "P%02d=3D", i); - switch (zcr_len) { - case 0: - eol =3D i % 8 =3D=3D 7; - break; - case 1: - eol =3D i % 6 =3D=3D 5; - break; - case 2: - case 3: - eol =3D i % 3 =3D=3D 2; - break; - default: - /* More than one quadword per predicate. */ - eol =3D true; - break; - } - } - for (j =3D zcr_len / 4; j >=3D 0; j--) { - int digits; - if (j * 4 + 4 <=3D zcr_len + 1) { - digits =3D 16; - } else { - digits =3D (zcr_len % 4 + 1) * 4; - } - qemu_fprintf(f, "%0*" PRIx64 "%s", digits, - env->vfp.pregs[i].p[j], - j ? ":" : eol ? "\n" : " "); - } - } - - for (i =3D 0; i < 32; i++) { - if (zcr_len =3D=3D 0) { - qemu_fprintf(f, "Z%02d=3D%016" PRIx64 ":%016" PRIx64 "%s", - i, env->vfp.zregs[i].d[1], - env->vfp.zregs[i].d[0], i & 1 ? "\n" : " "); - } else if (zcr_len =3D=3D 1) { - qemu_fprintf(f, "Z%02d=3D%016" PRIx64 ":%016" PRIx64 - ":%016" PRIx64 ":%016" PRIx64 "\n", - i, env->vfp.zregs[i].d[3], env->vfp.zregs[i].= d[2], - env->vfp.zregs[i].d[1], env->vfp.zregs[i].d[0= ]); - } else { - for (j =3D zcr_len; j >=3D 0; j--) { - bool odd =3D (zcr_len - j) % 2 !=3D 0; - if (j =3D=3D zcr_len) { - qemu_fprintf(f, "Z%02d[%x-%x]=3D", i, j, j - 1); - } else if (!odd) { - if (j > 0) { - qemu_fprintf(f, " [%x-%x]=3D", j, j - 1); - } else { - qemu_fprintf(f, " [%x]=3D", j); - } - } - qemu_fprintf(f, "%016" PRIx64 ":%016" PRIx64 "%s", - env->vfp.zregs[i].d[j * 2 + 1], - env->vfp.zregs[i].d[j * 2], - odd || j =3D=3D 0 ? "\n" : ":"); - } - } - } - } else { - for (i =3D 0; i < 32; i++) { - uint64_t *q =3D aa64_vfp_qreg(env, i); - qemu_fprintf(f, "Q%02d=3D%016" PRIx64 ":%016" PRIx64 "%s", - i, q[1], q[0], (i & 1 ? "\n" : " ")); - } - } -} - -#else - -static inline void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) -{ - g_assert_not_reached(); -} - -#endif - -void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) -{ - ARMCPU *cpu =3D ARM_CPU(cs); - CPUARMState *env =3D &cpu->env; - int i; - - if (is_a64(env)) { - aarch64_cpu_dump_state(cs, f, flags); - return; - } - - for (i =3D 0; i < 16; i++) { - qemu_fprintf(f, "R%02d=3D%08x", i, env->regs[i]); - if ((i % 4) =3D=3D 3) { - qemu_fprintf(f, "\n"); - } else { - qemu_fprintf(f, " "); - } - } - - if (arm_feature(env, ARM_FEATURE_M)) { - uint32_t xpsr =3D xpsr_read(env); - const char *mode; - const char *ns_status =3D ""; - - if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { - ns_status =3D env->v7m.secure ? "S " : "NS "; - } - - if (xpsr & XPSR_EXCP) { - mode =3D "handler"; - } else { - if (env->v7m.control[env->v7m.secure] & R_V7M_CONTROL_NPRIV_MA= SK) { - mode =3D "unpriv-thread"; - } else { - mode =3D "priv-thread"; - } - } - - qemu_fprintf(f, "XPSR=3D%08x %c%c%c%c %c %s%s\n", - xpsr, - xpsr & XPSR_N ? 'N' : '-', - xpsr & XPSR_Z ? 'Z' : '-', - xpsr & XPSR_C ? 'C' : '-', - xpsr & XPSR_V ? 'V' : '-', - xpsr & XPSR_T ? 'T' : 'A', - ns_status, - mode); - } else { - uint32_t psr =3D cpsr_read(env); - const char *ns_status =3D ""; - - if (arm_feature(env, ARM_FEATURE_EL3) && - (psr & CPSR_M) !=3D ARM_CPU_MODE_MON) { - ns_status =3D env->cp15.scr_el3 & SCR_NS ? "NS " : "S "; - } - - qemu_fprintf(f, "PSR=3D%08x %c%c%c%c %c %s%s%d\n", - psr, - psr & CPSR_N ? 'N' : '-', - psr & CPSR_Z ? 'Z' : '-', - psr & CPSR_C ? 'C' : '-', - psr & CPSR_V ? 'V' : '-', - psr & CPSR_T ? 'T' : 'A', - ns_status, - aarch32_mode_name(psr), (psr & 0x10) ? 32 : 26); - } - - if (flags & CPU_DUMP_FPU) { - int numvfpregs =3D 0; - if (cpu_isar_feature(aa32_simd_r32, cpu)) { - numvfpregs =3D 32; - } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { - numvfpregs =3D 16; - } - for (i =3D 0; i < numvfpregs; i++) { - uint64_t v =3D *aa32_vfp_dreg(env, i); - qemu_fprintf(f, "s%02d=3D%08x s%02d=3D%08x d%02d=3D%016" PRIx6= 4 "\n", - i * 2, (uint32_t)v, - i * 2 + 1, (uint32_t)(v >> 32), - i, v); - } - qemu_fprintf(f, "FPSCR: %08x\n", vfp_get_fpscr(env)); - } -} - uint64_t arm_cpu_mp_affinity(int idx, uint8_t clustersz) { uint32_t Aff1 =3D idx / clustersz; diff --git a/target/arm/cpu32.c b/target/arm/cpu32.c index 39fb112a04..c03f420ba2 100644 --- a/target/arm/cpu32.c +++ b/target/arm/cpu32.c @@ -58,6 +58,89 @@ static gchar *arm_gdb_arch_name(CPUState *cs) return g_strdup("arm"); } =20 +void arm32_cpu_dump_state(CPUState *cs, FILE *f, int flags) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + CPUARMState *env =3D &cpu->env; + int i; + + assert(!is_a64(env)); + + for (i =3D 0; i < 16; i++) { + qemu_fprintf(f, "R%02d=3D%08x", i, env->regs[i]); + if ((i % 4) =3D=3D 3) { + qemu_fprintf(f, "\n"); + } else { + qemu_fprintf(f, " "); + } + } + + if (arm_feature(env, ARM_FEATURE_M)) { + uint32_t xpsr =3D xpsr_read(env); + const char *mode; + const char *ns_status =3D ""; + + if (arm_feature(env, ARM_FEATURE_M_SECURITY)) { + ns_status =3D env->v7m.secure ? "S " : "NS "; + } + + if (xpsr & XPSR_EXCP) { + mode =3D "handler"; + } else { + if (env->v7m.control[env->v7m.secure] & R_V7M_CONTROL_NPRIV_MA= SK) { + mode =3D "unpriv-thread"; + } else { + mode =3D "priv-thread"; + } + } + + qemu_fprintf(f, "XPSR=3D%08x %c%c%c%c %c %s%s\n", + xpsr, + xpsr & XPSR_N ? 'N' : '-', + xpsr & XPSR_Z ? 'Z' : '-', + xpsr & XPSR_C ? 'C' : '-', + xpsr & XPSR_V ? 'V' : '-', + xpsr & XPSR_T ? 'T' : 'A', + ns_status, + mode); + } else { + uint32_t psr =3D cpsr_read(env); + const char *ns_status =3D ""; + + if (arm_feature(env, ARM_FEATURE_EL3) && + (psr & CPSR_M) !=3D ARM_CPU_MODE_MON) { + ns_status =3D env->cp15.scr_el3 & SCR_NS ? "NS " : "S "; + } + + qemu_fprintf(f, "PSR=3D%08x %c%c%c%c %c %s%s%d\n", + psr, + psr & CPSR_N ? 'N' : '-', + psr & CPSR_Z ? 'Z' : '-', + psr & CPSR_C ? 'C' : '-', + psr & CPSR_V ? 'V' : '-', + psr & CPSR_T ? 'T' : 'A', + ns_status, + aarch32_mode_name(psr), (psr & 0x10) ? 32 : 26); + } + + if (flags & CPU_DUMP_FPU) { + int numvfpregs =3D 0; + if (cpu_isar_feature(aa32_simd_r32, cpu)) { + numvfpregs =3D 32; + } else if (cpu_isar_feature(aa32_vfp_simd, cpu)) { + numvfpregs =3D 16; + } + for (i =3D 0; i < numvfpregs; i++) { + uint64_t v =3D *aa32_vfp_dreg(env, i); + qemu_fprintf(f, "s%02d=3D%08x s%02d=3D%08x d%02d=3D%016" PRIx6= 4 "\n", + i * 2, (uint32_t)v, + i * 2 + 1, (uint32_t)(v >> 32), + i, v); + } + qemu_fprintf(f, "FPSCR: %08x\n", vfp_get_fpscr(env)); + } +} + void arm32_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc =3D CPU_CLASS(oc); @@ -67,7 +150,7 @@ void arm32_cpu_class_init(ObjectClass *oc, void *data) cc->gdb_num_core_regs =3D 26; cc->gdb_core_xml_file =3D "arm-core.xml"; cc->gdb_arch_name =3D arm_gdb_arch_name; - cc->dump_state =3D arm_cpu_dump_state; + cc->dump_state =3D arm32_cpu_dump_state; } =20 static void arm32_cpu_instance_init(Object *obj) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index bdbbda566b..90edd5ecc1 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -20,7 +20,9 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" +#include "qemu/qemu-print.h" #include "cpu.h" +#include "cpu32.h" #ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" #endif /* CONFIG_TCG */ @@ -814,6 +816,145 @@ static gchar *aarch64_gdb_arch_name(CPUState *cs) return g_strdup("aarch64"); } =20 +static void aarch64_cpu_dump_state(CPUState *cs, FILE *f, int flags) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + CPUARMState *env =3D &cpu->env; + uint32_t psr =3D pstate_read(env); + int i; + int el =3D arm_current_el(env); + const char *ns_status; + + qemu_fprintf(f, " PC=3D%016" PRIx64 " ", env->pc); + for (i =3D 0; i < 32; i++) { + if (i =3D=3D 31) { + qemu_fprintf(f, " SP=3D%016" PRIx64 "\n", env->xregs[i]); + } else { + qemu_fprintf(f, "X%02d=3D%016" PRIx64 "%s", i, env->xregs[i], + (i + 2) % 3 ? " " : "\n"); + } + } + + if (arm_feature(env, ARM_FEATURE_EL3) && el !=3D 3) { + ns_status =3D env->cp15.scr_el3 & SCR_NS ? "NS " : "S "; + } else { + ns_status =3D ""; + } + qemu_fprintf(f, "PSTATE=3D%08x %c%c%c%c %sEL%d%c", + psr, + psr & PSTATE_N ? 'N' : '-', + psr & PSTATE_Z ? 'Z' : '-', + psr & PSTATE_C ? 'C' : '-', + psr & PSTATE_V ? 'V' : '-', + ns_status, + el, + psr & PSTATE_SP ? 'h' : 't'); + + if (cpu_isar_feature(aa64_bti, cpu)) { + qemu_fprintf(f, " BTYPE=3D%d", (psr & PSTATE_BTYPE) >> 10); + } + if (!(flags & CPU_DUMP_FPU)) { + qemu_fprintf(f, "\n"); + return; + } + if (fp_exception_el(env, el) !=3D 0) { + qemu_fprintf(f, " FPU disabled\n"); + return; + } + qemu_fprintf(f, " FPCR=3D%08x FPSR=3D%08x\n", + vfp_get_fpcr(env), vfp_get_fpsr(env)); + + if (cpu_isar_feature(aa64_sve, cpu) && sve_exception_el(env, el) =3D= =3D 0) { + int j, zcr_len =3D sve_zcr_len_for_el(env, el); + + for (i =3D 0; i <=3D FFR_PRED_NUM; i++) { + bool eol; + if (i =3D=3D FFR_PRED_NUM) { + qemu_fprintf(f, "FFR=3D"); + /* It's last, so end the line. */ + eol =3D true; + } else { + qemu_fprintf(f, "P%02d=3D", i); + switch (zcr_len) { + case 0: + eol =3D i % 8 =3D=3D 7; + break; + case 1: + eol =3D i % 6 =3D=3D 5; + break; + case 2: + case 3: + eol =3D i % 3 =3D=3D 2; + break; + default: + /* More than one quadword per predicate. */ + eol =3D true; + break; + } + } + for (j =3D zcr_len / 4; j >=3D 0; j--) { + int digits; + if (j * 4 + 4 <=3D zcr_len + 1) { + digits =3D 16; + } else { + digits =3D (zcr_len % 4 + 1) * 4; + } + qemu_fprintf(f, "%0*" PRIx64 "%s", digits, + env->vfp.pregs[i].p[j], + j ? ":" : eol ? "\n" : " "); + } + } + + for (i =3D 0; i < 32; i++) { + if (zcr_len =3D=3D 0) { + qemu_fprintf(f, "Z%02d=3D%016" PRIx64 ":%016" PRIx64 "%s", + i, env->vfp.zregs[i].d[1], + env->vfp.zregs[i].d[0], i & 1 ? "\n" : " "); + } else if (zcr_len =3D=3D 1) { + qemu_fprintf(f, "Z%02d=3D%016" PRIx64 ":%016" PRIx64 + ":%016" PRIx64 ":%016" PRIx64 "\n", + i, env->vfp.zregs[i].d[3], env->vfp.zregs[i].= d[2], + env->vfp.zregs[i].d[1], env->vfp.zregs[i].d[0= ]); + } else { + for (j =3D zcr_len; j >=3D 0; j--) { + bool odd =3D (zcr_len - j) % 2 !=3D 0; + if (j =3D=3D zcr_len) { + qemu_fprintf(f, "Z%02d[%x-%x]=3D", i, j, j - 1); + } else if (!odd) { + if (j > 0) { + qemu_fprintf(f, " [%x-%x]=3D", j, j - 1); + } else { + qemu_fprintf(f, " [%x]=3D", j); + } + } + qemu_fprintf(f, "%016" PRIx64 ":%016" PRIx64 "%s", + env->vfp.zregs[i].d[j * 2 + 1], + env->vfp.zregs[i].d[j * 2], + odd || j =3D=3D 0 ? "\n" : ":"); + } + } + } + } else { + for (i =3D 0; i < 32; i++) { + uint64_t *q =3D aa64_vfp_qreg(env, i); + qemu_fprintf(f, "Q%02d=3D%016" PRIx64 ":%016" PRIx64 "%s", + i, q[1], q[0], (i & 1 ? "\n" : " ")); + } + } +} + +static void arm_cpu_dump_state(CPUState *cs, FILE *f, int flags) +{ + ARMCPU *cpu =3D ARM_CPU(cs); + CPUARMState *env =3D &cpu->env; + + if (is_a64(env)) { + aarch64_cpu_dump_state(cs, f, flags); + } else { + arm32_cpu_dump_state(cs, f, flags); + } +} + static void aarch64_cpu_class_init(ObjectClass *oc, void *data) { CPUClass *cc =3D CPU_CLASS(oc); @@ -823,6 +964,7 @@ static void aarch64_cpu_class_init(ObjectClass *oc, voi= d *data) cc->gdb_num_core_regs =3D 34; cc->gdb_core_xml_file =3D "aarch64-core.xml"; cc->gdb_arch_name =3D aarch64_gdb_arch_name; + cc->dump_state =3D arm_cpu_dump_state; =20 object_class_property_add_bool(oc, "aarch64", aarch64_cpu_get_aarch64, aarch64_cpu_set_aarch64); --=20 2.26.2