Lines Matching refs:arch
71 esel += gtlb0_set_base(vcpu_e500, vcpu->arch.shared->mas2); in get_tlb_esel()
134 tlbsel = (vcpu->arch.shared->mas4 >> 28) & 0x1; in kvmppc_e500_deliver_tlb_miss()
136 tsized = (vcpu->arch.shared->mas4 >> 7) & 0x1f; in kvmppc_e500_deliver_tlb_miss()
138 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim) in kvmppc_e500_deliver_tlb_miss()
140 vcpu->arch.shared->mas1 = MAS1_VALID | (as ? MAS1_TS : 0) in kvmppc_e500_deliver_tlb_miss()
143 vcpu->arch.shared->mas2 = (eaddr & MAS2_EPN) in kvmppc_e500_deliver_tlb_miss()
144 | (vcpu->arch.shared->mas4 & MAS2_ATTRIB_MASK); in kvmppc_e500_deliver_tlb_miss()
145 vcpu->arch.shared->mas7_3 &= MAS3_U0 | MAS3_U1 | MAS3_U2 | MAS3_U3; in kvmppc_e500_deliver_tlb_miss()
146 vcpu->arch.shared->mas6 = (vcpu->arch.shared->mas6 & MAS6_SPID1) in kvmppc_e500_deliver_tlb_miss()
332 vcpu->arch.shared->mas0 &= ~MAS0_NV(~0); in kvmppc_e500_emul_tlbre()
333 vcpu->arch.shared->mas0 |= MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); in kvmppc_e500_emul_tlbre()
334 vcpu->arch.shared->mas1 = gtlbe->mas1; in kvmppc_e500_emul_tlbre()
335 vcpu->arch.shared->mas2 = gtlbe->mas2; in kvmppc_e500_emul_tlbre()
336 vcpu->arch.shared->mas7_3 = gtlbe->mas7_3; in kvmppc_e500_emul_tlbre()
360 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(esel) in kvmppc_e500_emul_tlbsx()
362 vcpu->arch.shared->mas1 = gtlbe->mas1; in kvmppc_e500_emul_tlbsx()
363 vcpu->arch.shared->mas2 = gtlbe->mas2; in kvmppc_e500_emul_tlbsx()
364 vcpu->arch.shared->mas7_3 = gtlbe->mas7_3; in kvmppc_e500_emul_tlbsx()
369 tlbsel = vcpu->arch.shared->mas4 >> 28 & 0x1; in kvmppc_e500_emul_tlbsx()
372 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) in kvmppc_e500_emul_tlbsx()
375 vcpu->arch.shared->mas1 = in kvmppc_e500_emul_tlbsx()
376 (vcpu->arch.shared->mas6 & MAS6_SPID0) in kvmppc_e500_emul_tlbsx()
377 | ((vcpu->arch.shared->mas6 & MAS6_SAS) ? MAS1_TS : 0) in kvmppc_e500_emul_tlbsx()
378 | (vcpu->arch.shared->mas4 & MAS4_TSIZED(~0)); in kvmppc_e500_emul_tlbsx()
379 vcpu->arch.shared->mas2 &= MAS2_EPN; in kvmppc_e500_emul_tlbsx()
380 vcpu->arch.shared->mas2 |= vcpu->arch.shared->mas4 & in kvmppc_e500_emul_tlbsx()
382 vcpu->arch.shared->mas7_3 &= MAS3_U0 | MAS3_U1 | in kvmppc_e500_emul_tlbsx()
410 gtlbe->mas1 = vcpu->arch.shared->mas1; in kvmppc_e500_emul_tlbwe()
411 gtlbe->mas2 = vcpu->arch.shared->mas2; in kvmppc_e500_emul_tlbwe()
412 if (!(vcpu->arch.shared->msr & MSR_CM)) in kvmppc_e500_emul_tlbwe()
414 gtlbe->mas7_3 = vcpu->arch.shared->mas7_3; in kvmppc_e500_emul_tlbwe()
416 trace_kvm_booke206_gtlb_write(vcpu->arch.shared->mas0, gtlbe->mas1, in kvmppc_e500_emul_tlbwe()
497 unsigned int as = !!(vcpu->arch.shared->msr & MSR_IS); in kvmppc_mmu_itlb_index()
504 unsigned int as = !!(vcpu->arch.shared->msr & MSR_DS); in kvmppc_mmu_dtlb_index()
511 unsigned int as = !!(vcpu->arch.shared->msr & MSR_IS); in kvmppc_mmu_itlb_miss()
513 kvmppc_e500_deliver_tlb_miss(vcpu, vcpu->arch.regs.nip, as); in kvmppc_mmu_itlb_miss()
518 unsigned int as = !!(vcpu->arch.shared->msr & MSR_DS); in kvmppc_mmu_dtlb_miss()
520 kvmppc_e500_deliver_tlb_miss(vcpu, vcpu->arch.fault_dear, as); in kvmppc_mmu_dtlb_miss()
569 sregs->u.e.mas0 = vcpu->arch.shared->mas0; in kvmppc_get_sregs_e500_tlb()
570 sregs->u.e.mas1 = vcpu->arch.shared->mas1; in kvmppc_get_sregs_e500_tlb()
571 sregs->u.e.mas2 = vcpu->arch.shared->mas2; in kvmppc_get_sregs_e500_tlb()
572 sregs->u.e.mas7_3 = vcpu->arch.shared->mas7_3; in kvmppc_get_sregs_e500_tlb()
573 sregs->u.e.mas4 = vcpu->arch.shared->mas4; in kvmppc_get_sregs_e500_tlb()
574 sregs->u.e.mas6 = vcpu->arch.shared->mas6; in kvmppc_get_sregs_e500_tlb()
576 sregs->u.e.mmucfg = vcpu->arch.mmucfg; in kvmppc_get_sregs_e500_tlb()
577 sregs->u.e.tlbcfg[0] = vcpu->arch.tlbcfg[0]; in kvmppc_get_sregs_e500_tlb()
578 sregs->u.e.tlbcfg[1] = vcpu->arch.tlbcfg[1]; in kvmppc_get_sregs_e500_tlb()
586 vcpu->arch.shared->mas0 = sregs->u.e.mas0; in kvmppc_set_sregs_e500_tlb()
587 vcpu->arch.shared->mas1 = sregs->u.e.mas1; in kvmppc_set_sregs_e500_tlb()
588 vcpu->arch.shared->mas2 = sregs->u.e.mas2; in kvmppc_set_sregs_e500_tlb()
589 vcpu->arch.shared->mas7_3 = sregs->u.e.mas7_3; in kvmppc_set_sregs_e500_tlb()
590 vcpu->arch.shared->mas4 = sregs->u.e.mas4; in kvmppc_set_sregs_e500_tlb()
591 vcpu->arch.shared->mas6 = sregs->u.e.mas6; in kvmppc_set_sregs_e500_tlb()
605 *val = get_reg_val(id, vcpu->arch.shared->mas0); in kvmppc_get_one_reg_e500_tlb()
608 *val = get_reg_val(id, vcpu->arch.shared->mas1); in kvmppc_get_one_reg_e500_tlb()
611 *val = get_reg_val(id, vcpu->arch.shared->mas2); in kvmppc_get_one_reg_e500_tlb()
614 *val = get_reg_val(id, vcpu->arch.shared->mas7_3); in kvmppc_get_one_reg_e500_tlb()
617 *val = get_reg_val(id, vcpu->arch.shared->mas4); in kvmppc_get_one_reg_e500_tlb()
620 *val = get_reg_val(id, vcpu->arch.shared->mas6); in kvmppc_get_one_reg_e500_tlb()
623 *val = get_reg_val(id, vcpu->arch.mmucfg); in kvmppc_get_one_reg_e500_tlb()
626 *val = get_reg_val(id, vcpu->arch.eptcfg); in kvmppc_get_one_reg_e500_tlb()
633 *val = get_reg_val(id, vcpu->arch.tlbcfg[i]); in kvmppc_get_one_reg_e500_tlb()
640 *val = get_reg_val(id, vcpu->arch.tlbps[i]); in kvmppc_get_one_reg_e500_tlb()
658 vcpu->arch.shared->mas0 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
661 vcpu->arch.shared->mas1 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
664 vcpu->arch.shared->mas2 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
667 vcpu->arch.shared->mas7_3 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
670 vcpu->arch.shared->mas4 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
673 vcpu->arch.shared->mas6 = set_reg_val(id, *val); in kvmppc_set_one_reg_e500_tlb()
678 if (reg != vcpu->arch.mmucfg) in kvmppc_set_one_reg_e500_tlb()
684 if (reg != vcpu->arch.eptcfg) in kvmppc_set_one_reg_e500_tlb()
695 if (reg != vcpu->arch.tlbcfg[i]) in kvmppc_set_one_reg_e500_tlb()
705 if (reg != vcpu->arch.tlbps[i]) in kvmppc_set_one_reg_e500_tlb()
720 vcpu->arch.tlbcfg[0] &= ~(TLBnCFG_N_ENTRY | TLBnCFG_ASSOC); in vcpu_mmu_geometry_update()
722 vcpu->arch.tlbcfg[0] |= params->tlb_sizes[0]; in vcpu_mmu_geometry_update()
723 vcpu->arch.tlbcfg[0] |= params->tlb_ways[0] << TLBnCFG_ASSOC_SHIFT; in vcpu_mmu_geometry_update()
725 vcpu->arch.tlbcfg[1] &= ~(TLBnCFG_N_ENTRY | TLBnCFG_ASSOC); in vcpu_mmu_geometry_update()
726 vcpu->arch.tlbcfg[1] |= params->tlb_sizes[1]; in vcpu_mmu_geometry_update()
727 vcpu->arch.tlbcfg[1] |= params->tlb_ways[1] << TLBnCFG_ASSOC_SHIFT; in vcpu_mmu_geometry_update()
870 vcpu->arch.mmucfg = mfspr(SPRN_MMUCFG) & ~MMUCFG_LPIDSIZE; in vcpu_mmu_init()
873 vcpu->arch.tlbcfg[0] = mfspr(SPRN_TLB0CFG) & in vcpu_mmu_init()
875 vcpu->arch.tlbcfg[0] |= params[0].entries; in vcpu_mmu_init()
876 vcpu->arch.tlbcfg[0] |= params[0].ways << TLBnCFG_ASSOC_SHIFT; in vcpu_mmu_init()
878 vcpu->arch.tlbcfg[1] = mfspr(SPRN_TLB1CFG) & in vcpu_mmu_init()
880 vcpu->arch.tlbcfg[1] |= params[1].entries; in vcpu_mmu_init()
881 vcpu->arch.tlbcfg[1] |= params[1].ways << TLBnCFG_ASSOC_SHIFT; in vcpu_mmu_init()
884 vcpu->arch.tlbps[0] = mfspr(SPRN_TLB0PS); in vcpu_mmu_init()
885 vcpu->arch.tlbps[1] = mfspr(SPRN_TLB1PS); in vcpu_mmu_init()
887 vcpu->arch.mmucfg &= ~MMUCFG_LRAT; in vcpu_mmu_init()
890 vcpu->arch.eptcfg = 0; in vcpu_mmu_init()
891 vcpu->arch.tlbcfg[0] &= ~TLBnCFG_PT; in vcpu_mmu_init()
892 vcpu->arch.tlbcfg[1] &= ~TLBnCFG_IND; in vcpu_mmu_init()