aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorChristoffer Dall <c.dall@virtualopensystems.com>2012-03-08 16:44:24 -0500
committerAvi Kivity <avi@redhat.com>2012-04-08 05:47:47 -0400
commitb6d33834bd4e8bdf4a199812e31b3e36da53c794 (patch)
tree3360ac4b5fa572e3acb21ecdc686c6d941baa2fc /include/linux
parent66ef89315f121cda9bf5b65a4ef02ad1b4fb16d9 (diff)
KVM: Factor out kvm_vcpu_kick to arch-generic code
The kvm_vcpu_kick function performs roughly the same funcitonality on most all architectures, so we shouldn't have separate copies. PowerPC keeps a pointer to interchanging waitqueues on the vcpu_arch structure and to accomodate this special need a __KVM_HAVE_ARCH_VCPU_GET_WQ define and accompanying function kvm_arch_vcpu_wq have been defined. For all other architectures this is a generic inline that just returns &vcpu->wq; Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/kvm_host.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 3a2cea616283..5b624e1ff814 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -439,6 +439,7 @@ void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot,
439 gfn_t gfn); 439 gfn_t gfn);
440 440
441void kvm_vcpu_block(struct kvm_vcpu *vcpu); 441void kvm_vcpu_block(struct kvm_vcpu *vcpu);
442void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
442void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); 443void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
443void kvm_resched(struct kvm_vcpu *vcpu); 444void kvm_resched(struct kvm_vcpu *vcpu);
444void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 445void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
@@ -507,6 +508,7 @@ int kvm_arch_hardware_setup(void);
507void kvm_arch_hardware_unsetup(void); 508void kvm_arch_hardware_unsetup(void);
508void kvm_arch_check_processor_compat(void *rtn); 509void kvm_arch_check_processor_compat(void *rtn);
509int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); 510int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
511int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
510 512
511void kvm_free_physmem(struct kvm *kvm); 513void kvm_free_physmem(struct kvm *kvm);
512 514
@@ -522,6 +524,13 @@ static inline void kvm_arch_free_vm(struct kvm *kvm)
522} 524}
523#endif 525#endif
524 526
527#ifndef __KVM_HAVE_ARCH_VCPU_GET_WQ
528static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
529{
530 return &vcpu->wq;
531}
532#endif
533
525int kvm_arch_init_vm(struct kvm *kvm, unsigned long type); 534int kvm_arch_init_vm(struct kvm *kvm, unsigned long type);
526void kvm_arch_destroy_vm(struct kvm *kvm); 535void kvm_arch_destroy_vm(struct kvm *kvm);
527void kvm_free_all_assigned_devices(struct kvm *kvm); 536void kvm_free_all_assigned_devices(struct kvm *kvm);