From nobody Wed Nov 5 02:51:25 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500648485473791.6615040819864; Fri, 21 Jul 2017 07:48:05 -0700 (PDT) Received: from localhost ([::1]:43560 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYZDn-0006t1-1D for importer@patchew.org; Fri, 21 Jul 2017 10:48:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYZBy-0005kU-IY for qemu-devel@nongnu.org; Fri, 21 Jul 2017 10:46:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYZBw-0002HP-R9 for qemu-devel@nongnu.org; Fri, 21 Jul 2017 10:46:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54522) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dYZBw-0002H3-Hd for qemu-devel@nongnu.org; Fri, 21 Jul 2017 10:46:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 44F1DC013C21; Fri, 21 Jul 2017 14:46:07 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-117-121.ams2.redhat.com [10.36.117.121]) by smtp.corp.redhat.com (Postfix) with ESMTP id B245574AAF; Fri, 21 Jul 2017 14:46:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 44F1DC013C21 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=thuth@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 44F1DC013C21 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Date: Fri, 21 Jul 2017 16:45:55 +0200 Message-Id: <1500648359-25931-2-git-send-email-thuth@redhat.com> In-Reply-To: <1500648359-25931-1-git-send-email-thuth@redhat.com> References: <1500648359-25931-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 21 Jul 2017 14:46:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 1/5] target/s390x: Move s390_cpu_dump_state() to helper.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , Cornelia Huck , Alexander Graf Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" translate.c can not be compiled with --disable-tcg, but we need the s390_cpu_dump_state() in KVM-only builds, too. So let's move that function to helper.c instead, which will also be compiled when --disable-tcg has been specified. Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- target/s390x/helper.c | 60 ++++++++++++++++++++++++++++++++++++++++++++= ++++ target/s390x/translate.c | 60 --------------------------------------------= ---- 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/target/s390x/helper.c b/target/s390x/helper.c index aef09e1..30ac2a7 100644 --- a/target/s390x/helper.c +++ b/target/s390x/helper.c @@ -766,3 +766,63 @@ void s390x_cpu_do_unaligned_access(CPUState *cs, vaddr= addr, program_interrupt(env, PGM_SPECIFICATION, ILEN_AUTO); } #endif /* CONFIG_USER_ONLY */ + +void s390_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprin= tf, + int flags) +{ + S390CPU *cpu =3D S390_CPU(cs); + CPUS390XState *env =3D &cpu->env; + int i; + + if (env->cc_op > 3) { + cpu_fprintf(f, "PSW=3Dmask %016" PRIx64 " addr %016" PRIx64 " cc %= 15s\n", + env->psw.mask, env->psw.addr, cc_name(env->cc_op)); + } else { + cpu_fprintf(f, "PSW=3Dmask %016" PRIx64 " addr %016" PRIx64 " cc %= 02x\n", + env->psw.mask, env->psw.addr, env->cc_op); + } + + for (i =3D 0; i < 16; i++) { + cpu_fprintf(f, "R%02d=3D%016" PRIx64, i, env->regs[i]); + if ((i % 4) =3D=3D 3) { + cpu_fprintf(f, "\n"); + } else { + cpu_fprintf(f, " "); + } + } + + for (i =3D 0; i < 16; i++) { + cpu_fprintf(f, "F%02d=3D%016" PRIx64, i, get_freg(env, i)->ll); + if ((i % 4) =3D=3D 3) { + cpu_fprintf(f, "\n"); + } else { + cpu_fprintf(f, " "); + } + } + + for (i =3D 0; i < 32; i++) { + cpu_fprintf(f, "V%02d=3D%016" PRIx64 "%016" PRIx64, i, + env->vregs[i][0].ll, env->vregs[i][1].ll); + cpu_fprintf(f, (i % 2) ? "\n" : " "); + } + +#ifndef CONFIG_USER_ONLY + for (i =3D 0; i < 16; i++) { + cpu_fprintf(f, "C%02d=3D%016" PRIx64, i, env->cregs[i]); + if ((i % 4) =3D=3D 3) { + cpu_fprintf(f, "\n"); + } else { + cpu_fprintf(f, " "); + } + } +#endif + +#ifdef DEBUG_INLINE_BRANCHES + for (i =3D 0; i < CC_OP_MAX; i++) { + cpu_fprintf(f, " %15s =3D %10ld\t%10ld\n", cc_name(i), + inline_branch_miss[i], inline_branch_hit[i]); + } +#endif + + cpu_fprintf(f, "\n"); +} diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 48b71f9..cd96a8d 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -93,66 +93,6 @@ static uint64_t pc_to_link_info(DisasContext *s, uint64_= t pc) return pc; } =20 -void s390_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprin= tf, - int flags) -{ - S390CPU *cpu =3D S390_CPU(cs); - CPUS390XState *env =3D &cpu->env; - int i; - - if (env->cc_op > 3) { - cpu_fprintf(f, "PSW=3Dmask %016" PRIx64 " addr %016" PRIx64 " cc %= 15s\n", - env->psw.mask, env->psw.addr, cc_name(env->cc_op)); - } else { - cpu_fprintf(f, "PSW=3Dmask %016" PRIx64 " addr %016" PRIx64 " cc %= 02x\n", - env->psw.mask, env->psw.addr, env->cc_op); - } - - for (i =3D 0; i < 16; i++) { - cpu_fprintf(f, "R%02d=3D%016" PRIx64, i, env->regs[i]); - if ((i % 4) =3D=3D 3) { - cpu_fprintf(f, "\n"); - } else { - cpu_fprintf(f, " "); - } - } - - for (i =3D 0; i < 16; i++) { - cpu_fprintf(f, "F%02d=3D%016" PRIx64, i, get_freg(env, i)->ll); - if ((i % 4) =3D=3D 3) { - cpu_fprintf(f, "\n"); - } else { - cpu_fprintf(f, " "); - } - } - - for (i =3D 0; i < 32; i++) { - cpu_fprintf(f, "V%02d=3D%016" PRIx64 "%016" PRIx64, i, - env->vregs[i][0].ll, env->vregs[i][1].ll); - cpu_fprintf(f, (i % 2) ? "\n" : " "); - } - -#ifndef CONFIG_USER_ONLY - for (i =3D 0; i < 16; i++) { - cpu_fprintf(f, "C%02d=3D%016" PRIx64, i, env->cregs[i]); - if ((i % 4) =3D=3D 3) { - cpu_fprintf(f, "\n"); - } else { - cpu_fprintf(f, " "); - } - } -#endif - -#ifdef DEBUG_INLINE_BRANCHES - for (i =3D 0; i < CC_OP_MAX; i++) { - cpu_fprintf(f, " %15s =3D %10ld\t%10ld\n", cc_name(i), - inline_branch_miss[i], inline_branch_hit[i]); - } -#endif - - cpu_fprintf(f, "\n"); -} - static TCGv_i64 psw_addr; static TCGv_i64 psw_mask; static TCGv_i64 gbea; --=20 1.8.3.1