From patchwork Tue Aug 25 20:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 248330 Delivered-To: patch@linaro.org Received: by 2002:a17:906:6447:0:0:0:0 with SMTP id l7csp17422ejn; Tue, 25 Aug 2020 14:42:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVQ7ldlvWpRJQ8/m+bssGo6SB/xe3dSa/IalIqADF6Un3qlVzxfOsei1uqjPOFnibwl9OB X-Received: by 2002:a25:8892:: with SMTP id d18mr18283680ybl.70.1598391771839; Tue, 25 Aug 2020 14:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598391771; cv=none; d=google.com; s=arc-20160816; b=CVvGSRGlhQwdh0p2tIrPjeegASbEW+QR3d15lzQ15uQHN8S+DC/YWNF4XA1L362Yfl b7Xwi1kbxPYj+xgrzudky8WnYabjJI1qbkwLWoqp5ik9lcd2X2GvVziiBcONYkYQLHw9 iKv5NOQAax85SwIsTbXU2Av8kOmFiTvNA3vZxYNm6ZbyUTGB/PCKAf81cXWEPa6nMWGw GwoJ/eYZGfSyK4zwAS3ru9WzBZQ6GDKZxGfdJUMxCv5j0eVm7foSpodb7Ebcg1g5Aax9 NMheHHpGKyZ1+TFyqWZ8E/tOZGY6sbXC6HVGMwiwmyzAsGyywYhwPoX9VbxtYVkSYYd2 tvJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=0+lbMujB7ENQF6DPdS7wnVUjhoKJE7Rkmv+oxgd9wrg=; b=NzIBBDy2HjTEipWpOOyfZSDOwXjpGjuRu6NS8PnKX5xq/NYVD4/SG3UL/a8kPZmbh2 mUkUBrGKLColmPf+iCw/ZgN8vRPuHRaiJe84+Pb1J8K8ng3Ag0EzP8nWBvY10l30Mg2r OU9m+0lgswHzCtaqMMe+6sZmYg0SzoC1TtWft8OHABIUoFQHwBErIfVwqzvUW62JjDyw aUAQbRdhkg85kJAubdckc9dony/r+H65eMglRZD8tJTY52PEiYKOPZsXp0h/iv1ZdtMT 8if5buRjP0Rbm5KJwM2oiwcYEvpMoZBoTYcwVI58YUFb0ExzkTZeGivFLJ92pbhcfect yJzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCymE3jW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e8si109275ybb.202.2020.08.25.14.42.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Aug 2020 14:42:51 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WCymE3jW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAgiR-00034j-5o for patch@linaro.org; Tue, 25 Aug 2020 17:42:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAg4C-0000Mm-Su for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:01:16 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:40631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAg4A-00021U-Tl for qemu-devel@nongnu.org; Tue, 25 Aug 2020 17:01:16 -0400 Received: by mail-pg1-x542.google.com with SMTP id h12so7675219pgm.7 for ; Tue, 25 Aug 2020 14:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0+lbMujB7ENQF6DPdS7wnVUjhoKJE7Rkmv+oxgd9wrg=; b=WCymE3jWbHXk76hlDjCJUVQXgckSWgcpPrdABXMw7zDyqOP7b2H5O9zMWMH2ou5sxd 9qYxMOH/q2VsyQywqGSPGugNgKB7981voHZxR16L26suMOfJzw72U3ZyWPGVM4OBLOjp ZkwYIPszghuKLsSJzmLLfWotazsxHN+wR8jnQ+csnSXcDqf2DPufkW4ROug4Z9QdWwm1 evkLhMrp50+O44XPGzR9UJdmC7DSOlxnuBU2o7brm/CzEVjrJyaaziHXaijW7o1LP+OJ WzWJQmq1pNzyqPEO3lV3nuCwPTvfN+le52Lx2ejtn8f104ozxKdqSQQynlMzCDVN//lL iXKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0+lbMujB7ENQF6DPdS7wnVUjhoKJE7Rkmv+oxgd9wrg=; b=reNXmVRGErl1jSRITy8Yi8hjQSxMiAPXMwH6rBdVfB1ki9THprd94WApaTgQlPXUOk QhTX3UpveAN+8tB15GvbrQgjUmZ8CrdFgVSRTvnEmbqEsUxfcgeIVJpAoOF4Pkcf78r0 wEdoF5MkXKDIdPCpemCU3atpNDoNgnOgR/qJUnWEcAgiiePmB6p35VgS33H2tSvEVhTN ZyqPDyqPmKIvidL1/04qzt8sBMTujZkzWODwsOIDqKCYs4bbjm9WhKs6M0BgNyPPo3Pl WJTtLFBCzt229V0vyEdvd/u+TXQ6eV87kkq6F72aWmkSFMVyPRwZnIFhCclKMbGi2HXz JPzw== X-Gm-Message-State: AOAM531UsInpbCEMXzEK982xLqexrXSzVOkBWgBxjYwnjhvLRI42Nyti bp5ItMwkmAAn4Mvdc1fAtr1ONdmETRLxeQ== X-Received: by 2002:aa7:924b:: with SMTP id 11mr9274257pfp.185.1598389273161; Tue, 25 Aug 2020 14:01:13 -0700 (PDT) Received: from localhost.localdomain (h216-228-167-147.bendor.dedicated.static.tds.net. [216.228.167.147]) by smtp.gmail.com with ESMTPSA id k4sm16074pgr.87.2020.08.25.14.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Aug 2020 14:01:12 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 61/77] target/microblaze: Tidy mb_cpu_dump_state Date: Tue, 25 Aug 2020 13:59:34 -0700 Message-Id: <20200825205950.730499-62-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200825205950.730499-1-richard.henderson@linaro.org> References: <20200825205950.730499-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::542; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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: edgar.iglesias@gmail.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using lookup_symbol is quite slow; remove that. Decode the various bits of iflags; only show imm, btaken, btarget when they are relevant to iflags. Improve formatting. Signed-off-by: Richard Henderson --- target/microblaze/translate.c | 67 +++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 26 deletions(-) -- 2.25.1 diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 3ba2dc1800..4675326083 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1810,41 +1810,56 @@ void mb_cpu_dump_state(CPUState *cs, FILE *f, int flags) { MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs); CPUMBState *env = &cpu->env; + uint32_t iflags; int i; - if (!env) { - return; - } - - qemu_fprintf(f, "IN: PC=%x %s\n", - env->pc, lookup_symbol(env->pc)); - qemu_fprintf(f, "rmsr=%x resr=%x rear=%" PRIx64 " " - "imm=%x iflags=%x fsr=%x rbtr=%x\n", - env->msr, env->esr, env->ear, - env->imm, env->iflags, env->fsr, env->btr); - qemu_fprintf(f, "btaken=%d btarget=%x mode=%s(saved=%s) eip=%d ie=%d\n", - env->btaken, env->btarget, + qemu_fprintf(f, "pc=0x%08x msr=0x%05x mode=%s(saved=%s) eip=%d ie=%d\n", + env->pc, env->msr, (env->msr & MSR_UM) ? "user" : "kernel", (env->msr & MSR_UMS) ? "user" : "kernel", (bool)(env->msr & MSR_EIP), (bool)(env->msr & MSR_IE)); - for (i = 0; i < 12; i++) { - qemu_fprintf(f, "rpvr%2.2d=%8.8x ", i, env->pvr.regs[i]); - if ((i + 1) % 4 == 0) { - qemu_fprintf(f, "\n"); - } + + iflags = env->iflags; + qemu_fprintf(f, "iflags: 0x%08x", iflags); + if (iflags & IMM_FLAG) { + qemu_fprintf(f, " IMM(0x%08x)", env->imm); + } + if (iflags & BIMM_FLAG) { + qemu_fprintf(f, " BIMM"); + } + if (iflags & D_FLAG) { + qemu_fprintf(f, " D(btaken=%d btarget=0x%08x)", + env->btaken, env->btarget); + } + if (iflags & DRTI_FLAG) { + qemu_fprintf(f, " DRTI"); + } + if (iflags & DRTE_FLAG) { + qemu_fprintf(f, " DRTE"); + } + if (iflags & DRTB_FLAG) { + qemu_fprintf(f, " DRTB"); + } + if (iflags & ESR_ESS_FLAG) { + qemu_fprintf(f, " ESR_ESS(0x%04x)", iflags & ESR_ESS_MASK); + } + + qemu_fprintf(f, "\nesr=0x%04x fsr=0x%02x btr=0x%08x edr=0x%x\n" + "ear=0x%016" PRIx64 " slr=0x%x shr=0x%x\n", + env->esr, env->fsr, env->btr, env->edr, + env->ear, env->slr, env->shr); + + for (i = 0; i < 12; i++) { + qemu_fprintf(f, "rpvr%-2d=%08x%c", + i, env->pvr.regs[i], i % 4 == 3 ? '\n' : ' '); } - /* Registers that aren't modeled are reported as 0 */ - qemu_fprintf(f, "redr=%x rpid=0 rzpr=0 rtlbx=0 rtlbsx=0 " - "rtlblo=0 rtlbhi=0\n", env->edr); - qemu_fprintf(f, "slr=%x shr=%x\n", env->slr, env->shr); for (i = 0; i < 32; i++) { - qemu_fprintf(f, "r%2.2d=%8.8x ", i, env->regs[i]); - if ((i + 1) % 4 == 0) - qemu_fprintf(f, "\n"); - } - qemu_fprintf(f, "\n\n"); + qemu_fprintf(f, "r%2.2d=%08x%c", + i, env->regs[i], i % 4 == 3 ? '\n' : ' '); + } + qemu_fprintf(f, "\n"); } void mb_tcg_init(void)