From patchwork Wed Sep 6 16:06:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9941081 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 BDF9C6035F for ; Wed, 6 Sep 2017 16:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E60A828C2F for ; Wed, 6 Sep 2017 16:20:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E14C728C2E; Wed, 6 Sep 2017 16:20:20 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 08B3428C34 for ; Wed, 6 Sep 2017 16:20:07 +0000 (UTC) Received: from localhost ([::1]:37006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpd3e-0002EX-Kw for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Sep 2017 12:20:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41950) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpcqp-0000QN-MY for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dpcqo-0002qf-Mk for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:51 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:36484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dpcqo-0002qO-Ht for qemu-devel@nongnu.org; Wed, 06 Sep 2017 12:06:50 -0400 Received: by mail-pf0-x234.google.com with SMTP id e199so13453818pfh.3 for ; Wed, 06 Sep 2017 09:06:50 -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=pEMSMV5Z7pScAAcMP+yKs/Gg5lY3QrUgOjrToUNpIiA=; b=DYEOaXnQqzDP5qiNQIzU59g1TIyI5m3U1tI+gxHhAIpoFfrOjdomeOedJnu1V4Kag5 FBhWGb7jeDLfHV5ko2Cm3LHQcZzMfyBoWtIN0vgzpYOugtOjClT10zD/HGIQs9ze64aW vSSxK5rj9O4Ipbn1dUltL6OXExjGG4iZNjQAQ= 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=pEMSMV5Z7pScAAcMP+yKs/Gg5lY3QrUgOjrToUNpIiA=; b=GbldSpfDMMF7MpW3mRlOCtQUhBvaEP2uTLk9/RMUU2ehcMP/cVG0Yj/yNcazMd1eUM 5BpMtzeAe3HmbLpmrFTkkju1tQ4LiF7PsiCbKc3pLKsoeGwIYRqSJXIwBCgav6EdvBBL 5szeyGgc/LnmN+TZrmAShK1YaYo/1oyNc4M/gPcmGR6yV2iUsBaCeBy7fKT01K/WLXAW YQi752eNEznOBGjZPQZxdQWdDAtGoF5JaK2w9uD7fGtVUpVKIXiGcfxJHQke9EeEuqo4 ibKFsl0oBJF3oiII9Khfg/WyuJIDxK7U2Th1NbLVDfX30NCSt4+pEyn7UlgaTwO1HO/p yO7A== X-Gm-Message-State: AHPjjUhQQly9CzapSPa237soYVNT4xzIpG1/471SXGikX5uawhwhrlIl l9FLbRbCafst7VKAKGJ35A== X-Google-Smtp-Source: ADKCNb4Dasx45YMUyouWpU3jqHiuZV6WRT0kQOtKJg6dou8cexlrVPASQ3m0Kj4ofGl8nKJnQ6uHGw== X-Received: by 10.98.201.197 with SMTP id l66mr7636810pfk.135.1504714009257; Wed, 06 Sep 2017 09:06:49 -0700 (PDT) Received: from bigtime.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id t65sm262863pfk.59.2017.09.06.09.06.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Sep 2017 09:06:48 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 6 Sep 2017 09:06:06 -0700 Message-Id: <20170906160612.22769-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170906160612.22769-1-richard.henderson@linaro.org> References: <20170906160612.22769-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::234 Subject: [Qemu-devel] [PULL 26/32] target/arm: [tcg] Port to disas_log 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: peter.maydell@linaro.org, =?UTF-8?q?Llu=C3=ADs=20Vilanova?= , Richard Henderson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Lluís Vilanova Incrementally paves the way towards using the generic instruction translation loop. Signed-off-by: Lluís Vilanova Reviewed-by: Richard Henderson Reviewed-by: Alex Benneé Message-Id: <150002582711.22386.191527630537864599.stgit@frigg.lan> [rth: Move tb->size computation and use that result.] Signed-off-by: Richard Henderson --- target/arm/translate.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index 10527b50c8..2dca196e17 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -12171,6 +12171,15 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) } } +static void arm_tr_disas_log(const DisasContextBase *dcbase, CPUState *cpu) +{ + DisasContext *dc = container_of(dcbase, DisasContext, base); + + qemu_log("IN: %s\n", lookup_symbol(dc->base.pc_first)); + log_target_disas(cpu, dc->base.pc_first, dc->base.tb->size, + dc->thumb | (dc->sctlr_b << 1)); +} + /* generate intermediate code for basic block 'tb'. */ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) { @@ -12251,20 +12260,19 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) gen_tb_end(tb, dc->base.num_insns); + tb->size = dc->pc - dc->base.pc_first; + tb->icount = dc->base.num_insns; + #ifdef DEBUG_DISAS if (qemu_loglevel_mask(CPU_LOG_TB_IN_ASM) && qemu_log_in_addr_range(dc->base.pc_first)) { qemu_log_lock(); qemu_log("----------------\n"); - qemu_log("IN: %s\n", lookup_symbol(dc->base.pc_first)); - log_target_disas(cs, dc->base.pc_first, dc->pc - dc->base.pc_first, - dc->thumb | (dc->sctlr_b << 1)); + arm_tr_disas_log(&dc->base, cs); qemu_log("\n"); qemu_log_unlock(); } #endif - tb->size = dc->pc - dc->base.pc_first; - tb->icount = dc->base.num_insns; } static const char *cpu_mode_names[16] = {