On 02/19/2010 08:22 PM, Jan Kiszka wrote:
qemu-kvm's functions for accessing the VCPU registers are
kvm_arch_load/save_regs. Use them directly instead of going through
various wrappers. Specifically, we do not need on_vcpu wrapping as all
users either already run in the related thread or call while the vm is
stopped. This is now also validated during runtime via asserts.
+ assert(kvm_cpu_is_stopped(env) || env->thread_id == kvm_get_thread_id());
The kvm_cpu_is_stopped() part is wrong, for two reasons. First, a
future ABI revolution might switch to syscalls and thus make the
association between vcpu and thread implicit. This will allow us to
drop vcpu->mutex, eventually. Second, kvm_cpu_is_stopped() will be racy
in a threaded future version of qemu. All vcpu ioctls should be made
from the vcpu thread.
Documentation/kvm/api.txt has this to say about the matter:
- vcpu ioctls: These query and set attributes that control the operation
of a single virtual cpu.
Only run vcpu ioctls from the same thread that was used to create the
vcpu.
So it isn't just me.
--
error compiling committee.c: too many arguments to function