[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 19/25] target/nios2: Use gen_io_start around wrctl instruction
From: |
Peter Maydell |
Subject: |
[PULL 19/25] target/nios2: Use gen_io_start around wrctl instruction |
Date: |
Mon, 13 Jul 2020 15:10:58 +0100 |
From: Wentong Wu <wentong.wu@intel.com>
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>
---
target/nios2/translate.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index c2a134f932d..9824544eb37 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
}
--
2.20.1
- [PULL 12/25] osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL, (continued)
- [PULL 12/25] osdep.h: For Haiku, define SIGIO as equivalent to SIGPOLL, Peter Maydell, 2020/07/13
- [PULL 14/25] util/compatfd.c: Only include <sys/syscall.h> if CONFIG_SIGNALFD, Peter Maydell, 2020/07/13
- [PULL 13/25] bswap.h: Include <endian.h> on Haiku for bswap operations, Peter Maydell, 2020/07/13
- [PULL 15/25] util/oslib-posix.c: Implement qemu_init_exec_dir() for Haiku, Peter Maydell, 2020/07/13
- [PULL 16/25] util/drm: make portable by avoiding struct dirent d_type, Peter Maydell, 2020/07/13
- [PULL 18/25] target/nios2: in line the semantics of DISAS_UPDATE with other targets, Peter Maydell, 2020/07/13
- [PULL 17/25] target/nios2: add DISAS_NORETURN case for nothing more to generate, Peter Maydell, 2020/07/13
- [PULL 22/25] hw/arm/tosa: Encapsulate misc GPIO handling in a device, Peter Maydell, 2020/07/13
- [PULL 21/25] hw/arm/tosa.c: Detabify, Peter Maydell, 2020/07/13
- [PULL 23/25] hw/arm/palm.c: Detabify, Peter Maydell, 2020/07/13
- [PULL 19/25] target/nios2: Use gen_io_start around wrctl instruction,
Peter Maydell <=
- [PULL 20/25] hw/nios2: exit to main CPU loop only when unmasking interrupts, Peter Maydell, 2020/07/13
- [PULL 24/25] hw/arm/palm.c: Encapsulate misc GPIO handling in a device, Peter Maydell, 2020/07/13
- [PULL 25/25] hw/arm/aspeed: Do not create and attach empty SD cards by default, Peter Maydell, 2020/07/13
- Re: [PULL 00/25] target-arm queue, Peter Maydell, 2020/07/13