From patchwork Tue May 29 10:50:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Edgar E. Iglesias" X-Patchwork-Id: 10435021 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 958C6602CC for ; Tue, 29 May 2018 11:22:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84E36286B9 for ; Tue, 29 May 2018 11:22:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 78AE7286E5; Tue, 29 May 2018 11:22:42 +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=-3.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FSL_HELO_FAKE, MAILING_LIST_MULTI, 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 DD1EC286B9 for ; Tue, 29 May 2018 11:22:41 +0000 (UTC) Received: from localhost ([::1]:60268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNci8-0008OC-UK for patchwork-qemu-devel@patchwork.kernel.org; Tue, 29 May 2018 07:22:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNcDY-0001o2-RO for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNcDV-0004Es-G8 for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:04 -0400 Received: from mail-wr0-x22a.google.com ([2a00:1450:400c:c0c::22a]:38301) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNcDV-0004EB-9S for qemu-devel@nongnu.org; Tue, 29 May 2018 06:51:01 -0400 Received: by mail-wr0-x22a.google.com with SMTP id 94-v6so24688382wrf.5 for ; Tue, 29 May 2018 03:51:01 -0700 (PDT) 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=GRZeGHi0CRackZwvVvAMSL4+7UTu1CRrGMTnG6O9D4c=; b=F6NM1L+GqXAMArkRRw+idQV5IQbx+8e0Q5gpTNWpo6u7bJOBGgexzg5IHVW4XW+AFW 8JeRkmRYqz46/vxct2jyXanbmBMk+gvHqOEAkKbvNxgAJ0X6RRZYCFExwY0FYoz100JE QOeBgZ82moZFPPZRsFUlh15BFnn0hJNtBVjlua31W5CGP6Uv6NsJzFnX+HpT3NPLvxeR jd4wF8BKaL92wpzN/MdQznR+OzIK0u7QHReL+gqaExXMVoOtAwSjwk4U+mjlTLIgEjCI RcbByoMGgApC1NXYWiQq+NXSD23njhu29/m8jRTvMAyJafaAuemg19YDXjS+hJUrqRkz AQXw== 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=GRZeGHi0CRackZwvVvAMSL4+7UTu1CRrGMTnG6O9D4c=; b=bOIpXSSpKa3ATS9qDG0sZHdbl/hTJwGRTuOWXuXu4KuPfFZgkV8JFD0GXhYK/VN4CV JHLtpkZKHqArt1ZDTFngDF6Rmlj3ua7ZOCYWtejh2B3uadjZUWn0w7OUTS2mMX6VuNLB ENQVPUTgvYcbbl791nRA43JTqUJNt2CFCsfV9LAMuyhK4n1YrnXvoT0A5m32mqoJYweV H/eK2fvJrfD8qi7AVkBSSCwhkU0NDvyAvG2TM8Up6s0KtfOua6AhA8O5+V43dj4Sji4F eh3YumuQuSlcLSEUdLjyXJHnsDHnche4l5ioVpgpN2Qt2O6h3QlKFtVis+MVunylvv0X 1YOQ== X-Gm-Message-State: ALKqPwc+zrtpahwiqYDXagqYs1YQb7JarB08/HGnMKBkfCG/8vNhZhrE zw4tAKdwPK03G+TaC38cHGagwA== X-Google-Smtp-Source: ADUXVKIddtcnmGCxl1yi0EcSF/rABJVrWY+Bl35mvzLIjF/u9U3nj1XtM65seuKF66HN7TaHimA1RQ== X-Received: by 2002:a19:5004:: with SMTP id e4-v6mr9017010lfb.78.1527591059886; Tue, 29 May 2018 03:50:59 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id n3-v6sm6375578ljg.16.2018.05.29.03.50.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 03:50:58 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Date: Tue, 29 May 2018 12:50:01 +0200 Message-Id: <20180529105011.1914-29-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180529105011.1914-1-edgar.iglesias@gmail.com> References: <20180529105011.1914-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:400c:c0c::22a Subject: [Qemu-devel] [PULL v1 28/38] target-microblaze: dec_msr: Plug a temp leak 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: edgar.iglesias@xilinx.com, peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Edgar E. Iglesias" Plug a temp leak. Reported-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Edgar E. Iglesias --- target/microblaze/translate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c index 7475003847..756d901eba 100644 --- a/target/microblaze/translate.c +++ b/target/microblaze/translate.c @@ -516,12 +516,17 @@ static void dec_msr(DisasContext *dc) #if !defined(CONFIG_USER_ONLY) /* Catch read/writes to the mmu block. */ if ((sr & ~0xff) == 0x1000) { + TCGv_i32 tmp_sr; + sr &= 7; + tmp_sr = tcg_const_i32(sr); LOG_DIS("m%ss sr%d r%d imm=%x\n", to ? "t" : "f", sr, dc->ra, dc->imm); - if (to) - gen_helper_mmu_write(cpu_env, tcg_const_i32(sr), cpu_R[dc->ra]); - else - gen_helper_mmu_read(cpu_R[dc->rd], cpu_env, tcg_const_i32(sr)); + if (to) { + gen_helper_mmu_write(cpu_env, tmp_sr, cpu_R[dc->ra]); + } else { + gen_helper_mmu_read(cpu_R[dc->rd], cpu_env, tmp_sr); + } + tcg_temp_free_i32(tmp_sr); return; } #endif