Commit 2246f8b5 authored by Alexander Graf's avatar Alexander Graf Committed by Avi Kivity

KVM: PPC: Rework wqp conditional code

On PowerPC, we sometimes use a waitqueue per core, not per thread,
so we can't always use the vcpu internal waitqueue.

This code has been generalized by Christoffer Dall recently, but
unfortunately broke compilation for PowerPC. At the time the helper
function is defined, struct kvm_vcpu is not declared yet, so we can't
dereference it.

This patch moves all logic into the generic inline function, at which
time we have all information necessary.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent b6d33834
...@@ -498,10 +498,6 @@ struct kvm_vcpu_arch { ...@@ -498,10 +498,6 @@ struct kvm_vcpu_arch {
#define KVM_MMIO_REG_QPR 0x0040 #define KVM_MMIO_REG_QPR 0x0040
#define KVM_MMIO_REG_FQPR 0x0060 #define KVM_MMIO_REG_FQPR 0x0060
#define __KVM_HAVE_ARCH_VCPU_GET_WQ 1 #define __KVM_HAVE_ARCH_WQP
static inline wait_queue_head *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
{
return vcpu->arch.wqp;
}
#endif /* __POWERPC_KVM_HOST_H__ */ #endif /* __POWERPC_KVM_HOST_H__ */
...@@ -524,12 +524,14 @@ static inline void kvm_arch_free_vm(struct kvm *kvm) ...@@ -524,12 +524,14 @@ static inline void kvm_arch_free_vm(struct kvm *kvm)
} }
#endif #endif
#ifndef __KVM_HAVE_ARCH_VCPU_GET_WQ
static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu) static inline wait_queue_head_t *kvm_arch_vcpu_wq(struct kvm_vcpu *vcpu)
{ {
#ifdef __KVM_HAVE_ARCH_WQP
return vcpu->arch.wqp;
#else
return &vcpu->wq; return &vcpu->wq;
}
#endif #endif
}
int kvm_arch_init_vm(struct kvm *kvm, unsigned long type); int kvm_arch_init_vm(struct kvm *kvm, unsigned long type);
void kvm_arch_destroy_vm(struct kvm *kvm); void kvm_arch_destroy_vm(struct kvm *kvm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment