summaryrefslogtreecommitdiff
path: root/cpu-exec.c
diff options
context:
space:
mode:
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>2014-11-26 13:39:20 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2014-12-15 12:21:02 +0100
commite511b4d783c47a32420da802104cfb0eb974b22f (patch)
treecbc62197621a3eb2512913c2c260e77a6d91e3bc /cpu-exec.c
parentb4ac20b4df0d1eaa5d546ccb84751e3e97d257fd (diff)
downloadqemu-e511b4d783c47a32420da802104cfb0eb974b22f.tar.gz
qemu-e511b4d783c47a32420da802104cfb0eb974b22f.tar.bz2
qemu-e511b4d783c47a32420da802104cfb0eb974b22f.zip
cpu-exec: reset exception_index correctly
Exception index is reset at every entry at every entry into cpu_exec() function. This may cause missing the exceptions while replaying them. This patch moves exception_index reset to the locations where they are processed. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpu-exec.c')
-rw-r--r--cpu-exec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpu-exec.c b/cpu-exec.c
index 8830255db3..4df98567ce 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -358,7 +358,6 @@ int cpu_exec(CPUArchState *env)
}
cc->cpu_exec_enter(cpu);
- cpu->exception_index = -1;
/* Calculate difference between guest clock and host clock.
* This delay includes the delay of the last cycle, so
@@ -378,6 +377,7 @@ int cpu_exec(CPUArchState *env)
if (ret == EXCP_DEBUG) {
cpu_handle_debug_exception(env);
}
+ cpu->exception_index = -1;
break;
} else {
#if defined(CONFIG_USER_ONLY)
@@ -388,6 +388,7 @@ int cpu_exec(CPUArchState *env)
cc->do_interrupt(cpu);
#endif
ret = cpu->exception_index;
+ cpu->exception_index = -1;
break;
#else
cc->do_interrupt(cpu);