Home
last modified time | relevance | path

Searched refs:asid (Results 1 – 25 of 86) sorted by relevance

1234

/Linux-v5.10/arch/arm64/mm/
Dcontext.c38 #define asid2idx(asid) ((asid) & ~ASID_MASK) argument
44 u32 asid; in get_cpu_asid_bits() local
54 asid = 8; in get_cpu_asid_bits()
57 asid = 16; in get_cpu_asid_bits()
60 return asid; in get_cpu_asid_bits()
66 u32 asid = get_cpu_asid_bits(); in verify_cpu_asid_bits() local
68 if (asid < asid_bits) { in verify_cpu_asid_bits()
74 smp_processor_id(), asid, asid_bits); in verify_cpu_asid_bits()
101 #define asid_gen_match(asid) \ argument
102 (!(((asid) ^ atomic64_read(&asid_generation)) >> asid_bits))
[all …]
/Linux-v5.10/arch/arm/mm/
Dcontext.c56 u64 context_id, asid; in a15_erratum_get_cpumask() local
67 asid = per_cpu(active_asids, cpu).counter; in a15_erratum_get_cpumask()
68 if (asid == 0) in a15_erratum_get_cpumask()
69 asid = per_cpu(reserved_asids, cpu); in a15_erratum_get_cpumask()
70 if (context_id == asid) in a15_erratum_get_cpumask()
139 u64 asid; in flush_context() local
144 asid = atomic64_xchg(&per_cpu(active_asids, i), 0); in flush_context()
152 if (asid == 0) in flush_context()
153 asid = per_cpu(reserved_asids, i); in flush_context()
154 __set_bit(asid & ~ASID_MASK, asid_map); in flush_context()
[all …]
/Linux-v5.10/arch/csky/mm/
Dasid.c21 #define asid2idx(info, asid) (((asid) & ~ASID_MASK(info)) >> (info)->ctxt_shift) argument
27 u64 asid; in flush_context() local
33 asid = atomic64_xchg_relaxed(&active_asid(info, i), 0); in flush_context()
41 if (asid == 0) in flush_context()
42 asid = reserved_asid(info, i); in flush_context()
43 __set_bit(asid2idx(info, asid), info->map); in flush_context()
44 reserved_asid(info, i) = asid; in flush_context()
54 static bool check_update_reserved_asid(struct asid_info *info, u64 asid, in check_update_reserved_asid() argument
70 if (reserved_asid(info, cpu) == asid) { in check_update_reserved_asid()
83 u64 asid = atomic64_read(pasid); in new_context() local
[all …]
/Linux-v5.10/arch/xtensa/include/asm/
Dmmu_context.h72 unsigned long asid = cpu_asid_cache(cpu); in get_new_mmu_context() local
73 if ((++asid & ASID_MASK) == 0) { in get_new_mmu_context()
79 asid += ASID_USER_FIRST; in get_new_mmu_context()
81 cpu_asid_cache(cpu) = asid; in get_new_mmu_context()
82 mm->context.asid[cpu] = asid; in get_new_mmu_context()
93 unsigned long asid = mm->context.asid[cpu]; in get_mmu_context() local
95 if (asid == NO_CONTEXT || in get_mmu_context()
96 ((asid ^ cpu_asid_cache(cpu)) & ~ASID_MASK)) in get_mmu_context()
104 set_rasid_register(ASID_INSERT(mm->context.asid[cpu])); in activate_context()
119 mm->context.asid[cpu] = NO_CONTEXT; in init_new_context()
/Linux-v5.10/arch/sh/include/asm/
Dmmu_context_32.h15 static inline void set_asid(unsigned long asid) in set_asid() argument
17 __raw_writel(asid, MMU_PTEAEX); in set_asid()
25 static inline void set_asid(unsigned long asid) in set_asid() argument
34 : "r" (asid), "m" (__m(MMU_PTEH)), in set_asid()
40 unsigned long asid; in get_asid() local
43 : "=r" (asid) in get_asid()
45 asid &= MMU_CONTEXT_ASID_MASK; in get_asid()
46 return asid; in get_asid()
Dmmu_context.h57 unsigned long asid = asid_cache(cpu); in get_mmu_context() local
60 if (((cpu_context(cpu, mm) ^ asid) & MMU_CONTEXT_VERSION_MASK) == 0) in get_mmu_context()
65 if (!(++asid & MMU_CONTEXT_ASID_MASK)) { in get_mmu_context()
76 if (!asid) in get_mmu_context()
77 asid = MMU_CONTEXT_FIRST_VERSION; in get_mmu_context()
80 cpu_context(cpu, mm) = asid_cache(cpu) = asid; in get_mmu_context()
129 #define set_asid(asid) do { } while (0) argument
132 #define switch_and_save_asid(asid) (0) argument
Dtlbflush.h23 extern void local_flush_tlb_one(unsigned long asid, unsigned long page);
35 extern void flush_tlb_one(unsigned long asid, unsigned long page);
42 #define flush_tlb_one(asid, page) local_flush_tlb_one(asid, page) argument
/Linux-v5.10/arch/sh/mm/
Dtlbflush_32.c21 unsigned long asid; in local_flush_tlb_page() local
24 asid = cpu_asid(cpu, vma->vm_mm); in local_flush_tlb_page()
30 set_asid(asid); in local_flush_tlb_page()
32 local_flush_tlb_one(asid, page); in local_flush_tlb_page()
56 unsigned long asid; in local_flush_tlb_range() local
59 asid = cpu_asid(cpu, mm); in local_flush_tlb_range()
65 set_asid(asid); in local_flush_tlb_range()
68 local_flush_tlb_one(asid, start); in local_flush_tlb_range()
89 unsigned long asid; in local_flush_tlb_kernel_range() local
92 asid = cpu_asid(cpu, &init_mm); in local_flush_tlb_kernel_range()
[all …]
Dtlb-pteaex.c70 void local_flush_tlb_one(unsigned long asid, unsigned long page) in local_flush_tlb_one() argument
74 __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); in local_flush_tlb_one()
76 __raw_writel(asid, MMU_ITLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); in local_flush_tlb_one()
/Linux-v5.10/drivers/iommu/arm/arm-smmu-v3/
Darm-smmu-v3-sva.c20 arm_smmu_share_asid(struct mm_struct *mm, u16 asid) in arm_smmu_share_asid() argument
28 cd = xa_load(&arm_smmu_asid_xa, asid); in arm_smmu_share_asid()
52 cd->asid = new_asid; in arm_smmu_share_asid()
61 arm_smmu_tlb_inv_asid(smmu, asid); in arm_smmu_share_asid()
63 xa_erase(&arm_smmu_asid_xa, asid); in arm_smmu_share_asid()
70 u16 asid; in arm_smmu_alloc_shared_cd() local
76 asid = arm64_mm_context_get(mm); in arm_smmu_alloc_shared_cd()
77 if (!asid) in arm_smmu_alloc_shared_cd()
89 ret = arm_smmu_share_asid(mm, asid); in arm_smmu_alloc_shared_cd()
95 err = xa_insert(&arm_smmu_asid_xa, asid, cd, GFP_KERNEL); in arm_smmu_alloc_shared_cd()
[all …]
/Linux-v5.10/arch/x86/mm/
Dtlb.c103 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
[all …]
/Linux-v5.10/arch/arm64/include/asm/
Dtlbflush.h57 #define __TLBI_VADDR(addr, asid) \ argument
61 __ta |= (unsigned long)(asid) << 48; \
136 #define __TLBI_VADDR_RANGE(addr, asid, scale, num, ttl) \ argument
144 __ta |= (unsigned long)(asid) << 48; \
248 unsigned long asid = __TLBI_VADDR(0, ASID(mm)); in flush_tlb_mm() local
251 __tlbi(aside1is, asid); in flush_tlb_mm()
252 __tlbi_user(aside1is, asid); in flush_tlb_mm()
286 unsigned long asid = ASID(vma->vm_mm); in __flush_tlb_range() local
330 addr = __TLBI_VADDR(start, asid); in __flush_tlb_range()
345 addr = __TLBI_VADDR_RANGE(start, asid, scale, in __flush_tlb_range()
/Linux-v5.10/drivers/misc/sgi-gru/
Dgrumain.c93 static int gru_reset_asid_limit(struct gru_state *gru, int asid) in gru_reset_asid_limit() argument
97 gru_dbg(grudev, "gid %d, asid 0x%x\n", gru->gs_gid, asid); in gru_reset_asid_limit()
100 if (asid >= limit) in gru_reset_asid_limit()
101 asid = gru_wrap_asid(gru); in gru_reset_asid_limit()
112 if (inuse_asid == asid) { in gru_reset_asid_limit()
113 asid += ASID_INC; in gru_reset_asid_limit()
114 if (asid >= limit) { in gru_reset_asid_limit()
120 if (asid >= MAX_ASID) in gru_reset_asid_limit()
121 asid = gru_wrap_asid(gru); in gru_reset_asid_limit()
126 if ((inuse_asid > asid) && (inuse_asid < limit)) in gru_reset_asid_limit()
[all …]
Dgrutlbpurge.c152 int grupagesize, pagesize, pageshift, gid, asid; in gru_flush_tlb_range() local
169 asid = asids->mt_asid; in gru_flush_tlb_range()
170 if (asids->mt_ctxbitmap && asid) { in gru_flush_tlb_range()
172 asid = GRUASID(asid, start); in gru_flush_tlb_range()
175 gid, asid, start, grupagesize, num, asids->mt_ctxbitmap); in gru_flush_tlb_range()
177 tgh_invalidate(tgh, start, ~0, asid, grupagesize, 0, in gru_flush_tlb_range()
186 gid, asid, asids->mt_ctxbitmap, in gru_flush_tlb_range()
Dgruhandles.c141 int asid, int pagesize, int global, int n, in tgh_invalidate() argument
145 tgh->asid = asid; in tgh_invalidate()
158 unsigned long vaddr, int asid, int dirty, in tfh_write_only() argument
161 tfh->fillasid = asid; in tfh_write_only()
174 unsigned long vaddr, int asid, int dirty, in tfh_write_restart() argument
177 tfh->fillasid = asid; in tfh_write_restart()
/Linux-v5.10/drivers/misc/habanalabs/common/
Dasid.c51 void hl_asid_free(struct hl_device *hdev, unsigned long asid) in hl_asid_free() argument
53 if (WARN((asid == 0 || asid >= hdev->asic_prop.max_asid), in hl_asid_free()
54 "Invalid ASID %lu", asid)) in hl_asid_free()
56 clear_bit(asid, hdev->asid_bitmap); in hl_asid_free()
Dcontext.c31 if (ctx->asid != HL_KERNEL_ASID_ID) { in hl_ctx_fini()
32 dev_dbg(hdev->dev, "closing user context %d\n", ctx->asid); in hl_ctx_fini()
45 hl_asid_free(hdev, ctx->asid); in hl_ctx_fini()
149 ctx->asid = HL_KERNEL_ASID_ID; /* Kernel driver gets ASID 0 */ in hl_ctx_init()
156 ctx->asid = hl_asid_alloc(hdev); in hl_ctx_init()
157 if (!ctx->asid) { in hl_ctx_init()
183 dev_dbg(hdev->dev, "create user context %d\n", ctx->asid); in hl_ctx_init()
193 hl_asid_free(hdev, ctx->asid); in hl_ctx_init()
/Linux-v5.10/arch/mips/lib/
Dr3k_dump_tlb.c31 unsigned int asid; in dump_tlb() local
35 asid = read_c0_entryhi() & asid_mask; in dump_tlb()
50 (entryhi & asid_mask) == asid)) { in dump_tlb()
69 write_c0_entryhi(asid); in dump_tlb()
/Linux-v5.10/drivers/misc/habanalabs/gaudi/
Dgaudi.c353 static int gaudi_mmu_update_asid_hop0_addr(struct hl_device *hdev, u32 asid,
364 static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid);
4488 static int gaudi_context_switch(struct hl_device *hdev, u32 asid) in gaudi_context_switch() argument
4503 gaudi_mmu_prepare(hdev, asid); in gaudi_context_switch()
4745 void gaudi_mmu_prepare_reg(struct hl_device *hdev, u64 reg, u32 asid) in gaudi_mmu_prepare_reg() argument
4749 WREG32_OR(reg, asid); in gaudi_mmu_prepare_reg()
4752 static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid) in gaudi_mmu_prepare() argument
4759 if (asid & ~DMA0_QM_GLBL_NON_SECURE_PROPS_0_ASID_MASK) { in gaudi_mmu_prepare()
4760 WARN(1, "asid %u is too big\n", asid); in gaudi_mmu_prepare()
4768 gaudi_mmu_prepare_reg(hdev, mmDMA0_QM_GLBL_NON_SECURE_PROPS_0, asid); in gaudi_mmu_prepare()
[all …]
/Linux-v5.10/arch/csky/include/asm/
Dasid.h46 u64 asid, old_active_asid; in asid_check_context() local
48 asid = atomic64_read(pasid); in asid_check_context()
66 !((asid ^ atomic64_read(&info->generation)) >> info->bits) && in asid_check_context()
68 old_active_asid, asid)) in asid_check_context()
Dmmu_context.h24 #define cpu_asid(mm) (atomic64_read(&mm->context.asid) & ASID_MASK)
26 #define init_new_context(tsk,mm) ({ atomic64_set(&(mm)->context.asid, 0); 0; })
45 write_mmu_entryhi(next->context.asid.counter); in switch_mm()
/Linux-v5.10/arch/xtensa/mm/
Dtlb.c70 mm->context.asid[cpu] = NO_CONTEXT; in local_flush_tlb_mm()
74 mm->context.asid[cpu] = NO_CONTEXT; in local_flush_tlb_mm()
95 if (mm->context.asid[cpu] == NO_CONTEXT) in local_flush_tlb_range()
99 (unsigned long)mm->context.asid[cpu], start, end); in local_flush_tlb_range()
105 set_rasid_register(ASID_INSERT(mm->context.asid[cpu])); in local_flush_tlb_range()
133 if (mm->context.asid[cpu] == NO_CONTEXT) in local_flush_tlb_page()
139 set_rasid_register(ASID_INSERT(mm->context.asid[cpu])); in local_flush_tlb_page()
/Linux-v5.10/drivers/iommu/arm/arm-smmu/
Dqcom_iommu.c64 u8 asid; /* asid and ctx bank # are 1:1 */ member
94 static struct qcom_iommu_ctx * to_ctx(struct qcom_iommu_domain *d, unsigned asid) in to_ctx() argument
99 return qcom_iommu->ctxs[asid - 1]; in to_ctx()
153 iommu_writel(ctx, ARM_SMMU_CB_S1_TLBIASID, ctx->asid); in qcom_iommu_tlb_inv_context()
173 iova |= ctx->asid; in qcom_iommu_tlb_inv_range_nosync()
227 fsr, iova, fsynr, ctx->asid); in qcom_iommu_fault()
278 ret = qcom_scm_restore_sec_cfg(qcom_iommu->sec_id, ctx->asid); in qcom_iommu_init_domain()
289 FIELD_PREP(ARM_SMMU_TTBRn_ASID, ctx->asid)); in qcom_iommu_init_domain()
567 unsigned asid = args->args[0]; in qcom_iommu_of_xlate() local
586 if (WARN_ON(asid < 1) || in qcom_iommu_of_xlate()
[all …]
/Linux-v5.10/arch/mips/mm/
Dcontext.c24 u64 asid; in get_new_mmu_context() local
34 asid = asid_cache(cpu); in get_new_mmu_context()
36 if (!((asid += cpu_asid_inc()) & cpu_asid_mask(&cpu_data[cpu]))) { in get_new_mmu_context()
42 set_cpu_context(cpu, mm, asid); in get_new_mmu_context()
43 asid_cache(cpu) = asid; in get_new_mmu_context()
/Linux-v5.10/arch/mips/dec/
Dkn01-berr.c79 long asid, entryhi, vaddr; in dec_kn01_be_backend() local
109 asid = read_c0_entryhi(); in dec_kn01_be_backend()
110 entryhi = asid & (PAGE_SIZE - 1); in dec_kn01_be_backend()
118 write_c0_entryhi(asid); in dec_kn01_be_backend()

1234