diff options
author | Liu Yu <yu.liu@freescale.com> | 2010-01-22 06:36:53 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:36:06 -0500 |
commit | da15bf436bc9586603b47b39244157431fa38b56 (patch) | |
tree | 2131a64e8265649d0d7b27a3c357dc9058b0490c /arch/powerpc/kvm/e500_emulate.c | |
parent | a9040f274285c3c962a08b177ac5764b4a93df07 (diff) |
KVM: PPC E500: fix tlbcfg emulation
commit 55fb1027c1cf9797dbdeab48180da530e81b1c39 doesn't update tlbcfg correctly.
Fix it.
And since guest OS likes 'fixed' hardware,
initialize tlbcfg everytime when guest access is useless.
So move this part to init code.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/e500_emulate.c')
-rw-r--r-- | arch/powerpc/kvm/e500_emulate.c | 20 |
1 files changed, 2 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: |