aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWentong Wu <wentong.wu@intel.com>2020-07-13 14:36:11 +0100
committerPeter Maydell <peter.maydell@linaro.org>2020-07-13 14:36:11 +0100
commit77b3f2af57a37b1c30174a911e03d6ff715ef4aa (patch)
tree39e2d2b38bb967d4d7a753fe490c71a9ef64b0ea
parentc7694535718273c5a38c18a0f08e48509ba26e38 (diff)
downloadqemu-77b3f2af57a37b1c30174a911e03d6ff715ef4aa.zip
qemu-77b3f2af57a37b1c30174a911e03d6ff715ef4aa.tar.gz
qemu-77b3f2af57a37b1c30174a911e03d6ff715ef4aa.tar.bz2
target/nios2: Use gen_io_start around wrctl instruction
wrctl instruction on nios2 target will cause checking cpu interrupt but tcg_handle_interrupt() will call cpu_abort() if the CPU gets an interrupt while it's not in 'can do IO' state, so add gen_io_start around wrctl instruction. Also at the same time, end the onging TB with DISAS_UPDATE. Signed-off-by: Wentong Wu <wentong.wu@intel.com> Message-id: 20200710233433.19729-3-wentong.wu@intel.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--target/nios2/translate.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index c2a134f..9824544 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -32,6 +32,7 @@
#include "exec/cpu_ldst.h"
#include "exec/translator.h"
#include "qemu/qemu-print.h"
+#include "exec/gen-icount.h"
/* is_jmp field values */
#define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */
@@ -518,7 +519,11 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags)
/* If interrupts were enabled using WRCTL, trigger them. */
#if !defined(CONFIG_USER_ONLY)
if ((instr.imm5 + CR_BASE) == CR_STATUS) {
+ if (tb_cflags(dc->tb) & CF_USE_ICOUNT) {
+ gen_io_start();
+ }
gen_helper_check_interrupts(dc->cpu_env);
+ dc->is_jmp = DISAS_UPDATE;
}
#endif
}