diff options
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/e500_emulate.c | 20 | ||||
-rw-r--r-- | arch/powerpc/kvm/e500_tlb.c | 6 |
2 files changed, 8 insertions, 18 deletions
diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c index 95f8ec8fdc71..8e3edfbc9634 100644 --- a/arch/powerpc/kvm/e500_emulate.c +++ b/arch/powerpc/kvm/e500_emulate.c | |||
@@ -164,25 +164,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt) | |||
164 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->mas7); break; | 164 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->mas7); break; |
165 | 165 | ||
166 | case SPRN_TLB0CFG: | 166 | case SPRN_TLB0CFG: |
167 | { | 167 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->tlb0cfg); break; |
168 | ulong tmp = SPRN_TLB0CFG; | ||
169 | |||
170 | tmp &= ~0xfffUL; | ||
171 | tmp |= vcpu_e500->guest_tlb_size[0]; | ||
172 | kvmppc_set_gpr(vcpu, rt, tmp); | ||
173 | break; | ||
174 | } | ||
175 | |||
176 | case SPRN_TLB1CFG: | 168 | case SPRN_TLB1CFG: |
177 | { | 169 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->tlb1cfg); break; |
178 | ulong tmp = SPRN_TLB1CFG; | ||
179 | |||
180 | tmp &= ~0xfffUL; | ||
181 | tmp |= vcpu_e500->guest_tlb_size[1]; | ||
182 | kvmppc_set_gpr(vcpu, rt, tmp); | ||
183 | break; | ||
184 | } | ||
185 | |||
186 | case SPRN_L1CSR0: | 170 | case SPRN_L1CSR0: |
187 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr0); break; | 171 | kvmppc_set_gpr(vcpu, rt, vcpu_e500->l1csr0); break; |
188 | case SPRN_L1CSR1: | 172 | case SPRN_L1CSR1: |
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c index 6a7fc012b93f..0d772e6b6318 100644 --- a/arch/powerpc/kvm/e500_tlb.c +++ b/arch/powerpc/kvm/e500_tlb.c | |||
@@ -728,6 +728,12 @@ int kvmppc_e500_tlb_init(struct kvmppc_vcpu_e500 *vcpu_e500) | |||
728 | if (vcpu_e500->shadow_pages[1] == NULL) | 728 | if (vcpu_e500->shadow_pages[1] == NULL) |
729 | goto err_out_page0; | 729 | goto err_out_page0; |
730 | 730 | ||
731 | /* Init TLB configuration register */ | ||
732 | vcpu_e500->tlb0cfg = mfspr(SPRN_TLB0CFG) & ~0xfffUL; | ||
733 | vcpu_e500->tlb0cfg |= vcpu_e500->guest_tlb_size[0]; | ||
734 | vcpu_e500->tlb1cfg = mfspr(SPRN_TLB1CFG) & ~0xfffUL; | ||
735 | vcpu_e500->tlb1cfg |= vcpu_e500->guest_tlb_size[1]; | ||
736 | |||
731 | return 0; | 737 | return 0; |
732 | 738 | ||
733 | err_out_page0: | 739 | err_out_page0: |