Lines Matching full:asid
64 * to what is traditionally called ASID on the RISC processors.
66 * We don't use the traditional ASID implementation, where each process/mm gets
67 * its own ASID and flush/restart when we run out of ASID space.
76 * ASID - [0, TLB_NR_DYN_ASIDS-1]
81 * ASID+1, because PCID 0 is special.
85 * PCID values, but we can still do with a single ASID denomination
110 * Given @asid, compute kPCID
112 static inline u16 kern_pcid(u16 asid) in kern_pcid() argument
114 VM_WARN_ON_ONCE(asid > MAX_ASID_AVAILABLE); in kern_pcid()
118 * Make sure that the dynamic ASID space does not conflict with the in kern_pcid()
124 * The ASID being passed in here should have respected the in kern_pcid()
127 VM_WARN_ON_ONCE(asid & (1 << X86_CR3_PTI_PCID_USER_BIT)); in kern_pcid()
134 * If PCID is on, ASID-aware code paths put the ASID+1 into the in kern_pcid()
138 * the TLB for ASID 0 if the saved ASID was nonzero. It also means in kern_pcid()
142 return asid + 1; in kern_pcid()
146 * Given @asid, compute uPCID
148 static inline u16 user_pcid(u16 asid) in user_pcid() argument
150 u16 ret = kern_pcid(asid); in user_pcid()
157 static inline unsigned long build_cr3(pgd_t *pgd, u16 asid, unsigned long lam) in build_cr3() argument
162 cr3 |= kern_pcid(asid); in build_cr3()
164 VM_WARN_ON_ONCE(asid != 0); in build_cr3()
170 static inline unsigned long build_cr3_noflush(pgd_t *pgd, u16 asid, in build_cr3_noflush() argument
179 return build_cr3(pgd, asid, lam) | CR3_NOFLUSH; in build_cr3_noflush()
190 u16 asid; in clear_asid_other() local
201 for (asid = 0; asid < TLB_NR_DYN_ASIDS; asid++) { in clear_asid_other()
202 /* Do not need to flush the current asid */ in clear_asid_other()
203 if (asid == this_cpu_read(cpu_tlbstate.loaded_mm_asid)) in clear_asid_other()
207 * this asid, we do a flush: in clear_asid_other()
209 this_cpu_write(cpu_tlbstate.ctxs[asid].ctx_id, 0); in clear_asid_other()
220 u16 asid; in choose_new_asid() local
231 for (asid = 0; asid < TLB_NR_DYN_ASIDS; asid++) { in choose_new_asid()
232 if (this_cpu_read(cpu_tlbstate.ctxs[asid].ctx_id) != in choose_new_asid()
236 *new_asid = asid; in choose_new_asid()
237 *need_flush = (this_cpu_read(cpu_tlbstate.ctxs[asid].tlb_gen) < in choose_new_asid()
243 * We don't currently own an ASID slot on this CPU. in choose_new_asid()
255 * Given an ASID, flush the corresponding user ASID. We can delay this
260 static inline void invalidate_user_asid(u16 asid) in invalidate_user_asid() argument
262 /* There is no user ASID if address space separation is off */ in invalidate_user_asid()
267 * We only have a single ASID if PCID is off and the CR3 in invalidate_user_asid()
276 __set_bit(kern_pcid(asid), in invalidate_user_asid()
535 * back into an incorrect ASID slot and leave it there in switch_mm_irqs_off()
637 /* The new ASID is already up to date. */ in switch_mm_irqs_off()
681 * - The ASID changed from what cpu_tlbstate thinks it is (most likely
713 /* Disable LAM, force ASID 0 and force a TLB flush. */ in initialize_tlbstate_and_flush()