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 /arch/ia64/kvm | |
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 'arch/ia64/kvm')
-rw-r--r-- | arch/ia64/kvm/kvm-ia64.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index f5104b7c52cd..9d80ff8d9eff 100644 --- a/arch/ia64/kvm/kvm-ia64.c +++ b/arch/ia64/kvm/kvm-ia64.c | |||
@@ -1872,21 +1872,6 @@ void kvm_arch_hardware_unsetup(void) | |||
1872 | { | 1872 | { |
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) | ||
1876 | { | ||
1877 | int me; | ||
1878 | int cpu = vcpu->cpu; | ||
1879 | |||
1880 | if (waitqueue_active(&vcpu->wq)) | ||
1881 | wake_up_interruptible(&vcpu->wq); | ||
1882 | |||
1883 | me = get_cpu(); | ||
1884 | if (cpu != me && (unsigned) cpu < nr_cpu_ids && cpu_online(cpu)) | ||
1885 | if (!test_and_set_bit(KVM_REQ_KICK, &vcpu->requests)) | ||
1886 | smp_send_reschedule(cpu); | ||
1887 | put_cpu(); | ||
1888 | } | ||
1889 | |||
1890 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq) | 1875 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, struct kvm_lapic_irq *irq) |
1891 | { | 1876 | { |
1892 | return __apic_accept_irq(vcpu, irq->vector); | 1877 | return __apic_accept_irq(vcpu, irq->vector); |
@@ -1956,6 +1941,11 @@ int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) | |||
1956 | (kvm_highest_pending_irq(vcpu) != -1); | 1941 | (kvm_highest_pending_irq(vcpu) != -1); |
1957 | } | 1942 | } |
1958 | 1943 | ||
1944 | int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu) | ||
1945 | { | ||
1946 | return (!test_and_set_bit(KVM_REQ_KICK, &vcpu->requests)); | ||
1947 | } | ||
1948 | |||
1959 | int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, | 1949 | int kvm_arch_vcpu_ioctl_get_mpstate(struct kvm_vcpu *vcpu, |
1960 | struct kvm_mp_state *mp_state) | 1950 | struct kvm_mp_state *mp_state) |
1961 | { | 1951 | { |