From patchwork Mon Jul 24 20:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9860403 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 80B8360385 for ; Mon, 24 Jul 2017 20:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72973285C1 for ; Mon, 24 Jul 2017 20:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 67505285C7; Mon, 24 Jul 2017 20:43:44 +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 1A53A285C6 for ; Mon, 24 Jul 2017 20:43:42 +0000 (UTC) Received: from localhost ([::1]:56881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZkC3-0005qf-Ix for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Jul 2017 16:43:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48096) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dZjyE-0003lQ-Rn for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dZjyC-0001r3-97 for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:50 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:36141) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dZjyC-0001qa-5X for qemu-devel@nongnu.org; Mon, 24 Jul 2017 16:28:48 -0400 Received: by mail-qk0-x242.google.com with SMTP id d136so10953544qkg.3 for ; Mon, 24 Jul 2017 13:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=j7A92jbRLNhrFAVyI84ZwU51MTULAAQpLA4Ks+UI0co=; b=fUiJ+Nj2sU3YntKWNtU8MchuWwh58Nfm31I5swb8E3Gr35ZD8unFjKX3co+sIWMNJN ybdZq6FyBX7cCZqGAALaAsvDxSDuoJv684M6kbyItMZ1+yM8VXXDyyX4m+RjEJEfkYug k/NU+fPNlGBN50xgY66AIMLKLD7yNh96witxWFRZ6pbmqC43yIBgWzB8QkYei2SBltW0 8FjqQecmuFEe7SZrd4EdP6w1/tI1hSfVE3wWCjEV0eh8caPlH1uG9gaX0XSmpcZnYKql PXGUQC62LFxyY+z/bNCZkdxvg0c8ZW4tfGuxtY+zb0Xl4XGfkYxRMHk3knufK7rdl637 vVQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=j7A92jbRLNhrFAVyI84ZwU51MTULAAQpLA4Ks+UI0co=; b=EBVQtNuX8UhIonndcpzFxdMhpcAcGg+15UvBqe7shhWRe0EmuIxjIBgWgMqn3ZNQCY 4LdYHL5wyUzpUxLHfFkpuG1Ep2GQbxqvyBJXhR/MguCAQTFlZr8IbxRSUIBG9Vt68p8M EqAHLGaWGnxqavp6ypNRryLT7fExy1jSqwn2DdpN8hs9yRxcANDqw4Z/+76Rzlx8jvzO 4sVcQ1M/FGEUxyjXrviN0rZMYFF6/UCcIHigehCmyupzYWox7zI9+I/qipx/foRbZp1m b5kOZvv2+mFk/S0VDvnyKgPwnw8hvnEjt/V8v/PzYhT8tKKJZiIO57NLgUug7ssE4PJZ nAJA== X-Gm-Message-State: AIVw113YnUyS5sRpSGbfLNY7Jy/5p1bL6aTPbf0XTuox1lB7d5UeYuzF pLCVLDximfun/QqQEzw= X-Received: by 10.55.66.132 with SMTP id p126mr20234615qka.143.1500928127359; Mon, 24 Jul 2017 13:28:47 -0700 (PDT) Received: from bigtime.com ([71.217.194.233]) by smtp.gmail.com with ESMTPSA id p52sm9196808qtc.74.2017.07.24.13.28.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Jul 2017 13:28:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 24 Jul 2017 13:27:23 -0700 Message-Id: <20170724202728.25960-28-rth@twiddle.net> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20170724202728.25960-1-rth@twiddle.net> References: <20170724202728.25960-1-rth@twiddle.net> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH v15 27/32] target/arm: [tcg, a64] 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: cota@braap.org, vilanova@ac.upc.edu 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. Reviewed-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Lluís Vilanova Message-Id: <150002606914.22386.15524101311003685068.stgit@frigg.lan> [rth: Move tb->size computation and use that result.] Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 4056d38c02..9339e54f0c 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -11372,6 +11372,16 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu) } } +static void aarch64_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, + 4 | (bswap_code(dc->sctlr_b) ? 2 : 0)); +} + void gen_intermediate_code_a64(DisasContextBase *dcbase, CPUState *cs, TranslationBlock *tb) { @@ -11447,18 +11457,17 @@ void gen_intermediate_code_a64(DisasContextBase *dcbase, CPUState *cs, gen_tb_end(tb, dc->base.num_insns); + dc->base.tb->size = dc->pc - dc->base.pc_first; + dc->base.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, - 4 | (bswap_code(dc->sctlr_b) ? 2 : 0)); + aarch64_tr_disas_log(&dc->base, cs); qemu_log("\n"); qemu_log_unlock(); } #endif - dc->base.tb->size = dc->pc - dc->base.pc_first; - dc->base.tb->icount = dc->base.num_insns; }