KVM: Add "exiting guest mode" state
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Wed, 12 Jan 2011 07:40:31 +0000 (15:40 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Thu, 17 Mar 2011 16:08:26 +0000 (13:08 -0300)
commit6b7e2d0991489559a1df4500d77f7b76c4607ed0
treeb82e941c3ca4d519c71577ad21807af4d02b0679
parentd48ead8b0b48862a87138d04efb7580a1a25beb5
KVM: Add "exiting guest mode" state

Currently we keep track of only two states: guest mode and host
mode.  This patch adds an "exiting guest mode" state that tells
us that an IPI will happen soon, so unless we need to wait for the
IPI, we can avoid it completely.

Also
1: No need atomically to read/write ->mode in vcpu's thread

2: reorganize struct kvm_vcpu to make ->mode and ->requests
   in the same cache line explicitly

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
arch/ia64/kvm/kvm-ia64.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c