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: 111820 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp1133318qge; Wed, 6 Sep 2017 09:19:09 -0700 (PDT) X-Received: by 10.55.93.7 with SMTP id r7mr4044974qkb.125.1504714749353; Wed, 06 Sep 2017 09:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504714749; cv=none; d=google.com; s=arc-20160816; b=VoFss5MxVMZBIybW3G0KPTme+2/ydXi7vOknprzgp3S73du4+vb02UjJGX9JXFV6ui WKera5u/Z+5+9IdWlQjh8XKzTzzlXWweFSe7auqeHh/FWvaRYomF6C19OoFTFD7mFWAA FFuhbC8WwxTXklrOT4H04hltBUJFYsAmFOpYdlmKZdCERu47Xz+vM+Pq/f+s6mDEncQW iRzjTXgdjoYB4ikWRWCyiQNcPEnh5bEdaUWPh9yws6z4TaXoBvimDo/ioZr9SzA8N6Jc Z2jB0NDu7Cri/IEPqamgB4CTrdtsqpm9/2j5EIIoWbiT+Vz4KUfBRx3VgstL1ZmHtw51 2mEw== 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:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=pEMSMV5Z7pScAAcMP+yKs/Gg5lY3QrUgOjrToUNpIiA=; b=T+kRHaJJxyMJSr85pEAKOWsvddyekBCMLt96TvHxv8idgfZ4/OImlUumDSNIxGn7pr a2sVl2jGjTx1g99cdDHuxk7QlSVmP6Sp3SI7a6xmpsIataf31vrU/tyQVKFa/Dkxm0au rdxF1rr77zSRr1gIVRcLBsEUifgeY8N0wqywFxN80+lsdTea5paYItL2qnnixvyYVZwy umqHHZust+ARrQ6q4/RPb1hqvUpkuQfJPh4yjT4QkGh26c4zhSFh+Cgzq/9An+OKlBUn euW0T87GBUhqCEyhD8+rxZW9Zodj64Fzbqf+lKqIJFPvVtOw8HeRzHDFeYjzhqN/PRs7 0Slw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DYEOaXnQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id p64si198977qkc.481.2017.09.06.09.19.08 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 06 Sep 2017 09:19:09 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DYEOaXnQ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dpd2g-0002EX-LU for patch@linaro.org; Wed, 06 Sep 2017 12:19: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_Vilanova?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.13.5 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] = {