[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH qom-cpu 23/59] cpus: Change qemu_kvm_start_vcpu() ar
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH qom-cpu 23/59] cpus: Change qemu_kvm_start_vcpu() argument to CPUState |
Date: |
Sun, 9 Jun 2013 21:12:50 +0200 |
Pass it on to qemu_kvm_cpu_thread_fn().
Signed-off-by: Andreas Färber <address@hidden>
---
cpus.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/cpus.c b/cpus.c
index f629a15..18dba18 100644
--- a/cpus.c
+++ b/cpus.c
@@ -732,14 +732,13 @@ static void qemu_kvm_wait_io_event(CPUState *cpu)
static void *qemu_kvm_cpu_thread_fn(void *arg)
{
- CPUArchState *env = arg;
- CPUState *cpu = ENV_GET_CPU(env);
+ CPUState *cpu = arg;
int r;
qemu_mutex_lock(&qemu_global_mutex);
qemu_thread_get_self(cpu->thread);
cpu->thread_id = qemu_get_thread_id();
- cpu_single_env = env;
+ cpu_single_env = cpu->env_ptr;
r = kvm_init_vcpu(cpu);
if (r < 0) {
@@ -1032,14 +1031,12 @@ static void qemu_tcg_init_vcpu(CPUState *cpu)
}
}
-static void qemu_kvm_start_vcpu(CPUArchState *env)
+static void qemu_kvm_start_vcpu(CPUState *cpu)
{
- CPUState *cpu = ENV_GET_CPU(env);
-
cpu->thread = g_malloc0(sizeof(QemuThread));
cpu->halt_cond = g_malloc0(sizeof(QemuCond));
qemu_cond_init(cpu->halt_cond);
- qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, env,
+ qemu_thread_create(cpu->thread, qemu_kvm_cpu_thread_fn, cpu,
QEMU_THREAD_JOINABLE);
while (!cpu->created) {
qemu_cond_wait(&qemu_cpu_cond, &qemu_global_mutex);
@@ -1069,7 +1066,7 @@ void qemu_init_vcpu(void *_env)
cpu->nr_threads = smp_threads;
cpu->stopped = true;
if (kvm_enabled()) {
- qemu_kvm_start_vcpu(env);
+ qemu_kvm_start_vcpu(cpu);
} else if (tcg_enabled()) {
qemu_tcg_init_vcpu(cpu);
} else {
--
1.8.1.4
- [Qemu-devel] [PATCH qom-cpu 12/59] gdbstub: Simplify find_cpu(), (continued)
- [Qemu-devel] [PATCH qom-cpu 12/59] gdbstub: Simplify find_cpu(), Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 14/59] cpus: Change cpu_thread_is_idle() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 15/59] cpus: Change qemu_kvm_wait_io_event() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 13/59] cpu: Change cpu_exit() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 17/59] cpus: Change qemu_kvm_init_cpu_signals() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 16/59] kvm: Change kvm_set_signal_mask() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 19/59] kvm: Change kvm_handle_internal_error() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 20/59] kvm: Change kvm_cpu_exec() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 21/59] gdbstub: Set gdb_set_stop_cpu() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 22/59] cpus: Change cpu_handle_guest_debug() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 23/59] cpus: Change qemu_kvm_start_vcpu() argument to CPUState,
Andreas Färber <=
- [Qemu-devel] [PATCH qom-cpu 24/59] cpus: Change qemu_dummy_start_vcpu() argument to CPUState, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 26/59] hwaddr: Make hwaddr type usable beyond softmmu, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 18/59] cpu: Turn cpu_dump_{state, statistics}() into CPUState hooks, Andreas Färber, 2013/06/09
- [Qemu-devel] [PATCH qom-cpu 25/59] cpu: Change qemu_init_vcpu() argument to CPUState, Andreas Färber, 2013/06/09
[Qemu-devel] [PATCH qom-cpu 27/59] cpu: Turn cpu_unassigned_access() into a CPUState hook, Andreas Färber, 2013/06/09