aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorZhang Xiantao <xiantao.zhang@intel.com>2007-12-17 01:21:40 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 11:01:19 -0500
commit5736199afba8a8bb60a1ea282ab72857d6b16400 (patch)
treeff7d49be0447f158aa821254c3f90d97988985a8 /arch/x86/kvm/x86.c
parent0eb8f4984824b8a811d44963995133f47813330a (diff)
KVM: Move kvm_vcpu_kick() to x86.c
Moving kvm_vcpu_kick() to x86.c. Since it should be common for all archs, put its declarations in <linux/kvm_host.h> Signed-off-by: Zhang Xiantao <xiantao.zhang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5902c5cbc1bb..733bff65d9a9 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3144,3 +3144,23 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
3144 return vcpu->arch.mp_state == VCPU_MP_STATE_RUNNABLE 3144 return vcpu->arch.mp_state == VCPU_MP_STATE_RUNNABLE
3145 || vcpu->arch.mp_state == VCPU_MP_STATE_SIPI_RECEIVED; 3145 || vcpu->arch.mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
3146} 3146}
3147
3148static void vcpu_kick_intr(void *info)
3149{
3150#ifdef DEBUG
3151 struct kvm_vcpu *vcpu = (struct kvm_vcpu *)info;
3152 printk(KERN_DEBUG "vcpu_kick_intr %p \n", vcpu);
3153#endif
3154}
3155
3156void kvm_vcpu_kick(struct kvm_vcpu *vcpu)
3157{
3158 int ipi_pcpu = vcpu->cpu;
3159
3160 if (waitqueue_active(&vcpu->wq)) {
3161 wake_up_interruptible(&vcpu->wq);
3162 ++vcpu->stat.halt_wakeup;
3163 }
3164 if (vcpu->guest_mode)
3165 smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0, 0);
3166}