[Qemu-devel] [RFCPATCH19/20] cpu-exec: reset exit flag before calling cpu_exec_nocache

Pavel Dovgalyuk posted 1 patch 6 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20171031104923.3079.56109.stgit@pasha-VirtualBox
Test checkpatch passed
Test docker passed
Test ppc passed
Test s390x passed
accel/tcg/cpu-exec.c |    1 +
1 file changed, 1 insertion(+)
[Qemu-devel] [RFCPATCH19/20] cpu-exec: reset exit flag before calling cpu_exec_nocache
Posted by Pavel Dovgalyuk 6 years, 5 months ago
This patch resets icount_decr.u32.high before calling cpu_exec_nocache
when exception is pending. Exception is caused by the first instruction
in the block and it cannot be executed without resetting the flag.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
---
 accel/tcg/cpu-exec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c
index 35d0240..aaa9c2d 100644
--- a/accel/tcg/cpu-exec.c
+++ b/accel/tcg/cpu-exec.c
@@ -500,6 +500,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, int *ret)
     } else if (replay_has_exception()
                && cpu->icount_decr.u16.low + cpu->icount_extra == 0) {
         /* try to cause an exception pending in the log */
+        atomic_set(&cpu->icount_decr.u16.high, 0);
         cpu_exec_nocache(cpu, 1, tb_find(cpu, NULL, 0, curr_cflags()), true);
         *ret = -1;
         return true;