From patchwork Tue Nov 12 16:04:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 11239741 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 2E3F614E5 for ; Tue, 12 Nov 2019 16:06:08 +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 0466520679 for ; Tue, 12 Nov 2019 16:06:08 +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="jTuwZGbq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0466520679 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]:37124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYgA-0005Ca-PT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 11:06:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50191) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYf7-0004Cc-OD for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUYf6-0007EX-HY for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:01 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:39890) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUYf6-0007Dw-BT for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:00 -0500 Received: by mail-wm1-x330.google.com with SMTP id t26so3536036wmi.4 for ; Tue, 12 Nov 2019 08:05:00 -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=Cy8FCwl/18NJgZg+dGnngIhHgF8t6xiMbv5xqZVLuRU=; b=jTuwZGbqMZDC/hJFWPGZLnDKQxds3XxVUbXnPQSLGypmgZIjG2NsDOEw9U/LUgLcp8 i3fEq5viT/KfA5iOoLGP6sVGh9vctzf6vzeZtoI+96ICH6g3ThJiq/QbxR80rCDyMspv tXjer71VHgPoRh24CqHOFE6Q5DBzyoiCE3AJ4PkYZSBfH/+5/48TLQPM+O7X2zjD6SWX pswy6hS+MS6blSYsxkLPoyEvU4jg9L/SWeXVHSmzMqa9Bpj+2qHzU9UaY28f052p3LyF crEAR2K0Z1SfYrvic8HPSnLLJJuMMdNpD2fF/LFG9tiz6bfQI7tmsBY6n5+j4J8u4UZH WRDQ== 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=Cy8FCwl/18NJgZg+dGnngIhHgF8t6xiMbv5xqZVLuRU=; b=sXN5oio+iz9ZY1wdTLIpriBo01/vaEhORB+rWelvB4z3UvkKhNk9kVHGHRhTevDiW2 xiYW98KMQ+xd14oNTE3coMYjkVspTG6uucZnvGuoPjHvABOXXCWQyuvE8uAacdX8XrhP Et3yUN3YZV2+N4bV4Q+Nn971o7KCgS0oKlTFEoF+TP343PE+RQUdjfh8lpyX8uiJRwqz ezGchYogWvXdEzu5ANhNMD8Vv/lqOZZRPMP+T853YxmCq91pfsNT5G2q3gNjlY9w6K1S 8PT1E3o5GVNik1gt+OhXkGo5ZOvO65gwG6N616C6+dBWNfd0drwonAEaKZABgFsSqOsR AEHA== X-Gm-Message-State: APjAAAWfEZak13iB+h6iAbtRMZwUlUzx+syEp9uTPu9Nn/GkSpDQgLl5 Gnr5DbuB223JG5Ht5tqF18Vy5D55sMA= X-Google-Smtp-Source: APXvYqyc9rbWbgzPWPxRYrFWA1H+y+kLxl9ovgIPpE4v3jcVaJoeXJK+qd6ZBQBBTvocRB3ghbifEw== X-Received: by 2002:a05:600c:c3:: with SMTP id u3mr4321251wmm.35.1573574698710; Tue, 12 Nov 2019 08:04:58 -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 t185sm5907182wmf.45.2019.11.12.08.04.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 08:04:58 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 1/3] target/microblaze: Plug temp leaks for loads/stores Date: Tue, 12 Nov 2019 17:04:47 +0100 Message-Id: <20191112160449.29212-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112160449.29212-1-edgar.iglesias@gmail.com> References: <20191112160449.29212-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::330 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@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: "Edgar E. Iglesias" Simplify endian reversion of address also plugging TCG temp leaks for loads/stores. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Reviewed-by: Luc Michel Reviewed-by: Alistair Francis Signed-off-by: Edgar E. Iglesias --- target/microblaze/translate.c | 46 +++++++++++++++-------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 761f535357..c8442b18e1 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -962,17 +962,7 @@ static void dec_load(DisasContext *dc) switch (size) { case 1: { - /* 00 -> 11 - 01 -> 10 - 10 -> 10 - 11 -> 00 */ - TCGv low = tcg_temp_new(); - - tcg_gen_andi_tl(low, addr, 3); - tcg_gen_sub_tl(low, tcg_const_tl(3), low); - tcg_gen_andi_tl(addr, addr, ~3); - tcg_gen_or_tl(addr, addr, low); - tcg_temp_free(low); + tcg_gen_xori_tl(addr, addr, 3); break; } @@ -1006,9 +996,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) { @@ -1095,17 +1092,7 @@ static void dec_store(DisasContext *dc) switch (size) { case 1: { - /* 00 -> 11 - 01 -> 10 - 10 -> 10 - 11 -> 00 */ - TCGv low = tcg_temp_new(); - - tcg_gen_andi_tl(low, addr, 3); - tcg_gen_sub_tl(low, tcg_const_tl(3), low); - tcg_gen_andi_tl(addr, addr, ~3); - tcg_gen_or_tl(addr, addr, low); - tcg_temp_free(low); + tcg_gen_xori_tl(addr, addr, 3); break; } @@ -1124,6 +1111,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 +1122,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 Tue Nov 12 16:04:48 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: 11239743 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 B830614E5 for ; Tue, 12 Nov 2019 16:08:07 +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 8F0FB20679 for ; Tue, 12 Nov 2019 16:08:07 +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="EMKEoD8+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F0FB20679 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]:37154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYi6-0007ZK-LV for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 11:08:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50237) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYfG-0004Nc-3L for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUYfB-0007I6-5J for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:10 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53545) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUYfA-0007HR-VX for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:05 -0500 Received: by mail-wm1-x336.google.com with SMTP id u18so3805207wmc.3 for ; Tue, 12 Nov 2019 08:05:04 -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=Rnzob+CMRQLWYBDPF8sebybDJvDCoUE2UV9qiBp+og0=; b=EMKEoD8+gI+V1ppQZi51XB0AikaVDO+bkJxUuZ8HOZRC4Rhk0XMySZI2PiKpTD+6Ss ML+rZ1wbXMn8w3fd2oQyP6zL5JC2ObDoQOTEkO9btSUVnD7CZsgoX+Qb6ogqBKkWzm7k pbnMwqMLX+g1Y00/kOUSuNd1lXbZZMXeIjwvYJlIGJMVBLFMU0oGWXgD4f0Peh+iImg3 DsYlwm4twGrQxWrzXG1iwdfO23Nbblwxk1XvNo9eiwcrgSCi39binYwD20AEtjFcHayp wKXA3wooF1w2qOiJiybqrp1azSE96U3JoBdurAomoYJnvERHxSoPxPYgxg2L2UsyaLyM LuSQ== 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=Rnzob+CMRQLWYBDPF8sebybDJvDCoUE2UV9qiBp+og0=; b=kBSeUf/AfCoDzVc/q7N/9hoqzvT7luOP3H2iaeOkfyt20XMUQhG71Jjq8UY7x7HX47 1/+Gn84GG399uc1HS5+3aN0J0v8RsPUJKrZmYT8B7wquIkpFi6oMSx0mH+Kl4CbdqRxd OOXJ5Gg9ArWe7o6546s6x2XMJuL+b6fSMWENoDvn3M50c1C58wEesW4HYhS1Z+pXYPqk 2saNDtK4RgmPfhpKl49LL68ugQGctFofB7JOeO4GjXavgkeVJhvIJVQgfPnCg0mQ16f/ RJv9V/1jV3PlOCatozBOb2tbCtLxWKPZ0iDpQSyXYMwTM3nd4F1VcrTHJgY7wjKOjI62 MvCQ== X-Gm-Message-State: APjAAAXIn98/X5cnccVznBav8HFnaez0VZUzZndVylU8MWxjed8nY4HT AVBCmHL8EL8Mb+VYQuf0ED+k+f4n6uc= X-Google-Smtp-Source: APXvYqwBInl9Y13r9BSDDMtOCP7EqKV69gcjiaOy7lWDEUDXI8uKHfiYAtRO+vOUnu4IWNLeaLBj0w== X-Received: by 2002:a1c:dd06:: with SMTP id u6mr4800727wmg.109.1573574703569; Tue, 12 Nov 2019 08:05:03 -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 d13sm19698453wrq.51.2019.11.12.08.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 08:05:02 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 2/3] target/microblaze: Plug temp leaks with delay slot setup Date: Tue, 12 Nov 2019 17:04:48 +0100 Message-Id: <20191112160449.29212-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112160449.29212-1-edgar.iglesias@gmail.com> References: <20191112160449.29212-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::336 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@xilinx.com, peter.maydell@linaro.org 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. Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- 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 c8442b18e1..7b4b66a622 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1177,6 +1177,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; @@ -1188,10 +1199,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)) { @@ -1250,10 +1258,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); @@ -1355,10 +1360,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 Tue Nov 12 16:04:49 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: 11239747 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 1E79E14E5 for ; Tue, 12 Nov 2019 16:10:00 +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 E8AC220679 for ; Tue, 12 Nov 2019 16:09:59 +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="OFdp0Jqi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8AC220679 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]:37188 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYju-0001tO-V5 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 12 Nov 2019 11:09:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50247) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iUYfH-0004PA-4h for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iUYfG-0007Ka-21 for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:11 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:51440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iUYfF-0007K7-Rq for qemu-devel@nongnu.org; Tue, 12 Nov 2019 11:05:09 -0500 Received: by mail-wm1-x335.google.com with SMTP id q70so3828772wme.1 for ; Tue, 12 Nov 2019 08:05:09 -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=O+7oqTj35SxpOp+OUToP9NWOXc7v9VZvqQg34DnV5Ds=; b=OFdp0JqiIAONYGeN+hkG6JSO0zYB6BSrVhvq09qzUANFF/EE17xkUS7THVsOWvCi0S u5ThIenbyRXW1VpaCOItFgB4j+mNk2Vaio/Bb2N+hjG4SdxCgb9iDuz9ARCRnhrEJna6 RdANw84dWoBaTNy3+Alyr4lRAfHLfVxKZBJMXAb10IJyxXVYlOQZrHxaJHXTDuITvwKT eZnDsMd3ZdpHZQB9lWinBOspeLSCORUSwHmxoHZPPthD/Dc7T7flqElvsfYRa5iio/LW nWYIdL7JxbE4eNHQp8xNbuZ9/YbEyZFddJAMGBVQ8lJwXiMZ8C2bMZrzySeACYDAKLiu 7s2w== 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=O+7oqTj35SxpOp+OUToP9NWOXc7v9VZvqQg34DnV5Ds=; b=JHsOvf5wfCiN+eEGISsMaqyQf/SdnN60XdKp+6gxQ8Wdh3Iq4Jbj7JsZr3fpuLkind 60KeCoNohXnqT8Gr8BkH7SvvkqY5N2dTe4nePBI6EMe1iMVvNVeVmEB2fUVUrR/gKbDq asUDqReHS7ZIUVk76l3NGsidBw50SyfiMVp8TdHqlNsABbPUd5LkMLOPwrno1foq7RPL 9mwrOBbnfaT+IlXiiww25t2mp5y9Xwn1CiNK6R5EgrL/9RXnhbhf/7p+1cRHMOYFdAnV IV27B4N7b+wx0beVSXAkA57dG9z3HUkXsQIRv3PkDvx8J89NoCrZ6GyNqpbxnmjlOp4x v/EA== X-Gm-Message-State: APjAAAWGvoBpc6MjnroKam7J9yw0uL4wWLWTEBrKUA2BDPlmIOZ+/Ccp TgY5mYZM2BW71q74+rFy3FdRiGxfqMU= X-Google-Smtp-Source: APXvYqwrFiH475fyasK7r7vWWq82Dw43WtuYuphWVqvJx8Y9nz1lC+jwRGsHgRTqdSmFazHdGprq7A== X-Received: by 2002:a7b:c776:: with SMTP id x22mr4478483wmk.144.1573574708500; Tue, 12 Nov 2019 08:05:08 -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 v6sm16175841wrt.13.2019.11.12.08.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Nov 2019 08:05:07 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PULL v1 3/3] target/microblaze: Plug temp leak around eval_cond_jmp() Date: Tue, 12 Nov 2019 17:04:49 +0100 Message-Id: <20191112160449.29212-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191112160449.29212-1-edgar.iglesias@gmail.com> References: <20191112160449.29212-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::335 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@xilinx.com, peter.maydell@linaro.org 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(). Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Edgar E. Iglesias --- 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 7b4b66a622..bdc7d5326a 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -1681,7 +1681,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);