From patchwork Wed Nov 6 14:14:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11230483 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0B3BE1599 for ; Wed, 6 Nov 2019 14:15:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D355520663 for ; Wed, 6 Nov 2019 14:15:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lyDPLZjX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D355520663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM5g-00071T-Ph for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 09:15:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55651) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM4y-0005wQ-Mw for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSM4x-0001XW-J7 for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:36 -0500 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:37992) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSM4x-0001Wt-CY for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:35 -0500 Received: by mail-wr1-x444.google.com with SMTP id j15so5329397wrw.5 for ; Wed, 06 Nov 2019 06:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YOFnaBxbupvfjJosEi5lm+iq/aAKSCbIVLDFBZUFVY0=; b=lyDPLZjXivwxFEdlNxsc7I020N8FJ0UayRKNTlcAlYJQkbqDsppoB29dHEwVL00b9o HM1EF+M2XLyB8qAXV8yIejt+xPH6NKLV9wIquIddI+eUGtQawEyewuM302dj7+icAV9d RcjWxeymTqfzTQO3SffvF1FN3yv/1ffRkMJrXJfBoMlT2WXrorBMAxNScOd7PNvSpsc/ 8RjsYTpc0aQLs7xQrjO1u0tS7TafDzfaVA1FONMaYXj/Cayri0x0xZDh1TjEYKJ3Fo06 i9WXjDCYLFtN6+8z2kRVY+ZVNhwIe8ZdIbMYR/DTb6OSjNwujod0qpfIhWsl/AH+hXd5 4iyw== 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=YOFnaBxbupvfjJosEi5lm+iq/aAKSCbIVLDFBZUFVY0=; b=nyB4C6uusF4mabbDA2Lby0IetvIyOyfpScmo3aFfGCm8D7WaFVrJqs1IgbiBLndMVi 8DTLOe07xL6rIp3yB/vGjiYxa957BkXVOm/PCSDU07ky4gvx2wTA1riWMaQfLLCz/Tz/ 9eszHVw5ylAKQ8aWFtvdB5esTE5xrBXVQQhXaweQpKeOL4jhAt37pk89hTOKWAAgJTF/ IjEY4pAizp22ZlF9ooQ/CVnePOxmALPnGGd+iZu7yIhzzSnmFtWOMFWW3GG3AbYgPmz5 ctmuYAuxNm+YZ8aQZg7QDX7nOJ/r26cwICABffDpyjopTK8RKd7vD5sX2flNecDjNdpz HgGQ== X-Gm-Message-State: APjAAAX/MA3P3VovIRwoM4yg4cDRbRk5y1uz6jJAlSIbhChhJ/NxPvHD TC06BXF0qkv1OAiz+kkt5ND8OmuyKbw= X-Google-Smtp-Source: APXvYqyI7qZ8UufrVuh2eKsY+C2yGGpMdXA/94xyhMdJE0qGWLaz2C2sOFmKrxkdaZBWLcIENhd5dw== X-Received: by 2002:adf:f489:: with SMTP id l9mr2721646wro.337.1573049674045; Wed, 06 Nov 2019 06:14:34 -0800 (PST) Received: from localhost (ec2-34-244-242-0.eu-west-1.compute.amazonaws.com. [34.244.242.0]) by smtp.gmail.com with ESMTPSA id x8sm2504975wmi.10.2019.11.06.06.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:14:33 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 1/3] target/microblaze: Plug temp leaks for loads/stores Date: Wed, 6 Nov 2019 15:14:22 +0100 Message-Id: <20191106141424.27244-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191106141424.27244-1-edgar.iglesias@gmail.com> References: <20191106141424.27244-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Plug TCG temp leaks for loads/stores. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel Reviewed-by: Alistair Francis --- target/microblaze/translate.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 761f535357..ba143ede5f 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -967,12 +967,14 @@ static void dec_load(DisasContext *dc) 10 -> 10 11 -> 00 */ TCGv low = tcg_temp_new(); + TCGv t3 = tcg_const_tl(3); tcg_gen_andi_tl(low, addr, 3); - tcg_gen_sub_tl(low, tcg_const_tl(3), low); + tcg_gen_sub_tl(low, t3, low); tcg_gen_andi_tl(addr, addr, ~3); tcg_gen_or_tl(addr, addr, low); tcg_temp_free(low); + tcg_temp_free(t3); break; } @@ -1006,9 +1008,16 @@ static void dec_load(DisasContext *dc) tcg_gen_qemu_ld_i32(v, addr, mem_index, mop); if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + TCGv_i32 t0 = tcg_const_i32(0); + TCGv_i32 treg = tcg_const_i32(dc->rd); + TCGv_i32 tsize = tcg_const_i32(size - 1); + tcg_gen_movi_i64(cpu_SR[SR_PC], dc->pc); - gen_helper_memalign(cpu_env, addr, tcg_const_i32(dc->rd), - tcg_const_i32(0), tcg_const_i32(size - 1)); + gen_helper_memalign(cpu_env, addr, treg, t0, tsize); + + tcg_temp_free_i32(t0); + tcg_temp_free_i32(treg); + tcg_temp_free_i32(tsize); } if (ex) { @@ -1100,12 +1109,14 @@ static void dec_store(DisasContext *dc) 10 -> 10 11 -> 00 */ TCGv low = tcg_temp_new(); + TCGv t3 = tcg_const_tl(3); tcg_gen_andi_tl(low, addr, 3); - tcg_gen_sub_tl(low, tcg_const_tl(3), low); + tcg_gen_sub_tl(low, t3, low); tcg_gen_andi_tl(addr, addr, ~3); tcg_gen_or_tl(addr, addr, low); tcg_temp_free(low); + tcg_temp_free(t3); break; } @@ -1124,6 +1135,10 @@ static void dec_store(DisasContext *dc) /* Verify alignment if needed. */ if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + TCGv_i32 t1 = tcg_const_i32(1); + TCGv_i32 treg = tcg_const_i32(dc->rd); + TCGv_i32 tsize = tcg_const_i32(size - 1); + tcg_gen_movi_i64(cpu_SR[SR_PC], dc->pc); /* FIXME: if the alignment is wrong, we should restore the value * in memory. One possible way to achieve this is to probe @@ -1131,8 +1146,11 @@ static void dec_store(DisasContext *dc) * the alignment checks in between the probe and the mem * access. */ - gen_helper_memalign(cpu_env, addr, tcg_const_i32(dc->rd), - tcg_const_i32(1), tcg_const_i32(size - 1)); + gen_helper_memalign(cpu_env, addr, treg, t1, tsize); + + tcg_temp_free_i32(t1); + tcg_temp_free_i32(treg); + tcg_temp_free_i32(tsize); } if (ex) { From patchwork Wed Nov 6 14:14:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11230491 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8E4C1599 for ; Wed, 6 Nov 2019 14:17:53 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AC8652173E for ; Wed, 6 Nov 2019 14:17:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="q/Ndh+XF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC8652173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM88-00016m-PT for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 09:17:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55688) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM53-00064U-Pw for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSM52-0001ap-Mv for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:41 -0500 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:32916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSM52-0001aF-Gq for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:40 -0500 Received: by mail-wr1-x442.google.com with SMTP id w30so3278451wra.0 for ; Wed, 06 Nov 2019 06:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8PzveeQufMPdtS1Xqw/uA0eI9Y+6gGVjzLa9fBNFKzk=; b=q/Ndh+XFwEOV1AfNmeVt+oCNAmwTS4ARmfoX4VIBuTqX0GMP9bKkHu3uVmdfw3CxP5 v8Yzdj8FbiZ6ZXlHwZlhSsjIxtBmDno9YfvfpkjB0Cr5/bFwMwGoY5WkWBLhp+15kwH6 BYNmtV8URiUoZz63wnA22/+5xc54syKmtDm1XsfPYrQ1GHlh9f22BRTDen1QXPtkRH6P qRjRV3L+VQBL/AywY/M3MWayZJZ8QdvUjMrstlzDD2xz2KsKsI0GYt7IF0NSnu2lvk5k RFoJF+BEd/EAha4JQM4lTYnjv+LDQtzyJmjqjzgHvsq19a48S1zEn/H0C1q7HcgqHT1k SEUA== 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=8PzveeQufMPdtS1Xqw/uA0eI9Y+6gGVjzLa9fBNFKzk=; b=C8bTnyx/qdoozF826H01VY1HtSI3rSGs7b2armKHarpYJJ5UwX6pgJylPQHZ9FsQHI owUDx1gtTEwbO1lEG6kG9ivqu2pAg8/jPFvxIZMgqRGfiejukCj2Ssmpd14kuiXHf3Qv JAGI4H2IUuSUWaDWQTQyI9wjliQyLvKi34GHk8mwn6QNN6DcOvVrG+P2Sc/W2rduS9Qw vu1jK53060+7tTIJl4dntCET5zG5ro10/lJPq+WrtOcsZiIL/xTg3Q33Rgv4WgZbET42 gnLyaw6fjJb1kI3tORgkjzE86UH+G0jnxik0GiyreSPlmg2r43ntjxKxxFEOiuEOrhHz OTfA== X-Gm-Message-State: APjAAAUWZryF8Vwha77HlXtGdBXkWIi+QLo9rhiuJesffzXLJBJiamOn JS+OXwEkVxU3qagAGIjg6nKwxOB0j/Q= X-Google-Smtp-Source: APXvYqymy9f/4LcrewPw8N1yrf3Y/9nR0Oa/g5cPPXyChNbNz1XAKiXujkIj3FrXxVzbFtS4R+Y7Nw== X-Received: by 2002:adf:b608:: with SMTP id f8mr2743381wre.99.1573049679085; Wed, 06 Nov 2019 06:14:39 -0800 (PST) Received: from localhost (ec2-34-244-242-0.eu-west-1.compute.amazonaws.com. [34.244.242.0]) by smtp.gmail.com with ESMTPSA id j3sm16558763wrs.70.2019.11.06.06.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:14:38 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 2/3] target/microblaze: Plug temp leaks with delay slot setup Date: Wed, 6 Nov 2019 15:14:23 +0100 Message-Id: <20191106141424.27244-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191106141424.27244-1-edgar.iglesias@gmail.com> References: <20191106141424.27244-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Plug temp leaks with delay slot setup. Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index ba143ede5f..e9ff9e650d 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1201,6 +1201,17 @@ static void eval_cond_jmp(DisasContext *dc, TCGv_i64 pc_true, TCGv_i64 pc_false) tcg_temp_free_i64(tmp_zero); } +static void dec_setup_dslot(DisasContext *dc) +{ + TCGv_i32 tmp = tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG)); + + dc->delayed_branch = 2; + dc->tb_flags |= D_FLAG; + + tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUMBState, bimm)); + tcg_temp_free_i32(tmp); +} + static void dec_bcc(DisasContext *dc) { unsigned int cc; @@ -1212,10 +1223,7 @@ static void dec_bcc(DisasContext *dc) dc->delayed_branch = 1; if (dslot) { - dc->delayed_branch = 2; - dc->tb_flags |= D_FLAG; - tcg_gen_st_i32(tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG)), - cpu_env, offsetof(CPUMBState, bimm)); + dec_setup_dslot(dc); } if (dec_alu_op_b_is_small_imm(dc)) { @@ -1274,10 +1282,7 @@ static void dec_br(DisasContext *dc) dc->delayed_branch = 1; if (dslot) { - dc->delayed_branch = 2; - dc->tb_flags |= D_FLAG; - tcg_gen_st_i32(tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG)), - cpu_env, offsetof(CPUMBState, bimm)); + dec_setup_dslot(dc); } if (link && dc->rd) tcg_gen_movi_i32(cpu_R[dc->rd], dc->pc); @@ -1379,10 +1384,7 @@ static void dec_rts(DisasContext *dc) return; } - dc->delayed_branch = 2; - dc->tb_flags |= D_FLAG; - tcg_gen_st_i32(tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG)), - cpu_env, offsetof(CPUMBState, bimm)); + dec_setup_dslot(dc); if (i_bit) { LOG_DIS("rtid ir=%x\n", dc->ir); From patchwork Wed Nov 6 14:14:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11230493 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 825781599 for ; Wed, 6 Nov 2019 14:18:02 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 56A3A2173E for ; Wed, 6 Nov 2019 14:18:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EZb5bGDg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56A3A2173E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:59324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM8H-0001Ev-Fj for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Nov 2019 09:18:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55712) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSM57-0006Dh-Ud for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSM57-0001kr-1B for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:45 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:39236) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSM56-0001hh-RK for qemu-devel@nongnu.org; Wed, 06 Nov 2019 09:14:44 -0500 Received: by mail-wm1-x32d.google.com with SMTP id t26so3528666wmi.4 for ; Wed, 06 Nov 2019 06:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ppajx2TsUCnTlh9u4c0p57YVNOfV7vxJaOxn+KJ6Rg8=; b=EZb5bGDgfWY0MD1PeF7OBDaYA5L8zkY/poZFBtPF4hGlbBYpn3BrOPmHSYIRpDZY3B rqCnZIjIJ3yfbjLa+cXh5imH3OiQoRXuwSHJ3/z8Pov35QViGBkiidoMa5Am1qP6IFOi ACvAjzV45fq45uZtf/Gb5rAlPN4BTQG7fw7axKKu9rp+70nvzwomrjnf5YO1gNdnNw6C 8LrUC64RphaYmjCXyjQbzmSnHh+ccJj2afytNmf3nZpRvSj2ywXRoGxZ1kpW1iSzaQFc ZUmKGLIRmquLcNxAmttHdwi2TRT6Czy9WHLjN3y50XHHKcE2CkHePrf5Te/5cUGR7Z8Q 9LjQ== 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=Ppajx2TsUCnTlh9u4c0p57YVNOfV7vxJaOxn+KJ6Rg8=; b=CPxdnovZV/lV8BbKFwf3ZZZabCjVzsO3p8Stwe9j/rPOUmRnIpE8EojCSU+GCJqVo1 rM3Go3sNYvCm3efrexV2lV8w64hHuX9AMe8ZsTVDaXhIoi2sbOB1qKSmEsx1hGOknfxl ny94LI5PLfUOJGWqU4XNtDK6IC0FB9AOB5glsRd4vgnz2DBP0rnmSQrFwSOPqIyW7tEE JguVjyhISb5H2mQ4Ku1HYjWnKO1vPFu0d5OhBxGfBmKvpRJrKIVy1J9WaaEdtK7+D3Md bhuLHtbkUz3on+K0THBkubTY5DQUsTyxJjevZFm6fU4dfe9g1BkROVARbrewEpLKm9uL LlsA== X-Gm-Message-State: APjAAAVhXnRmDh0GGApQQijrXbZMCUyu4RZd4d/aa84B/U5aGwG47Jc8 D42XAppaTzBa4CTuADpFdotIr/w8uiA= X-Google-Smtp-Source: APXvYqwF06MiAv8XtLviYlZqEhH/LU0GJRUG7iI3CXjVBdjZnyjr2Sck5xSAgy23AqCFhKT1zT+xAQ== X-Received: by 2002:a7b:c3d6:: with SMTP id t22mr2820176wmj.13.1573049683552; Wed, 06 Nov 2019 06:14:43 -0800 (PST) Received: from localhost (ec2-34-244-242-0.eu-west-1.compute.amazonaws.com. [34.244.242.0]) by smtp.gmail.com with ESMTPSA id y2sm3376243wmy.2.2019.11.06.06.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2019 06:14:42 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 3/3] target/microblaze: Plug temp leak around eval_cond_jmp() Date: Wed, 6 Nov 2019 15:14:24 +0100 Message-Id: <20191106141424.27244-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191106141424.27244-1-edgar.iglesias@gmail.com> References: <20191106141424.27244-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d 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: figlesia@xilinx.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, alistair@alistair23.me, richard.henderson@linaro.org, frederic.konrad@adacore.com, philmd@redhat.com, luc.michel@greensocs.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Plug temp leak around eval_cond_jmp(). Signed-off-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Luc Michel Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson --- target/microblaze/translate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index e9ff9e650d..93e22a89ac 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1705,7 +1705,10 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb, int max_insns) dc->tb_flags &= ~D_FLAG; /* If it is a direct jump, try direct chaining. */ if (dc->jmp == JMP_INDIRECT) { - eval_cond_jmp(dc, env_btarget, tcg_const_i64(dc->pc)); + TCGv_i64 tmp_pc = tcg_const_i64(dc->pc); + eval_cond_jmp(dc, env_btarget, tmp_pc); + tcg_temp_free_i64(tmp_pc); + dc->is_jmp = DISAS_JUMP; } else if (dc->jmp == JMP_DIRECT) { t_sync_flags(dc);