From patchwork Mon Feb 4 10:41:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 217920 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0BC9C2C0087 for ; Tue, 5 Feb 2013 00:31:05 +1100 (EST) Received: from localhost ([::1]:46803 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2Jbg-0004uH-Qc for incoming@patchwork.ozlabs.org; Mon, 04 Feb 2013 05:49:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JbU-0004i1-BN for qemu-devel@nongnu.org; Mon, 04 Feb 2013 05:48:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U2JbR-0002vw-Ai for qemu-devel@nongnu.org; Mon, 04 Feb 2013 05:48:48 -0500 Received: from isrv.corpit.ru ([86.62.121.231]:57960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U2JbR-0002ve-4S; Mon, 04 Feb 2013 05:48:45 -0500 Received: from gandalf.tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by isrv.corpit.ru (Postfix) with ESMTP id 67C3FA03FB; Mon, 4 Feb 2013 14:48:44 +0400 (MSK) Received: by gandalf.tls.msk.ru (Postfix, from userid 1000) id B646254D; Mon, 4 Feb 2013 14:41:29 +0400 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Date: Mon, 4 Feb 2013 14:41:06 +0400 Message-Id: <1359974470-17044-57-git-send-email-mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1359974470-17044-1-git-send-email-mjt@msgid.tls.msk.ru> References: <1359974470-17044-1-git-send-email-mjt@msgid.tls.msk.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 86.62.121.231 Cc: Blue Swirl , Max Filippov , Michael Tokarev , qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 56/60] target-xtensa: fix search_pc for the last TB opcode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Max Filippov Zero out tcg_ctx.gen_opc_instr_start for instructions representing the last guest opcode in the TB. Cc: qemu-stable@nongnu.org Signed-off-by: Max Filippov Signed-off-by: Blue Swirl (cherry picked from commit 36f25d2537c40c6c47f4abee5d31a24863d1adf7) Signed-off-by: Michael Tokarev --- target-xtensa/translate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target-xtensa/translate.c b/target-xtensa/translate.c index 94c51ae..cc82cd9 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -2654,7 +2654,11 @@ static void gen_intermediate_code_internal( gen_icount_end(tb, insn_count); *gen_opc_ptr = INDEX_op_end; - if (!search_pc) { + if (search_pc) { + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; + memset(tcg_ctx.gen_opc_instr_start + lj + 1, 0, + (j - lj) * sizeof(tcg_ctx.gen_opc_instr_start[0])); + } else { tb->size = dc.pc - pc_start; tb->icount = insn_count; }