Commit a2b07664 authored by Alexander Graf's avatar Alexander Graf Committed by Avi Kivity

KVM: PPC: Make build work without CONFIG_VSX/ALTIVEC

The FPU/Altivec/VSX enablement also brought access to some structure
elements that are only defined when the respective config options
are enabled.

Unfortuately I forgot to check for the config options at some places,
so let's do that now.

Unbreaks the build when CONFIG_VSX is not set.
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent ad0a048b
...@@ -609,7 +609,9 @@ void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr) ...@@ -609,7 +609,9 @@ void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr)
{ {
struct thread_struct *t = &current->thread; struct thread_struct *t = &current->thread;
u64 *vcpu_fpr = vcpu->arch.fpr; u64 *vcpu_fpr = vcpu->arch.fpr;
#ifdef CONFIG_VSX
u64 *vcpu_vsx = vcpu->arch.vsr; u64 *vcpu_vsx = vcpu->arch.vsr;
#endif
u64 *thread_fpr = (u64*)t->fpr; u64 *thread_fpr = (u64*)t->fpr;
int i; int i;
...@@ -689,7 +691,9 @@ static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr, ...@@ -689,7 +691,9 @@ static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr,
{ {
struct thread_struct *t = &current->thread; struct thread_struct *t = &current->thread;
u64 *vcpu_fpr = vcpu->arch.fpr; u64 *vcpu_fpr = vcpu->arch.fpr;
#ifdef CONFIG_VSX
u64 *vcpu_vsx = vcpu->arch.vsr; u64 *vcpu_vsx = vcpu->arch.vsr;
#endif
u64 *thread_fpr = (u64*)t->fpr; u64 *thread_fpr = (u64*)t->fpr;
int i; int i;
...@@ -1221,8 +1225,12 @@ int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) ...@@ -1221,8 +1225,12 @@ int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
{ {
int ret; int ret;
struct thread_struct ext_bkp; struct thread_struct ext_bkp;
#ifdef CONFIG_ALTIVEC
bool save_vec = current->thread.used_vr; bool save_vec = current->thread.used_vr;
#endif
#ifdef CONFIG_VSX
bool save_vsx = current->thread.used_vsr; bool save_vsx = current->thread.used_vsr;
#endif
ulong ext_msr; ulong ext_msr;
/* No need to go into the guest when all we do is going out */ /* No need to go into the guest when all we do is going out */
......
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