Lines Matching refs:asid
103 static inline u16 kern_pcid(u16 asid) in kern_pcid() argument
105 VM_WARN_ON_ONCE(asid > MAX_ASID_AVAILABLE); in kern_pcid()
118 VM_WARN_ON_ONCE(asid & (1 << X86_CR3_PTI_PCID_USER_BIT)); in kern_pcid()
133 return asid + 1; in kern_pcid()
139 static inline u16 user_pcid(u16 asid) in user_pcid() argument
141 u16 ret = kern_pcid(asid); in user_pcid()
148 static inline unsigned long build_cr3(pgd_t *pgd, u16 asid) in build_cr3() argument
151 return __sme_pa(pgd) | kern_pcid(asid); in build_cr3()
153 VM_WARN_ON_ONCE(asid != 0); in build_cr3()
158 static inline unsigned long build_cr3_noflush(pgd_t *pgd, u16 asid) in build_cr3_noflush() argument
160 VM_WARN_ON_ONCE(asid > MAX_ASID_AVAILABLE); in build_cr3_noflush()
167 return __sme_pa(pgd) | kern_pcid(asid) | CR3_NOFLUSH; in build_cr3_noflush()
178 u16 asid; in clear_asid_other() local
189 for (asid = 0; asid < TLB_NR_DYN_ASIDS; asid++) { in clear_asid_other()
191 if (asid == this_cpu_read(cpu_tlbstate.loaded_mm_asid)) in clear_asid_other()
197 this_cpu_write(cpu_tlbstate.ctxs[asid].ctx_id, 0); in clear_asid_other()
208 u16 asid; in choose_new_asid() local
219 for (asid = 0; asid < TLB_NR_DYN_ASIDS; asid++) { in choose_new_asid()
220 if (this_cpu_read(cpu_tlbstate.ctxs[asid].ctx_id) != in choose_new_asid()
224 *new_asid = asid; in choose_new_asid()
225 *need_flush = (this_cpu_read(cpu_tlbstate.ctxs[asid].tlb_gen) < in choose_new_asid()
248 static inline void invalidate_user_asid(u16 asid) in invalidate_user_asid() argument
264 __set_bit(kern_pcid(asid), in invalidate_user_asid()