aboutsummaryrefslogtreecommitdiff
path: root/cpus.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 /cpus.c
parentb4ac20b4df0d1eaa5d546ccb84751e3e97d257fd (diff)
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 'cpus.c')
-rw-r--r--cpus.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index 0c33458bb1..91119bb864 100644
--- a/cpus.c
+++ b/cpus.c
@@ -934,6 +934,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
qemu_mutex_lock(&qemu_global_mutex);
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
+ cpu->exception_index = -1;
current_cpu = cpu;
r = kvm_init_vcpu(cpu);
@@ -974,6 +975,7 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
+ cpu->exception_index = -1;
sigemptyset(&waitset);
sigaddset(&waitset, SIG_IPI);
@@ -1016,6 +1018,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
CPU_FOREACH(cpu) {
cpu->thread_id = qemu_get_thread_id();
cpu->created = true;
+ cpu->exception_index = -1;
}
qemu_cond_signal(&qemu_cpu_cond);