From patchwork Mon Sep 26 07:06:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 9350191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 12622601C2 for ; Mon, 26 Sep 2016 07:25:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0443B28B5B for ; Mon, 26 Sep 2016 07:25:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E955128B64; Mon, 26 Sep 2016 07:25:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 564E428B53 for ; Mon, 26 Sep 2016 07:25:39 +0000 (UTC) Received: from localhost ([::1]:41951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boQIE-00052Z-Ez for patchwork-qemu-devel@patchwork.kernel.org; Mon, 26 Sep 2016 03:25:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boQHq-00051C-Ve for qemu-devel@nongnu.org; Mon, 26 Sep 2016 03:25:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1boQHn-0006jY-QA for qemu-devel@nongnu.org; Mon, 26 Sep 2016 03:25:14 -0400 Received: from bes.se.axis.com ([195.60.68.10]:56604) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1boQHn-0006it-Fb for qemu-devel@nongnu.org; Mon, 26 Sep 2016 03:25:11 -0400 Received: from localhost (localhost [127.0.0.1]) by bes.se.axis.com (Postfix) with ESMTP id 777D02E29E; Mon, 26 Sep 2016 09:06:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bes.se.axis.com Received: from bes.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bes.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id y9FjoyrfI887; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bes.se.axis.com (Postfix) with ESMTPS id 85F492E28D; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7256C1E090; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 670BE1E08F; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: from thoth.se.axis.com (unknown [10.0.2.173]) by boulder03.se.axis.com (Postfix) with ESMTP; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: from lnxartpec.se.axis.com (lnxartpec.se.axis.com [10.88.4.9]) by thoth.se.axis.com (Postfix) with ESMTP id 5B2262F9; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Received: by lnxartpec.se.axis.com (Postfix, from userid 10564) id 553F08049C; Mon, 26 Sep 2016 09:06:50 +0200 (CEST) Date: Mon, 26 Sep 2016 09:06:50 +0200 From: Rabin Vincent To: "Edgar E. Iglesias" Message-ID: <20160926070650.GA4538@axis.com> References: <1473076452-19795-1-git-send-email-rabin.vincent@axis.com> <1473076452-19795-6-git-send-email-rabin.vincent@axis.com> <20160912225951.GN16305@toto> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160912225951.GN16305@toto> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.60.68.10 Subject: Re: [Qemu-devel] [PATCH 6/9] target-cris: reduce v32isms from v10 log dumps 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: Hans-Peter Nilsson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Sep 13, 2016 at 12:59:51AM +0200, Edgar E. Iglesias wrote: > On Mon, Sep 05, 2016 at 01:54:09PM +0200, Rabin Vincent wrote: > > @@ -3363,14 +3371,16 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, > > cpu_fprintf(f, "\n"); > > } > > } > > - srs = env->pregs[PR_SRS]; > > - cpu_fprintf(f, "\nsupport function regs bank %x:\n", srs); > > - if (srs < ARRAY_SIZE(env->sregs)) { > > - for (i = 0; i < 16; i++) { > > - cpu_fprintf(f, "s%2.2d=%8.8x ", > > - i, env->sregs[srs][i]); > > - if ((i + 1) % 4 == 0) { > > - cpu_fprintf(f, "\n"); > > + if (env->pregs[PR_SRS] >= 32) { > > > did you mean env->pregs[PR_VR] >= 32 here? Here's an updated patch: 8<------------- From 4143896189ba073d14f6d89ad98ef4109d267bec Mon Sep 17 00:00:00 2001 From: Hans-Peter Nilsson Date: Mon, 15 Aug 2016 13:44:46 +0200 Subject: [PATCHv2] target-cris: reduce v32isms from v10 log dumps Use the correct register names for v10 and don't dump support function registers for pre-v32. Signed-off-by: Hans-Peter Nilsson Signed-off-by: Rabin Vincent --- v2: Fix PR_SRS -> PR_VR target-cris/translate.c | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/target-cris/translate.c b/target-cris/translate.c index f4a8d7d..b5ab0a5 100644 --- a/target-cris/translate.c +++ b/target-cris/translate.c @@ -140,14 +140,14 @@ static void gen_BUG(DisasContext *dc, const char *file, int line) cpu_abort(CPU(dc->cpu), "%s:%d\n", file, line); } -static const char *regnames[] = +static const char *regnames_v32[] = { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", "$r8", "$r9", "$r10", "$r11", "$r12", "$r13", "$sp", "$acr", }; -static const char *pregnames[] = +static const char *pregnames_v32[] = { "$bz", "$vr", "$pid", "$srs", "$wz", "$exs", "$eda", "$mof", @@ -3327,12 +3327,20 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, { CRISCPU *cpu = CRIS_CPU(cs); CPUCRISState *env = &cpu->env; + const char **regnames; + const char **pregnames; int i; - uint32_t srs; if (!env || !f) { return; } + if (env->pregs[PR_VR] < 32) { + pregnames = pregnames_v10; + regnames = regnames_v10; + } else { + pregnames = pregnames_v32; + regnames = regnames_v32; + } cpu_fprintf(f, "PC=%x CCS=%x btaken=%d btarget=%x\n" "cc_op=%d cc_src=%d cc_dest=%d cc_result=%x cc_mask=%x\n", @@ -3354,14 +3362,16 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf, cpu_fprintf(f, "\n"); } } - srs = env->pregs[PR_SRS]; - cpu_fprintf(f, "\nsupport function regs bank %x:\n", srs); - if (srs < ARRAY_SIZE(env->sregs)) { - for (i = 0; i < 16; i++) { - cpu_fprintf(f, "s%2.2d=%8.8x ", - i, env->sregs[srs][i]); - if ((i + 1) % 4 == 0) { - cpu_fprintf(f, "\n"); + if (env->pregs[PR_VR] >= 32) { + uint32_t srs = env->pregs[PR_SRS]; + cpu_fprintf(f, "\nsupport function regs bank %x:\n", srs); + if (srs < ARRAY_SIZE(env->sregs)) { + for (i = 0; i < 16; i++) { + cpu_fprintf(f, "s%2.2d=%8.8x ", + i, env->sregs[srs][i]); + if ((i + 1) % 4 == 0) { + cpu_fprintf(f, "\n"); + } } } } @@ -3406,12 +3416,12 @@ void cris_initialize_tcg(void) for (i = 0; i < 16; i++) { cpu_R[i] = tcg_global_mem_new(cpu_env, offsetof(CPUCRISState, regs[i]), - regnames[i]); + regnames_v32[i]); } for (i = 0; i < 16; i++) { cpu_PR[i] = tcg_global_mem_new(cpu_env, offsetof(CPUCRISState, pregs[i]), - pregnames[i]); + pregnames_v32[i]); } }