Lines Matching refs:tlbsel
64 static unsigned int get_tlb_esel(struct kvm_vcpu *vcpu, int tlbsel) in get_tlb_esel() argument
69 if (tlbsel == 0) { in get_tlb_esel()
73 esel &= vcpu_e500->gtlb_params[tlbsel].entries - 1; in get_tlb_esel()
81 gva_t eaddr, int tlbsel, unsigned int pid, int as) in kvmppc_e500_tlb_index() argument
83 int size = vcpu_e500->gtlb_params[tlbsel].entries; in kvmppc_e500_tlb_index()
87 if (tlbsel == 0) { in kvmppc_e500_tlb_index()
97 offset = vcpu_e500->gtlb_offset[tlbsel]; in kvmppc_e500_tlb_index()
131 int tlbsel; in kvmppc_e500_deliver_tlb_miss() local
134 tlbsel = (vcpu->arch.shared->mas4 >> 28) & 0x1; in kvmppc_e500_deliver_tlb_miss()
135 victim = (tlbsel == 0) ? gtlb0_get_next_victim(vcpu_e500) : 0; in kvmppc_e500_deliver_tlb_miss()
138 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(victim) in kvmppc_e500_deliver_tlb_miss()
139 | MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); in kvmppc_e500_deliver_tlb_miss()
212 int tlbsel, int esel) in kvmppc_e500_gtlbe_invalidate() argument
215 get_entry(vcpu_e500, tlbsel, esel); in kvmppc_e500_gtlbe_invalidate()
220 if (tlbsel == 1 && kvmppc_need_recalc_tlb1map_range(vcpu_e500, gtlbe)) in kvmppc_e500_gtlbe_invalidate()
249 int esel, tlbsel; in kvmppc_e500_emul_tlbivax() local
254 tlbsel = (ea >> 3) & 0x1; in kvmppc_e500_emul_tlbivax()
258 for (esel = 0; esel < vcpu_e500->gtlb_params[tlbsel].entries; in kvmppc_e500_emul_tlbivax()
260 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbivax()
263 esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel, in kvmppc_e500_emul_tlbivax()
266 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbivax()
275 static void tlbilx_all(struct kvmppc_vcpu_e500 *vcpu_e500, int tlbsel, in tlbilx_all() argument
282 for (esel = 0; esel < vcpu_e500->gtlb_params[tlbsel].entries; esel++) { in tlbilx_all()
283 tlbe = get_entry(vcpu_e500, tlbsel, esel); in tlbilx_all()
286 inval_gtlbe_on_host(vcpu_e500, tlbsel, esel); in tlbilx_all()
287 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel); in tlbilx_all()
295 int tlbsel, esel; in tlbilx_one() local
297 for (tlbsel = 0; tlbsel < 2; tlbsel++) { in tlbilx_one()
298 esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel, pid, -1); in tlbilx_one()
300 inval_gtlbe_on_host(vcpu_e500, tlbsel, esel); in tlbilx_one()
301 kvmppc_e500_gtlbe_invalidate(vcpu_e500, tlbsel, esel); in tlbilx_one()
325 int tlbsel, esel; in kvmppc_e500_emul_tlbre() local
328 tlbsel = get_tlb_tlbsel(vcpu); in kvmppc_e500_emul_tlbre()
329 esel = get_tlb_esel(vcpu, tlbsel); in kvmppc_e500_emul_tlbre()
331 gtlbe = get_entry(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbre()
333 vcpu->arch.shared->mas0 |= MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); in kvmppc_e500_emul_tlbre()
346 int esel, tlbsel; in kvmppc_e500_emul_tlbsx() local
349 for (tlbsel = 0; tlbsel < 2; tlbsel++) { in kvmppc_e500_emul_tlbsx()
350 esel = kvmppc_e500_tlb_index(vcpu_e500, ea, tlbsel, pid, as); in kvmppc_e500_emul_tlbsx()
352 gtlbe = get_entry(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbsx()
358 esel &= vcpu_e500->gtlb_params[tlbsel].ways - 1; in kvmppc_e500_emul_tlbsx()
360 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) | MAS0_ESEL(esel) in kvmppc_e500_emul_tlbsx()
361 | MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); in kvmppc_e500_emul_tlbsx()
369 tlbsel = vcpu->arch.shared->mas4 >> 28 & 0x1; in kvmppc_e500_emul_tlbsx()
370 victim = (tlbsel == 0) ? gtlb0_get_next_victim(vcpu_e500) : 0; in kvmppc_e500_emul_tlbsx()
372 vcpu->arch.shared->mas0 = MAS0_TLBSEL(tlbsel) in kvmppc_e500_emul_tlbsx()
374 | MAS0_NV(vcpu_e500->gtlb_nv[tlbsel]); in kvmppc_e500_emul_tlbsx()
394 int tlbsel, esel; in kvmppc_e500_emul_tlbwe() local
398 tlbsel = get_tlb_tlbsel(vcpu); in kvmppc_e500_emul_tlbwe()
399 esel = get_tlb_esel(vcpu, tlbsel); in kvmppc_e500_emul_tlbwe()
401 gtlbe = get_entry(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbwe()
404 inval_gtlbe_on_host(vcpu_e500, tlbsel, esel); in kvmppc_e500_emul_tlbwe()
405 if ((tlbsel == 1) && in kvmppc_e500_emul_tlbwe()
419 if (tlbsel == 1) { in kvmppc_e500_emul_tlbwe()
438 if (tlbsel == 0) { in kvmppc_e500_emul_tlbwe()
444 kvmppc_mmu_map(vcpu, eaddr, raddr, index_of(tlbsel, esel)); in kvmppc_e500_emul_tlbwe()
457 int esel, tlbsel; in kvmppc_e500_tlb_search() local
459 for (tlbsel = 0; tlbsel < 2; tlbsel++) { in kvmppc_e500_tlb_search()
460 esel = kvmppc_e500_tlb_index(vcpu_e500, eaddr, tlbsel, pid, as); in kvmppc_e500_tlb_search()
462 return index_of(tlbsel, esel); in kvmppc_e500_tlb_search()