qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Filippov <jcmvbkbc@gmail.com>
To: qemu-devel@nongnu.org
Cc: Max Filippov <jcmvbkbc@gmail.com>
Subject: [Qemu-devel] [PATCH 3/7] target/xtensa: don't continue translation after exception
Date: Sun, 15 Jan 2017 13:10:13 -0800	[thread overview]
Message-ID: <1484514617-11726-4-git-send-email-jcmvbkbc@gmail.com> (raw)
In-Reply-To: <1484514617-11726-1-git-send-email-jcmvbkbc@gmail.com>

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 <jcmvbkbc@gmail.com>
---
 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 {
-- 
2.1.4

  parent reply	other threads:[~2017-01-15 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-15 21:10 [Qemu-devel] [PATCH 0/7] target/xtensa: refactor timers Max Filippov
2017-01-15 21:10 ` [Qemu-devel] [PATCH 1/7] target/xtensa: refactor CCOUNT/CCOMPARE Max Filippov
2017-01-15 21:10 ` [Qemu-devel] [PATCH 2/7] target/xtensa: support icount Max Filippov
2017-01-15 21:10 ` Max Filippov [this message]
2017-01-15 21:10 ` [Qemu-devel] [PATCH 4/7] target/xtensa: tests: run tests with icount Max Filippov
2017-01-15 21:10 ` [Qemu-devel] [PATCH 5/7] target/xtensa: tests: fix timer tests Max Filippov
2017-01-15 21:10 ` [Qemu-devel] [PATCH 6/7] target/xtensa: tests: replace hardcoded interrupt masks Max Filippov
2017-01-15 21:10 ` [Qemu-devel] [PATCH 7/7] target/xtensa: tests: add ccount write tests Max Filippov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1484514617-11726-4-git-send-email-jcmvbkbc@gmail.com \
    --to=jcmvbkbc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).