Commit 2bb890f5 authored by Alexander Graf's avatar Alexander Graf

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: default avatarAlexander Graf <agraf@suse.de>
parent cf1c5ca4
......@@ -1039,6 +1039,10 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 eaddr, gpa_t gpaddr,
sesel = 0; /* unused */
priv = &vcpu_e500->gtlb_priv[tlbsel][esel];
/* 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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment