From patchwork Fri Jul 14 00:18:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9839713 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 A517C602A0 for ; Fri, 14 Jul 2017 00:22:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5A0B2876D for ; Fri, 14 Jul 2017 00:22:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B98422876F; Fri, 14 Jul 2017 00:22:22 +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 6FCA62876D for ; Fri, 14 Jul 2017 00:22:22 +0000 (UTC) Received: from localhost ([::1]:34769 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVoNB-0005zx-Dt for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jul 2017 20:22:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVoJk-0003J9-7E for qemu-devel@nongnu.org; Thu, 13 Jul 2017 20:18:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVoJh-00009U-1v for qemu-devel@nongnu.org; Thu, 13 Jul 2017 20:18:48 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:33568) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVoJg-00009F-Tz for qemu-devel@nongnu.org; Thu, 13 Jul 2017 20:18:44 -0400 Received: by mail-qk0-x243.google.com with SMTP id a66so9259128qkb.0 for ; Thu, 13 Jul 2017 17:18:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=jZx9OxFQFgw/zbpVZRthrcso0ZrNZJa3h8FBH+q5FZ8=; b=POtPI9u+i6ekaGKFiBgO9QoQdjyEUNeeo3rXHxaf5+Wp3PFRH1rDbWOTR2w6XAiqux FvuOpsp95WuBF3/zoCmcTeVAMzBC2Y+6nUkHlJyna7unxJPzxwq9LYKhRb/RczS5sC0l 9BUK66X1ksJS6kfYKwY9BpP4UbwGAIp4iWDMW60bflYWPkwALUv8i7naAzUl3tgAcLae BVotyYyL32mTV3/jzlWxjMil41XLaV4JuhJfU3stUKbdxNcQUFckjNqP7gwaEeA4iS2E Hd2PlAfqY404WKGTQbrMU790eiQPACEmdvB7ywSjEmzJKx6tCg4rf3rRxSPradzKeEFo j0Pw== 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:subject:date:message-id :in-reply-to:references; bh=jZx9OxFQFgw/zbpVZRthrcso0ZrNZJa3h8FBH+q5FZ8=; b=uA0XEjdPxBfcQle15JgS5C6QkZcMLBd+zyjOiKFwVcxw755kPCITQsF+ApE7XFKpNB k5TQeahVLkXpp/ZUBNseuEC7qWkfqXLqm+Gg9UFmrppOOQWB6H46srWzKlMhpMnhu6jb bOkSiUoWQQBquocjkfs5InSqtUfShlm5odi/T0VgeKcLcxurySY+8/3qhN6lk4id7NNi Deh8ivJ1kIF0fBSWECxyzu90P5smRusPr/ry5m99HWx5JWOCjaaFf6SIJM1i/bk81tRl JXfXiCKCw1H2NnrJ/jVaVp2d2nGYs9bGN7kuEdfcceLr0+vWC6ycbgAZiMjHJEnT+byd IZ2Q== X-Gm-Message-State: AIVw110eisO9dgpi0Kesx/Cz6rYG9pQ1BCf6G6/CEAVPy0yoXxrlkBmJ eo2lFCzRfqLQuxkQQvQ= X-Received: by 10.55.54.196 with SMTP id d187mr7888177qka.96.1499991524295; Thu, 13 Jul 2017 17:18:44 -0700 (PDT) Received: from bigtime.twiddle.net.com (rrcs-173-197-98-123.west.biz.rr.com. [173.197.98.123]) by smtp.gmail.com with ESMTPSA id v47sm5647206qtb.11.2017.07.13.17.18.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jul 2017 17:18:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 13 Jul 2017 14:18:17 -1000 Message-Id: <20170714001819.1660-7-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170714001819.1660-1-rth@twiddle.net> References: <20170714001819.1660-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::243 Subject: [Qemu-devel] [PATCH 6/8] target/alpha: Fix temp leak in gen_call_pal 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: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Richard Henderson --- target/alpha/translate.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 5e37b1a..326af7f 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -1189,7 +1189,6 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode) #ifndef CONFIG_USER_ONLY /* Privileged PAL code */ if (palcode < 0x40 && (ctx->tbflags & ENV_FLAG_PS_USER) == 0) { - TCGv tmp; switch (palcode) { case 0x01: /* CFLUSH */ @@ -1222,10 +1221,12 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode) ld_flag_byte(ctx->ir[IR_V0], ENV_FLAG_PS_SHIFT); /* But make sure and store only the 3 IPL bits from the user. */ - tmp = tcg_temp_new(); - tcg_gen_andi_i64(tmp, ctx->ir[IR_A0], PS_INT_MASK); - st_flag_byte(tmp, ENV_FLAG_PS_SHIFT); - tcg_temp_free(tmp); + { + TCGv tmp = tcg_temp_new(); + tcg_gen_andi_i64(tmp, ctx->ir[IR_A0], PS_INT_MASK); + st_flag_byte(tmp, ENV_FLAG_PS_SHIFT); + tcg_temp_free(tmp); + } /* Allow interrupts to be recognized right away. */ tcg_gen_movi_i64(cpu_pc, ctx->pc); @@ -1254,9 +1255,12 @@ static ExitStatus gen_call_pal(DisasContext *ctx, int palcode) case 0x3E: /* WTINT */ - tmp = tcg_const_i64(1); - tcg_gen_st32_i64(tmp, cpu_env, -offsetof(AlphaCPU, env) + - offsetof(CPUState, halted)); + { + TCGv_i32 tmp = tcg_const_i32(1); + tcg_gen_st_i32(tmp, cpu_env, -offsetof(AlphaCPU, env) + + offsetof(CPUState, halted)); + tcg_temp_free_i32(tmp); + } tcg_gen_movi_i64(ctx->ir[IR_V0], 0); return gen_excp(ctx, EXCP_HALTED, 0);