aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/e500.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kvm/e500.c')
-rw-r--r--arch/powerpc/kvm/e500.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index 8c0d45a6faf7..ddcd896fa2ff 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -71,9 +71,6 @@ int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
71 vcpu->arch.pvr = mfspr(SPRN_PVR); 71 vcpu->arch.pvr = mfspr(SPRN_PVR);
72 vcpu_e500->svr = mfspr(SPRN_SVR); 72 vcpu_e500->svr = mfspr(SPRN_SVR);
73 73
74 /* Since booke kvm only support one core, update all vcpus' PIR to 0 */
75 vcpu->vcpu_id = 0;
76
77 vcpu->arch.cpu_type = KVM_CPU_E500V2; 74 vcpu->arch.cpu_type = KVM_CPU_E500V2;
78 75
79 return 0; 76 return 0;
@@ -118,12 +115,12 @@ void kvmppc_core_get_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
118 sregs->u.e.impl.fsl.hid0 = vcpu_e500->hid0; 115 sregs->u.e.impl.fsl.hid0 = vcpu_e500->hid0;
119 sregs->u.e.impl.fsl.mcar = vcpu_e500->mcar; 116 sregs->u.e.impl.fsl.mcar = vcpu_e500->mcar;
120 117
121 sregs->u.e.mas0 = vcpu_e500->mas0; 118 sregs->u.e.mas0 = vcpu->arch.shared->mas0;
122 sregs->u.e.mas1 = vcpu_e500->mas1; 119 sregs->u.e.mas1 = vcpu->arch.shared->mas1;
123 sregs->u.e.mas2 = vcpu_e500->mas2; 120 sregs->u.e.mas2 = vcpu->arch.shared->mas2;
124 sregs->u.e.mas7_3 = ((u64)vcpu_e500->mas7 << 32) | vcpu_e500->mas3; 121 sregs->u.e.mas7_3 = vcpu->arch.shared->mas7_3;
125 sregs->u.e.mas4 = vcpu_e500->mas4; 122 sregs->u.e.mas4 = vcpu->arch.shared->mas4;
126 sregs->u.e.mas6 = vcpu_e500->mas6; 123 sregs->u.e.mas6 = vcpu->arch.shared->mas6;
127 124
128 sregs->u.e.mmucfg = mfspr(SPRN_MMUCFG); 125 sregs->u.e.mmucfg = mfspr(SPRN_MMUCFG);
129 sregs->u.e.tlbcfg[0] = vcpu_e500->tlb0cfg; 126 sregs->u.e.tlbcfg[0] = vcpu_e500->tlb0cfg;
@@ -151,13 +148,12 @@ int kvmppc_core_set_sregs(struct kvm_vcpu *vcpu, struct kvm_sregs *sregs)
151 } 148 }
152 149
153 if (sregs->u.e.features & KVM_SREGS_E_ARCH206_MMU) { 150 if (sregs->u.e.features & KVM_SREGS_E_ARCH206_MMU) {
154 vcpu_e500->mas0 = sregs->u.e.mas0; 151 vcpu->arch.shared->mas0 = sregs->u.e.mas0;
155 vcpu_e500->mas1 = sregs->u.e.mas1; 152 vcpu->arch.shared->mas1 = sregs->u.e.mas1;
156 vcpu_e500->mas2 = sregs->u.e.mas2; 153 vcpu->arch.shared->mas2 = sregs->u.e.mas2;
157 vcpu_e500->mas7 = sregs->u.e.mas7_3 >> 32; 154 vcpu->arch.shared->mas7_3 = sregs->u.e.mas7_3;
158 vcpu_e500->mas3 = (u32)sregs->u.e.mas7_3; 155 vcpu->arch.shared->mas4 = sregs->u.e.mas4;
159 vcpu_e500->mas4 = sregs->u.e.mas4; 156 vcpu->arch.shared->mas6 = sregs->u.e.mas6;
160 vcpu_e500->mas6 = sregs->u.e.mas6;
161 } 157 }
162 158
163 if (!(sregs->u.e.features & KVM_SREGS_E_IVOR)) 159 if (!(sregs->u.e.features & KVM_SREGS_E_IVOR))
@@ -233,6 +229,10 @@ static int __init kvmppc_e500_init(void)
233 unsigned long ivor[3]; 229 unsigned long ivor[3];
234 unsigned long max_ivor = 0; 230 unsigned long max_ivor = 0;
235 231
232 r = kvmppc_core_check_processor_compat();
233 if (r)
234 return r;
235
236 r = kvmppc_booke_init(); 236 r = kvmppc_booke_init();
237 if (r) 237 if (r)
238 return r; 238 return r;