[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 05/34] cpus: wait for CPU creation at central place
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 05/34] cpus: wait for CPU creation at central place |
Date: |
Tue, 6 Mar 2018 14:19:01 +0100 |
From: David Hildenbrand <address@hidden>
We can now also wait for the CPU creation for single-threaded TCG, so we
can move the waiting bits further out.
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
cpus.c | 22 ++++------------------
1 file changed, 4 insertions(+), 18 deletions(-)
diff --git a/cpus.c b/cpus.c
index 970390b..bcfc0a4 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1856,9 +1856,6 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
#ifdef _WIN32
cpu->hThread = qemu_thread_get_handle(cpu->thread);
#endif
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
} else {
/* For non-MTTCG cases we share the thread */
cpu->thread = single_tcg_cpu_thread;
@@ -1884,9 +1881,6 @@ static void qemu_hax_start_vcpu(CPUState *cpu)
#ifdef _WIN32
cpu->hThread = qemu_thread_get_handle(cpu->thread);
#endif
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
}
static void qemu_kvm_start_vcpu(CPUState *cpu)
@@ -1900,9 +1894,6 @@ static void qemu_kvm_start_vcpu(CPUState *cpu)
cpu->cpu_index);
qemu_thread_create(cpu->thread, thread_name, qemu_kvm_cpu_thread_fn,
cpu, QEMU_THREAD_JOINABLE);
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
}
static void qemu_hvf_start_vcpu(CPUState *cpu)
@@ -1921,9 +1912,6 @@ static void qemu_hvf_start_vcpu(CPUState *cpu)
cpu->cpu_index);
qemu_thread_create(cpu->thread, thread_name, qemu_hvf_cpu_thread_fn,
cpu, QEMU_THREAD_JOINABLE);
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
}
static void qemu_whpx_start_vcpu(CPUState *cpu)
@@ -1940,9 +1928,6 @@ static void qemu_whpx_start_vcpu(CPUState *cpu)
#ifdef _WIN32
cpu->hThread = qemu_thread_get_handle(cpu->thread);
#endif
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
}
static void qemu_dummy_start_vcpu(CPUState *cpu)
@@ -1956,9 +1941,6 @@ static void qemu_dummy_start_vcpu(CPUState *cpu)
cpu->cpu_index);
qemu_thread_create(cpu->thread, thread_name, qemu_dummy_cpu_thread_fn, cpu,
QEMU_THREAD_JOINABLE);
- while (!cpu->created) {
- qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
- }
}
void qemu_init_vcpu(CPUState *cpu)
@@ -1988,6 +1970,10 @@ void qemu_init_vcpu(CPUState *cpu)
} else {
qemu_dummy_start_vcpu(cpu);
}
+
+ while (!cpu->created) {
+ qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
+ }
}
void cpu_stop_current(void)
--
1.8.3.1
- [Qemu-devel] [PULL 00/34] Misc patches for 2018-03-06, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 05/34] cpus: wait for CPU creation at central place,
Paolo Bonzini <=
- [Qemu-devel] [PULL 04/34] cpus: properly inititalize CPU > 1 under single-threaded TCG, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 01/34] g364fb: fix DirtyBitmapSnapshot leak, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 02/34] Remove the deprecated -tdf option, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 07/34] Document --rtc-td-hack, --localtime and --startdate as deprecated, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 03/34] scsi: Remove automatic creation of SCSI controllers with -drive if=scsi, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 11/34] lockable: workaround GCC link issue with ASAN, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 10/34] build-sys: fix -fsanitize=address check, Paolo Bonzini, 2018/03/06
- [Qemu-devel] [PULL 08/34] qmp: Merge ObjectPropertyInfo and DevicePropertyInfo, Paolo Bonzini, 2018/03/06