It should contain the way, not the absolute TLB0 index.

Signed-off-by: Scott Wood <scottw...@freescale.com>
---
 arch/powerpc/kvm/e500_tlb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index 13c432e..2e99d66 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -788,6 +788,9 @@ int kvmppc_e500_emul_tlbsx(struct kvm_vcpu *vcpu, int rb)
        }
 
        if (gtlbe) {
+               if (tlbsel == 0)
+                       esel &= KVM_E500_TLB0_WAY_NUM - 1;
+
                vcpu_e500->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(esel)
                        | MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]);
                vcpu_e500->mas1 = gtlbe->mas1;
-- 
1.7.4.1


--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to