aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/e500_emulate.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-12-20 10:34:47 -0500
committerAvi Kivity <avi@redhat.com>2012-04-08 05:54:33 -0400
commit73196cd364a2d972d73fa08da9d81ca3215bed68 (patch)
tree058b8487bb512b5cde4e827d8aa2525680e6519b /arch/powerpc/kvm/e500_emulate.c
parent8fae845f4956de0becc115e926d33eff46722e94 (diff)
KVM: PPC: e500mc support
Add processor support for e500mc, using hardware virtualization support (GS-mode). Current issues include: - No support for external proxy (coreint) interrupt mode in the guest. Includes work by Ashish Kalra <Ashish.Kalra@freescale.com>, Varun Sethi <Varun.Sethi@freescale.com>, and Liu Yu <yu.liu@freescale.com>. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/e500_emulate.c')
-rw-r--r--arch/powerpc/kvm/e500_emulate.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
index af02c18fc798..98b6c1cd6b82 100644
--- a/arch/powerpc/kvm/e500_emulate.c
+++ b/arch/powerpc/kvm/e500_emulate.c
@@ -85,6 +85,7 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
85 ulong spr_val = kvmppc_get_gpr(vcpu, rs); 85 ulong spr_val = kvmppc_get_gpr(vcpu, rs);
86 86
87 switch (sprn) { 87 switch (sprn) {
88#ifndef CONFIG_KVM_BOOKE_HV
88 case SPRN_PID: 89 case SPRN_PID:
89 kvmppc_set_pid(vcpu, spr_val); 90 kvmppc_set_pid(vcpu, spr_val);
90 break; 91 break;
@@ -114,6 +115,7 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
114 vcpu->arch.shared->mas7_3 &= (u64)0xffffffff; 115 vcpu->arch.shared->mas7_3 &= (u64)0xffffffff;
115 vcpu->arch.shared->mas7_3 |= (u64)spr_val << 32; 116 vcpu->arch.shared->mas7_3 |= (u64)spr_val << 32;
116 break; 117 break;
118#endif
117 case SPRN_L1CSR0: 119 case SPRN_L1CSR0:
118 vcpu_e500->l1csr0 = spr_val; 120 vcpu_e500->l1csr0 = spr_val;
119 vcpu_e500->l1csr0 &= ~(L1CSR0_DCFI | L1CSR0_CLFC); 121 vcpu_e500->l1csr0 &= ~(L1CSR0_DCFI | L1CSR0_CLFC);
@@ -143,7 +145,14 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
143 case SPRN_IVOR35: 145 case SPRN_IVOR35:
144 vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] = spr_val; 146 vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR] = spr_val;
145 break; 147 break;
146 148#ifdef CONFIG_KVM_BOOKE_HV
149 case SPRN_IVOR36:
150 vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL] = spr_val;
151 break;
152 case SPRN_IVOR37:
153 vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL_CRIT] = spr_val;
154 break;
155#endif
147 default: 156 default:
148 emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs); 157 emulated = kvmppc_booke_emulate_mtspr(vcpu, sprn, rs);
149 } 158 }
@@ -155,9 +164,11 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
155{ 164{
156 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu); 165 struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
157 int emulated = EMULATE_DONE; 166 int emulated = EMULATE_DONE;
158 unsigned long val;
159 167
160 switch (sprn) { 168 switch (sprn) {
169#ifndef CONFIG_KVM_BOOKE_HV
170 unsigned long val;
171
161 case SPRN_PID: 172 case SPRN_PID:
162 kvmppc_set_gpr(vcpu, rt, vcpu_e500->pid[0]); break; 173 kvmppc_set_gpr(vcpu, rt, vcpu_e500->pid[0]); break;
163 case SPRN_PID1: 174 case SPRN_PID1:
@@ -182,6 +193,7 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
182 val = vcpu->arch.shared->mas7_3 >> 32; 193 val = vcpu->arch.shared->mas7_3 >> 32;
183 kvmppc_set_gpr(vcpu, rt, val); 194 kvmppc_set_gpr(vcpu, rt, val);
184 break; 195 break;
196#endif
185 case SPRN_TLB0CFG: 197 case SPRN_TLB0CFG:
186 kvmppc_set_gpr(vcpu, rt, vcpu->arch.tlbcfg[0]); break; 198 kvmppc_set_gpr(vcpu, rt, vcpu->arch.tlbcfg[0]); break;
187 case SPRN_TLB1CFG: 199 case SPRN_TLB1CFG:
@@ -216,6 +228,14 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
216 case SPRN_IVOR35: 228 case SPRN_IVOR35:
217 kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR]); 229 kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_PERFORMANCE_MONITOR]);
218 break; 230 break;
231#ifdef CONFIG_KVM_BOOKE_HV
232 case SPRN_IVOR36:
233 kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL]);
234 break;
235 case SPRN_IVOR37:
236 kvmppc_set_gpr(vcpu, rt, vcpu->arch.ivor[BOOKE_IRQPRIO_DBELL_CRIT]);
237 break;
238#endif
219 default: 239 default:
220 emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt); 240 emulated = kvmppc_booke_emulate_mfspr(vcpu, sprn, rt);
221 } 241 }