|
From: | Avi Kivity |
Subject: | [Qemu-devel] Re: [PATCH 2/9] qemu-kvm: Clean up register access API |
Date: | Sun, 21 Feb 2010 11:25:01 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.7) Gecko/20100120 Fedora/3.0.1-1.fc12 Thunderbird/3.0.1 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |