summaryrefslogtreecommitdiffstats
path: root/cpus.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2015-07-09 08:55:38 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2015-07-24 13:57:45 +0200
commitab28bd23125fb4a0411c3a3f01c4edacbc261486 (patch)
tree50cf40b9f83a43d2a7b6dee4a801e6c31fc409ee /cpus.c
parentc170aad8b057223b1139d72e5ce7acceafab4fa9 (diff)
downloadhqemu-ab28bd23125fb4a0411c3a3f01c4edacbc261486.zip
hqemu-ab28bd23125fb4a0411c3a3f01c4edacbc261486.tar.gz
rcu: actually register threads that have RCU read-side critical sections
Otherwise, grace periods are detected too early! Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index b00a423..a822ce3 100644
--- a/cpus.c
+++ b/cpus.c
@@ -954,6 +954,8 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
CPUState *cpu = arg;
int r;
+ rcu_register_thread();
+
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
@@ -995,6 +997,8 @@ static void *qemu_dummy_cpu_thread_fn(void *arg)
sigset_t waitset;
int r;
+ rcu_register_thread();
+
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
@@ -1034,6 +1038,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
{
CPUState *cpu = arg;
+ rcu_register_thread();
+
qemu_mutex_lock_iothread();
qemu_tcg_init_cpu_signals();
qemu_thread_get_self(cpu->thread);
OpenPOWER on IntegriCloud