diff options
| author | Christoffer Dall <c.dall@virtualopensystems.com> | 2012-03-08 16:44:24 -0500 |
|---|---|---|
| committer | Avi Kivity <avi@redhat.com> | 2012-04-08 05:47:47 -0400 |
| commit | b6d33834bd4e8bdf4a199812e31b3e36da53c794 (patch) | |
| tree | 3360ac4b5fa572e3acb21ecdc686c6d941baa2fc /include/linux | |
| parent | 66ef89315f121cda9bf5b65a4ef02ad1b4fb16d9 (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.h | 9 |
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 | ||
| 441 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 441 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
| 442 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | ||
| 442 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 443 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
| 443 | void kvm_resched(struct kvm_vcpu *vcpu); | 444 | void kvm_resched(struct kvm_vcpu *vcpu); |
| 444 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 445 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
| @@ -507,6 +508,7 @@ int kvm_arch_hardware_setup(void); | |||
| 507 | void kvm_arch_hardware_unsetup(void); | 508 | void kvm_arch_hardware_unsetup(void); |
| 508 | void kvm_arch_check_processor_compat(void *rtn); | 509 | void kvm_arch_check_processor_compat(void *rtn); |
| 509 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 510 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
| 511 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); | ||
| 510 | 512 | ||
| 511 | void kvm_free_physmem(struct kvm *kvm); | 513 | void 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 | ||
| 528 | static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) | ||
| 529 | { | ||
| 530 | return &vcpu->wq; | ||
| 531 | } | ||
| 532 | #endif | ||
| 533 | |||
| 525 | int kvm_arch_init_vm(struct kvm *kvm, unsigned long type); | 534 | int kvm_arch_init_vm(struct kvm *kvm, unsigned long type); |
| 526 | void kvm_arch_destroy_vm(struct kvm *kvm); | 535 | void kvm_arch_destroy_vm(struct kvm *kvm); |
| 527 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 536 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
