[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/6] cpus: hax: register/unregister thread with RCU,
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 1/6] cpus: hax: register/unregister thread with RCU, exit loop on unplug |
Date: |
Thu, 1 Feb 2018 09:44:25 -0500 |
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpus.c b/cpus.c
index 1495ed5c36..231550a0d8 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1474,6 +1474,7 @@ static void *qemu_hax_cpu_thread_fn(void *arg)
CPUState *cpu = arg;
int r;
+ rcu_register_thread();
qemu_mutex_lock_iothread();
qemu_thread_get_self(cpu->thread);
@@ -1485,7 +1486,7 @@ static void *qemu_hax_cpu_thread_fn(void *arg)
hax_init_vcpu(cpu);
qemu_cond_signal(&qemu_cpu_cond);
- while (1) {
+ do {
if (cpu_can_run(cpu)) {
r = hax_smp_cpu_exec(cpu);
if (r == EXCP_DEBUG) {
@@ -1494,7 +1495,8 @@ static void *qemu_hax_cpu_thread_fn(void *arg)
}
qemu_wait_io_event(cpu);
- }
+ } while (!cpu->unplug || cpu_can_run(cpu));
+ rcu_unregister_thread();
return NULL;
}
--
2.14.3
- [Qemu-devel] [PATCH 0/6] cpus: fix various issues with vCPU unplug, Paolo Bonzini, 2018/02/01
- [Qemu-devel] [PATCH 1/6] cpus: hax: register/unregister thread with RCU, exit loop on unplug,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 3/6] cpus: dummy: unregister thread with RCU, exit loop on unplug, Paolo Bonzini, 2018/02/01
- [Qemu-devel] [PATCH 2/6] cpus: kvm: unregister thread with RCU, Paolo Bonzini, 2018/02/01
- [Qemu-devel] [PATCH 4/6] cpus: tcg: unregister thread with RCU, fix exiting of loop on unplug, Paolo Bonzini, 2018/02/01
- [Qemu-devel] [PATCH 6/6] cpus: join thread when removing a vCPU, Paolo Bonzini, 2018/02/01
- [Qemu-devel] [PATCH 5/6] cpus: hvf: unregister thread with RCU, Paolo Bonzini, 2018/02/01