From patchwork Sun Jan 15 21:10:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 9517721 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 7CE0960209 for ; Sun, 15 Jan 2017 21:11:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4061E205F6 for ; Sun, 15 Jan 2017 21:11:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35B0626CF9; Sun, 15 Jan 2017 21:11:32 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, 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 D324726538 for ; Sun, 15 Jan 2017 21:11:31 +0000 (UTC) Received: from localhost ([::1]:52946 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSs5L-0006B3-4I for patchwork-qemu-devel@patchwork.kernel.org; Sun, 15 Jan 2017 16:11:31 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSs4j-00068G-VH for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:10:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSs4j-0002pU-6d for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:10:53 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:36195) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSs4j-0002pA-0m for qemu-devel@nongnu.org; Sun, 15 Jan 2017 16:10:53 -0500 Received: by mail-pg0-x241.google.com with SMTP id 75so3586779pgf.3 for ; Sun, 15 Jan 2017 13:10:52 -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; bh=ouyGjrcQqoPa/yjijSYUlgb1oZFq2cQotrUO/2Mcc70=; b=WmS1ssW7kflwrZ/ASwJb/RRr8/E+52+SA/HF8QrbywjwS7gPx9W7AQdhu1j3V4xCUe M+MbPCBPhZ668tO32pMK1+wYHRz62YqzjaIj3oA3iAASu26PkNiyb87w4RLDPGpP/oti pOWXGNgKH8MR0UEjyuwGyu7vgyLFd4CqnWuYaHLKFAsWhGnb2ovTgZl3X1k6A6rjEfju 6hZ6OWAm5wglqwVYjUC0aYOcIhvTfISLBLUTqaw3e4iYWXrDBoROMU3KMS5jCNz8F5gd Uo0l9UwMxE9pZBH7YqZnzR8CRLVKkbbUAOBA4UmV2lJ2F51NmM+N5kPpPn5F1M6vPyXD pOCw== 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; bh=ouyGjrcQqoPa/yjijSYUlgb1oZFq2cQotrUO/2Mcc70=; b=nAOgWiPKeDJry+6TkxfNJfe6n7mBpI6sHAsmRiEI25+hmrD9GuoivlpNjlYFancoym KDm9SHnVPDUznUd1Zzm93smH1r3X9o/lcnsyHjOPn7y9WKYNIikoI2BfjP/FrPtkGGH9 WXl+KhmjWZPXyuuIHMMJQgD1ASZI4KTU9H1ifzhZZh7JtFysFuiFVY4eQu+nhTtvQurT 9fektsaLKwOKjap/agJRB9bqWnkOFneGz0ri7azdlaKDJ/tfSPziObgX+tCcbwLvXMr6 qaEvhpRNmbq0jLYoaJBs1EDM3ggZwjkgiZ7E1S1aZk1xNVC6iCH98hd/so6z2pTzcOT6 2NjA== X-Gm-Message-State: AIkVDXIfh00oVlfYm1a9cMVsK3Kb1yM/FBU+FoE+fNJeaUCDANGXQrGSALmW8SzwpK2FoA== X-Received: by 10.84.212.144 with SMTP id e16mr45320387pli.140.1484514652242; Sun, 15 Jan 2017 13:10:52 -0800 (PST) Received: from octofox.net (c-73-202-152-109.hsd1.ca.comcast.net. [73.202.152.109]) by smtp.gmail.com with ESMTPSA id y15sm42626323pgc.43.2017.01.15.13.10.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 15 Jan 2017 13:10:51 -0800 (PST) From: Max Filippov To: qemu-devel@nongnu.org Date: Sun, 15 Jan 2017 13:10:13 -0800 Message-Id: <1484514617-11726-4-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484514617-11726-1-git-send-email-jcmvbkbc@gmail.com> References: <1484514617-11726-1-git-send-email-jcmvbkbc@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [PATCH 3/7] target/xtensa: don't continue translation after exception 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: Max Filippov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There's no point in continuing translating guest instructions once an unconditional exception is thrown. There's also no point in updating pc before any instruction is translated, don't do it. Signed-off-by: Max Filippov --- target/xtensa/translate.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 96c64d6..7a198fa 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -3152,8 +3152,11 @@ void gen_intermediate_code(CPUXtensaState *env, TranslationBlock *tb) goto done; } if (tb->flags & XTENSA_TBFLAG_EXCEPTION) { - tcg_gen_movi_i32(cpu_pc, dc.pc); + tcg_gen_insn_start(dc.pc); + ++insn_count; gen_exception(&dc, EXCP_DEBUG); + dc.is_jmp = DISAS_UPDATE; + goto done; } do {