[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC PATCH v6 07/32] cpu-exec: reset exception_index correc
From: |
Pavel Dovgalyuk |
Subject: |
[Qemu-devel] [RFC PATCH v6 07/32] cpu-exec: reset exception_index correctly |
Date: |
Mon, 08 Dec 2014 10:53:40 +0300 |
User-agent: |
StGit/0.16 |
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 <address@hidden>
---
cpu-exec.c | 3 ++-
cpus.c | 3 +++
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/cpu-exec.c b/cpu-exec.c
index 88675ca..0dff591 100644
--- a/cpu-exec.c
+++ b/cpu-exec.c
@@ -366,7 +366,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
@@ -386,6 +385,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)
@@ -396,6 +396,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);
diff --git a/cpus.c b/cpus.c
index a46182f..38af588 100644
--- a/cpus.c
+++ b/cpus.c
@@ -935,6 +935,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
cpu->can_do_io = 1;
+ cpu->exception_index = -1;
current_cpu = cpu;
r = kvm_init_vcpu(cpu);
@@ -976,6 +977,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
cpu->can_do_io = 1;
+ cpu->exception_index = -1;
sigemptyset(&waitset);
sigaddset(&waitset, SIG_IPI);
@@ -1019,6 +1021,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
cpu->can_do_io = 1;
+ cpu->exception_index = -1;
}
qemu_cond_signal(&qemu_cpu_cond);
- [Qemu-devel] [RFC PATCH v6 00/32] Deterministic replay core, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 01/32] i386: partial revert of interrupt poll fix, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 02/32] cpu-exec: fix cpu_exec_nocache, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 03/32] icount: set can_do_io outside TB execution, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 04/32] replay: global variables and function stubs, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 05/32] sysemu: system functions for replay, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 06/32] replay: internal functions for replay log, Pavel Dovgalyuk, 2014/12/08
- [Qemu-devel] [RFC PATCH v6 07/32] cpu-exec: reset exception_index correctly,
Pavel Dovgalyuk <=
- [Qemu-devel] [RFC PATCH v6 08/32] icount: implement icount requesting, Pavel Dovgalyuk, 2014/12/08
[Qemu-devel] [RFC PATCH v6 09/32] replay: introduce icount event, Pavel Dovgalyuk, 2014/12/08
[Qemu-devel] [RFC PATCH v6 10/32] i386: do not cross the pages boundaries in replay mode, Pavel Dovgalyuk, 2014/12/08
[Qemu-devel] [RFC PATCH v6 11/32] From 7abf2f72777958d395cfd01d97fe707cc06152b5 Mon Sep 17 00:00:00 2001, Pavel Dovgalyuk, 2014/12/08