diff options
author | Jan Kiszka <jan.kiszka@siemens.com> | 2012-02-17 18:31:13 +0100 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2012-02-18 12:15:52 +0200 |
commit | e479c207d7616e3b6ea42d14d1c6a7fef1f32fc4 (patch) | |
tree | 521d5afdce6b9d625151e2f5fe4569da4001256e /kvm-all.c | |
parent | d1f866366070d09ff5c467efb0a64ac582e3aa5d (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 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 5 |
1 files changed, 0 insertions, 5 deletions
@@ -1118,8 +1118,6 @@ int kvm_cpu_exec(CPUState *env) return EXCP_HLT; } - cpu_single_env = env; - do { if (env->kvm_vcpu_dirty) { kvm_arch_put_registers(env, KVM_PUT_RUNTIME_STATE); @@ -1136,13 +1134,11 @@ int kvm_cpu_exec(CPUState *env) */ qemu_cpu_kick_self(); } - cpu_single_env = NULL; qemu_mutex_unlock_iothread(); run_ret = kvm_vcpu_ioctl(env, KVM_RUN, 0); qemu_mutex_lock_iothread(); - cpu_single_env = env; kvm_arch_post_run(env, run); kvm_flush_coalesced_mmio_buffer(); @@ -1206,7 +1202,6 @@ int kvm_cpu_exec(CPUState *env) } env->exit_request = 0; - cpu_single_env = NULL; return ret; } |