From patchwork Wed Jan 16 16:49:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Roth X-Patchwork-Id: 213003 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 37BFE2C0090 for ; Thu, 17 Jan 2013 06:17:17 +1100 (EST) Received: from localhost ([::1]:54083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvYU7-0004Xu-AT for incoming@patchwork.ozlabs.org; Wed, 16 Jan 2013 14:17:15 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWH1-0004YG-LW for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:55:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TvWGw-00075u-Mc for qemu-devel@nongnu.org; Wed, 16 Jan 2013 11:55:35 -0500 Received: from mail-ie0-f179.google.com ([209.85.223.179]:57771) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TvWGw-00075e-Fv; Wed, 16 Jan 2013 11:55:30 -0500 Received: by mail-ie0-f179.google.com with SMTP id k14so2922901iea.10 for ; Wed, 16 Jan 2013 08:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=D6lskIiN+aLjrVvf54NiG5ukQ8iF5fdB9J6Qxh45zU0=; b=XzZbBX2UO25atR2yj4psOXhsVaA4kSjECYaB8qVnTnLp9JdV/O3Xf9CzMR5r17x2gC o9h4sdiMBnxqCn4nXdmGhHA2R6AqmUr6v1IN3ruYXH7twHeda+TbLZPXzblpeXDTLRr+ AIjOlDdLbA3DEakw9AJ9L3OU0Dnm55E2Blrqb35HOPwhDAoPOkma26sf8oDBnNTSHRkv 69XWUcHWYF2QWlXSYlMawLTJMyXukuvlUNklBrMq5UNyngzJKVOMAwj9hXyEznTO1hhc bpv7obsX3HuU5TqEqNCO57D8gbM6S/BR6PtgRlyevPbdf9czUSa8H3nkKTPqD7X38hBz JQXw== X-Received: by 10.50.10.130 with SMTP id i2mr5233611igb.63.1358355329882; Wed, 16 Jan 2013 08:55:29 -0800 (PST) Received: from localhost ([32.97.110.59]) by mx.google.com with ESMTPS id ui8sm3588221igb.14.2013.01.16.08.55.28 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 16 Jan 2013 08:55:29 -0800 (PST) From: Michael Roth To: qemu-devel@nongnu.org Date: Wed, 16 Jan 2013 10:49:19 -0600 Message-Id: <1358354963-9070-18-git-send-email-mdroth@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358354963-9070-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1358354963-9070-1-git-send-email-mdroth@linux.vnet.ibm.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.223.179 Cc: aliguori@us.ibm.com, qemu-stable@nongnu.org Subject: [Qemu-devel] [PATCH 17/21] 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) *modified to use older global version of gen_opc_instr_start Signed-off-by: Michael Roth --- 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 e5a3f49..87f26c2 100644 --- a/target-xtensa/translate.c +++ b/target-xtensa/translate.c @@ -2962,7 +2962,11 @@ static void gen_intermediate_code_internal( gen_icount_end(tb, insn_count); *tcg_ctx.gen_opc_ptr = INDEX_op_end; - if (!search_pc) { + if (search_pc) { + j = tcg_ctx.gen_opc_ptr - tcg_ctx.gen_opc_buf; + memset(gen_opc_instr_start + lj + 1, 0, + (j - lj) * sizeof(gen_opc_instr_start[0])); + } else { tb->size = dc.pc - pc_start; tb->icount = insn_count; }