aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2012-02-17 18:31:13 +0100
committerAvi Kivity <avi@redhat.com>2012-02-18 12:15:52 +0200
commite479c207d7616e3b6ea42d14d1c6a7fef1f32fc4 (patch)
tree521d5afdce6b9d625151e2f5fe4569da4001256e /cpus.c
parentd1f866366070d09ff5c467efb0a64ac582e3aa5d (diff)
kvm: Set cpu_single_env only once
As we have thread-local cpu_single_env now and KVM uses exactly one thread per VCPU, we can drop the cpu_single_env updates from the loop and initialize this variable only once during setup. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cpus.c b/cpus.c
index f45a438b29..d0c83405ac 100644
--- a/cpus.c
+++ b/cpus.c
@@ -714,6 +714,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg)
qemu_mutex_lock(&qemu_global_mutex);
qemu_thread_get_self(env->thread);
env->thread_id = qemu_get_thread_id();
+ cpu_single_env = env;
r = kvm_init_vcpu(env);
if (r < 0) {