summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/e500_tlb.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2012-08-02 13:38:49 +0200
committerAlexander Graf <agraf@suse.de>2012-10-05 23:38:40 +0200
commit2bb890f5ee79c85b9d3b7df37ecb639d8d4b961e (patch)
tree76e8eed19513b477ce5e20748f5b3f25a7cb4a47 /arch/powerpc/kvm/e500_tlb.c
parentcf1c5ca47319d9eb49166859921822fea354d4b3 (diff)
KVM: PPC: E500: Fix clear_tlb_refs
Our mapping code assumes that TLB0 entries are always mapped. However, after calling clear_tlb_refs() this is no longer the case. Map them dynamically if we find an entry unmapped in TLB0. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/e500_tlb.c')
-rw-r--r--arch/powerpc/kvm/e500_tlb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index ff38b664195..b56b6e14df6 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -1039,8 +1039,12 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
sesel = 0; /* unused */
priv = &vcpu_e500->gtlb_priv[tlbsel][esel];
- kvmppc_e500_setup_stlbe(vcpu, gtlbe, BOOK3E_PAGESZ_4K,
- &priv->ref, eaddr, &stlbe);
+ /* Only triggers after clear_tlb_refs */
+ if (unlikely(!(priv->ref.flags & E500_TLB_VALID)))
+ kvmppc_e500_tlb0_map(vcpu_e500, esel, &stlbe);
+ else
+ kvmppc_e500_setup_stlbe(vcpu, gtlbe, BOOK3E_PAGESZ_4K,
+ &priv->ref, eaddr, &stlbe);
break;
case 1: {