From nobody Fri Apr 26 19:31:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1573217101; cv=none; d=zoho.com; s=zohoarc; b=DOHB22/qXWtL/za0ti2q0D+1YL/uEGXK4ICWHBMJXkbR6W26O2DWcTnAB1x64A0I1eo0zVz1MrsoQS5m+QGIfQ5+EBDnF63qzeI9JVKjVxEeIfqVPVrrWgi4O1y34VLP4MG2O3M3UHkYh9mYByMnKF/tFZGl2838p0sEd3NJmeM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573217101; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9JFteoyFShjxDG1bJSY5A5RCb3N4szoLWvl3shrMJDg=; b=HCaGhJlbyUPocOZfkjFtYcjrtn3YkjE+7ITcEeA7+HR+0QOVlH532oqjZAmx+VKSATENCwoO5baEjRoaeefTMwe9lHtpenImYlQm7UQJbztG9Jms+IBJoMFcBXIYuFpfncBCTTL5qEPPRrw21j5CV3MqitKuXS/kWLAnZEYvhkM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573217101974764.86239450117; Fri, 8 Nov 2019 04:45:01 -0800 (PST) Received: from localhost ([::1]:53240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3dM-0003KW-KK for importer@patchew.org; Fri, 08 Nov 2019 07:45:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45981) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3bB-0001b1-TW for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iT3bA-0000Ot-MZ for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:45 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:52308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iT3bA-0000L7-Ez for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:44 -0500 Received: by mail-wm1-x341.google.com with SMTP id c17so6058217wmk.2 for ; Fri, 08 Nov 2019 04:42:44 -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 r5sm5732026wrl.86.2019.11.08.04.42.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 04:42:42 -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=9JFteoyFShjxDG1bJSY5A5RCb3N4szoLWvl3shrMJDg=; b=SVhQ8nIfLm3NFz7n5Kn4X5uEqIW83SpAoIQ/IIyUNKA/lBQCXm35v58588Et/vlL7D KQYP8rjXad7zUuDccUzsuRKbGOob7Q/+oceNQNzn+eqBQYP2LF22HlAroO0zm6tRjxyM Q9akNDHp3tZvGfOc+uqNMv85uQjyEKqjLBsFbJO1VWJn+d/AeEUkkzxWEJ/+5W4gExd3 N0cUe0baUvO2tzbqQHPztxP1YVls9EQidlISgdGVBZHCCeGY7NYSpPQGTArijCn7B/ss MoZYGtQASS0e65P5ZCOxyHWQncZWr5iAkowMAKXnrZ0AxC0N3VysUB2oZpejIQpHNkYk XdFA== 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=9JFteoyFShjxDG1bJSY5A5RCb3N4szoLWvl3shrMJDg=; b=husZ+ukn7JSkhmySa+UkOdStOv3FpF3b3tSR61gR0tCLQdgTTdASVu658VfQWmBdgg uwQx+nwMTgqawMpQdhNmOc1YVw+2+0GqjayfXxO6WiZ8aKqEmVvwO1MjslRgF1AKI5PP NsqMoqEEXZyKzkdxrziPoKoast0AWVY95agzHP6X9oZwg1IfRrK4nwOTPEIfmTkQ2hyl K9x5qZ06a3d6VQm/Hr71Af6SB/PVXlB7TC1ympmykwlkbKxKjG4BknC1b59gvOBP3Byc 8Sgl3buPFmhzpRPk3KTSjihfuDqCTPulRZiPR2zEnnJORuj5AsAgdKfrQDcCX74IerJa K5tw== X-Gm-Message-State: APjAAAXFDdEOJCXM+J+O1AK+i3WAm0T6lSJyPmc1RywlVWeZnVHp0o+Y ZMj4lmqRe2lTmgC8REfZPqqQ6/X8s2o= X-Google-Smtp-Source: APXvYqzZd4QXgPqIW0fOYm22ZWWNYnvs84UVyFK8JJFkOon52ozmalhXCejj6PfioVXRAYxnHNuF2Q== X-Received: by 2002:a7b:c7c7:: with SMTP id z7mr7624314wmk.133.1573216962944; Fri, 08 Nov 2019 04:42:42 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] target/microblaze: Plug temp leaks for loads/stores Date: Fri, 8 Nov 2019 13:42:17 +0100 Message-Id: <20191108124219.31348-2-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108124219.31348-1-edgar.iglesias@gmail.com> References: <20191108124219.31348-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Simplify endian reversion of address also plugging TCG temp leaks for loads/stores. Suggested-by: Richard Henderson Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis Reviewed-by: Luc Michel Reviewed-by: Richard Henderson --- 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 =3D 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; } =20 @@ -1006,9 +996,16 @@ static void dec_load(DisasContext *dc) tcg_gen_qemu_ld_i32(v, addr, mem_index, mop); =20 if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + TCGv_i32 t0 =3D tcg_const_i32(0); + TCGv_i32 treg =3D tcg_const_i32(dc->rd); + TCGv_i32 tsize =3D 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); } =20 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 =3D 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; } =20 @@ -1124,6 +1111,10 @@ static void dec_store(DisasContext *dc) =20 /* Verify alignment if needed. */ if ((dc->cpu->env.pvr.regs[2] & PVR2_UNALIGNED_EXC_MASK) && size > 1) { + TCGv_i32 t1 =3D tcg_const_i32(1); + TCGv_i32 treg =3D tcg_const_i32(dc->rd); + TCGv_i32 tsize =3D 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); } =20 if (ex) { --=20 2.20.1 From nobody Fri Apr 26 19:31:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1573217165; cv=none; d=zoho.com; s=zohoarc; b=AIOmcpZcxm/BGi0KkO/J4DpGQUk432QInQ4OpYoekuDB2wUseVHFy9GiVTRYzWi7Tuwgi1vWtVUrezwjyBc/GnS9GHRk+RLh1OheK8oqWbHPkeqvGDlZucdZByQuGqPcKJcQ8Gylvs8v97VL/t11SGFlMwEvp6TBDjW1/46h0w8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573217165; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Rnzob+CMRQLWYBDPF8sebybDJvDCoUE2UV9qiBp+og0=; b=A2e3LgJcaQBt8/G9Pa3v63ZfXaHmi+UAwwb2RsCzbshs6ypo2lkUISmkdD935s3tvZvCojlZDznJ/Gjt+6L7B1i5K1KEwkv39n5XJoBfN21kYlznpxsiZxm4UFZNvPR5kyoH9DP4gNODDTtifBFGHtgSIC40IpU/IvAk3mzTErI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1573217165299148.64038457956042; Fri, 8 Nov 2019 04:46:05 -0800 (PST) Received: from localhost ([::1]:53250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3eM-0004J2-06 for importer@patchew.org; Fri, 08 Nov 2019 07:46:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:45995) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3bI-0001dS-CG for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iT3bG-0000Sy-Ml for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:52 -0500 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:41487) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iT3bG-0000RE-Dj for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:50 -0500 Received: by mail-wr1-x441.google.com with SMTP id p4so6895206wrm.8 for ; Fri, 08 Nov 2019 04:42:48 -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 h140sm7317035wme.22.2019.11.08.04.42.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 04:42:46 -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=ppY1d2fMM0ZJPtgAd4+5sYEv06JGyJQI9aq0jHHj8jMSk8SyChkZm/DPG1vVs580Zx RSI9gmdO5GCsDlSckWGjtITeQMRT3fLvTTMr6w6+00bh604GSyPdb5tHb4P9HQ4fd4X2 Ij5pFidqe7rXfX0BxqXSXOHYS5gxUfmCpB6eU1HM3dI6dW2Ks812iDLDGKrh0olHG8Jx bSCgVNQtZPnCV8E1tWKE96POC+5RKfBlNiWoVMxx2kwiBVGYAAQo4OaUF0FQaWRxphun g5E3V2EiV8Pbjs3LN9Kla9Ts9rhCuUAP+P5AoaVvyxLAAg+piB4Yv8H4fB4Ujs1ht1hz SUfQ== 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=EB/HU7s+NRLHCTu/3jxThe7q9kIkCwMvwAjz5xrnHGtFdVa8q1VafU119LaR7r1fQh J2UKdU5F+cETU4ZRhBwuv1KibNinbh5l4Y30/45sgV+3qzgpLTCK1qioTHEd0X6eU9b7 ZuBK5IZHKbQyByefy5o7lx2885tzpo2arec5C03schlXhB7H6YAshdgYvX1VTPj1RDcw fPdQ0twx6vmSNJrAjQzXLj2MKBXvH4S6We2ynHe0tC5Gkrce7boB4zClgSA7u3P1sNr8 Vwy+NTfgeBJ58kA2mQHA6EAECSSGIlaAzwryXUaey9cuJ+4WPatffIhXaRHG7PwFudU5 /Pnw== X-Gm-Message-State: APjAAAUD1PI8Nr9E0dTYU47Hwlmuj48Vtu8TLd/xjXNTXxPjf2hIC9BU ox8ngEU+uHi9+0373DJuHg32LdPxx1k= X-Google-Smtp-Source: APXvYqx8Y3Ze/r/BXgbjLD3/lMk+zF7PqpiGFuzW0XMcEoFEmazkDymrw/1d4zarJpqvKb0ZrK3LHg== X-Received: by 2002:a05:6000:12c4:: with SMTP id l4mr7890980wrx.110.1573216967513; Fri, 08 Nov 2019 04:42:47 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] target/microblaze: Plug temp leaks with delay slot setup Date: Fri, 8 Nov 2019 13:42:18 +0100 Message-Id: <20191108124219.31348-3-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108124219.31348-1-edgar.iglesias@gmail.com> References: <20191108124219.31348-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: "Edgar E. Iglesias" Plug temp leaks with delay slot setup. Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daud=C3=A9 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); } =20 +static void dec_setup_dslot(DisasContext *dc) +{ + TCGv_i32 tmp =3D tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_F= LAG)); + + dc->delayed_branch =3D 2; + dc->tb_flags |=3D 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) =20 dc->delayed_branch =3D 1; if (dslot) { - dc->delayed_branch =3D 2; - dc->tb_flags |=3D D_FLAG; - tcg_gen_st_i32(tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLA= G)), - cpu_env, offsetof(CPUMBState, bimm)); + dec_setup_dslot(dc); } =20 if (dec_alu_op_b_is_small_imm(dc)) { @@ -1250,10 +1258,7 @@ static void dec_br(DisasContext *dc) =20 dc->delayed_branch =3D 1; if (dslot) { - dc->delayed_branch =3D 2; - dc->tb_flags |=3D D_FLAG; - tcg_gen_st_i32(tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLA= G)), - 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; } =20 - dc->delayed_branch =3D 2; - dc->tb_flags |=3D 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); =20 if (i_bit) { LOG_DIS("rtid ir=3D%x\n", dc->ir); --=20 2.20.1 From nobody Fri Apr 26 19:31:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1573217105; cv=none; d=zoho.com; s=zohoarc; b=fJoxLesLwQPYmv1jCIQxA7l9AuOSgtPzmOdc2kNMYxaNGqraKRKiDBj5mUQNaBq07qnDeCOJwrOqy5S0UpGFcOlssskHi7ktNLv18K9RVTPmFHPq4e9TCW8TvYb90de/mBw+yhAhNFEFWwhHfI17GDeSlSOHvZtV1Vki2Y0YZl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1573217105; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O+7oqTj35SxpOp+OUToP9NWOXc7v9VZvqQg34DnV5Ds=; b=AGxLjA63jWkrMsDdAfjd4oWcW0bZonO7gVreGMWzg1yzuWskXXeVwdbpRr0s1vOnrbiNJY5OJAujwB5+jK+Mx9HJSDHQSLBreLv9n1dAULXKN9VI7KSOgMEM8nNASmtBAza/uO2pdSiXsLQaVZChMGEhUlvQBgirzgxnbFcHdNA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 157321710515150.198518592531855; Fri, 8 Nov 2019 04:45:05 -0800 (PST) Received: from localhost ([::1]:53242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3dO-0003NE-Q1 for importer@patchew.org; Fri, 08 Nov 2019 07:45:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46008) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT3bM-0001eR-A5 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iT3bK-0000Uu-A0 for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:55 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:33483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iT3bJ-0000U6-BB for qemu-devel@nongnu.org; Fri, 08 Nov 2019 07:42:54 -0500 Received: by mail-wr1-x443.google.com with SMTP id w9so103974wrr.0 for ; Fri, 08 Nov 2019 04:42:53 -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 m15sm5866397wrq.97.2019.11.08.04.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 04:42:51 -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=Rlqgxq+M3G5kUDVU+FeUVLZznllzB9pffc+eViEeqPtm+9mu5sfblkggk1waBq03BT z/8CSPkONIGn0BqHooX5aUOBAR9YxqAsC4gagQlevPt2OtM2NFfpHKK0k/rmV45NDpp6 GWkp2Fsn7WxT2Fb7aiPDkSLdBqMFb2lXkFVoQ8puDhdO03vp6xPkRnR5Fa7Vzf3upFIy ZR/rHuzIThuwZswcItF9qn38SukPs886cTIBn2qsmS1lTCaIwuwQZBtkpNB0+RGMf7Z+ OoYu3y9u3r1oHN/KNFrBzHZWRojgNDOzmXX0r1blc7pNBTE1NqSknriMYzJFer7Ga+nt tVCQ== 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=BWcFq3F/EHEOxruVrqhHxcm8UgIccabQ1fOV3gJEJlHX7GMzWxcdwZRw6Q0bTGwBQo Npmr13zMJX4JLsqkKN+ClvUDAQDBiFvOtU0mOllKW6zFBaFInPnuLBDSUm7L+kdcAiRO LUnNS5FXrS5I/hvF9fnngtAGKXcTAlBWF9T5hDh6t6SHawumZjk8RfJtfl6rIi5SOvWO uxcX2bCkP7eISWa6AzDcHElUiRH5BjJ6sca16H26VyVQWRIMTEUpj8ipZY3M1AxSNjzC GL2rb0zIGX8Pf+tEum0HAQLJ/70csLLYga6UQfiUzEknheUg4Of5WdaEPRCxGdl8jNRV zs6A== X-Gm-Message-State: APjAAAVPG5HRDgsn+zT0dGlsbfJiAuLX1n6zWrf2StpnB3l58nlWnhCD jQcV1PJrw9zBVw/wH/f2aiYyFFN5RSA= X-Google-Smtp-Source: APXvYqxzRllVgQgIHOmx0PAmgeo+eQVh4kC2FW0ZuCWYbghhdgXmdZL6+5xthcNuOPkmxwxyrzLJ/A== X-Received: by 2002:a5d:4946:: with SMTP id r6mr7442094wrs.155.1573216972047; Fri, 08 Nov 2019 04:42:52 -0800 (PST) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] target/microblaze: Plug temp leak around eval_cond_jmp() Date: Fri, 8 Nov 2019 13:42:19 +0100 Message-Id: <20191108124219.31348-4-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191108124219.31348-1-edgar.iglesias@gmail.com> References: <20191108124219.31348-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::443 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: "Edgar E. Iglesias" Plug temp leak around eval_cond_jmp(). Reviewed-by: Luc Michel Reviewed-by: Philippe Mathieu-Daud=C3=A9 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, Translation= Block *tb, int max_insns) dc->tb_flags &=3D ~D_FLAG; /* If it is a direct jump, try direct chaining. */ if (dc->jmp =3D=3D JMP_INDIRECT) { - eval_cond_jmp(dc, env_btarget, tcg_const_i64(dc->pc)); + TCGv_i64 tmp_pc =3D tcg_const_i64(dc->pc); + eval_cond_jmp(dc, env_btarget, tmp_pc); + tcg_temp_free_i64(tmp_pc); + dc->is_jmp =3D DISAS_JUMP; } else if (dc->jmp =3D=3D JMP_DIRECT) { t_sync_flags(dc); --=20 2.20.1