/linux-6.1.9/arch/arm64/mm/ |
D | context.c | 38 #define ctxid2asid(asid) ((asid) & ~ASID_MASK) argument 39 #define asid2ctxid(asid, genid) ((asid) | (genid)) 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 [all …]
|
/linux-6.1.9/arch/arm/mm/ |
D | context.c | 56 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-6.1.9/arch/csky/mm/ |
D | asid.c | 21 #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-6.1.9/arch/xtensa/include/asm/ |
D | mmu_context.h | 72 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() 120 mm->context.asid[cpu] = NO_CONTEXT; in init_new_context()
|
/linux-6.1.9/arch/sh/include/asm/ |
D | mmu_context_32.h | 6 static inline void set_asid(unsigned long asid) in set_asid() argument 8 __raw_writel(asid, MMU_PTEAEX); in set_asid() 16 static inline void set_asid(unsigned long asid) in set_asid() argument 25 : "r" (asid), "m" (__m(MMU_PTEH)), in set_asid() 31 unsigned long asid; in get_asid() local 34 : "=r" (asid) in get_asid() 36 asid &= MMU_CONTEXT_ASID_MASK; in get_asid() 37 return asid; in get_asid()
|
D | mmu_context.h | 57 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() 128 #define set_asid(asid) do { } while (0) argument 131 #define switch_and_save_asid(asid) (0) argument
|
D | tlbflush.h | 23 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-6.1.9/arch/sh/mm/ |
D | tlbflush_32.c | 21 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 …]
|
/linux-6.1.9/arch/x86/mm/ |
D | tlb.c | 112 static inline u16 kern_pcid(u16 asid) in kern_pcid() argument 114 VM_WARN_ON_ONCE(asid > MAX_ASID_AVAILABLE); in kern_pcid() 127 VM_WARN_ON_ONCE(asid & (1 << X86_CR3_PTI_PCID_USER_BIT)); in kern_pcid() 142 return asid + 1; in kern_pcid() 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) in build_cr3() argument 160 return __sme_pa(pgd) | kern_pcid(asid); in build_cr3() 162 VM_WARN_ON_ONCE(asid != 0); in build_cr3() 167 static inline unsigned long build_cr3_noflush(pgd_t *pgd, u16 asid) in build_cr3_noflush() argument [all …]
|
/linux-6.1.9/arch/arm64/include/asm/ |
D | tlbflush.h | 57 #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; in flush_tlb_mm() local 251 asid = __TLBI_VADDR(0, ASID(mm)); in flush_tlb_mm() 252 __tlbi(aside1is, asid); in flush_tlb_mm() 253 __tlbi_user(aside1is, asid); in flush_tlb_mm() 288 unsigned long asid, addr, pages; in __flush_tlb_range() local 308 asid = ASID(vma->vm_mm); in __flush_tlb_range() [all …]
|
/linux-6.1.9/arch/riscv/kvm/ |
D | tlb.c | 79 unsigned long asid, in kvm_riscv_local_hfence_vvma_asid_gva() argument 87 kvm_riscv_local_hfence_vvma_asid_all(vmid, asid); in kvm_riscv_local_hfence_vvma_asid_gva() 97 : : "r" (pos), "r" (asid) : "memory"); in kvm_riscv_local_hfence_vvma_asid_gva() 102 : : "r" (pos), "r" (asid) : "memory"); in kvm_riscv_local_hfence_vvma_asid_gva() 109 unsigned long asid) in kvm_riscv_local_hfence_vvma_asid_all() argument 115 asm volatile(HFENCE_VVMA(zero, %0) : : "r" (asid) : "memory"); in kvm_riscv_local_hfence_vvma_asid_all() 268 READ_ONCE(v->vmid), d.asid, in kvm_riscv_hfence_process() 273 READ_ONCE(v->vmid), d.asid); in kvm_riscv_hfence_process() 337 data.asid = 0; in kvm_riscv_hfence_gvma_vmid_gpa() 355 unsigned long order, unsigned long asid) in kvm_riscv_hfence_vvma_asid_gva() argument [all …]
|
/linux-6.1.9/drivers/vhost/ |
D | vdpa.c | 70 u64 last, u32 asid); 79 static struct vhost_vdpa_as *asid_to_as(struct vhost_vdpa *v, u32 asid) in asid_to_as() argument 81 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in asid_to_as() 85 if (as->id == asid) in asid_to_as() 91 static struct vhost_iotlb *asid_to_iotlb(struct vhost_vdpa *v, u32 asid) in asid_to_iotlb() argument 93 struct vhost_vdpa_as *as = asid_to_as(v, asid); in asid_to_iotlb() 101 static struct vhost_vdpa_as *vhost_vdpa_alloc_as(struct vhost_vdpa *v, u32 asid) in vhost_vdpa_alloc_as() argument 103 struct hlist_head *head = &v->as[asid % VHOST_VDPA_IOTLB_BUCKETS]; in vhost_vdpa_alloc_as() 106 if (asid_to_as(v, asid)) in vhost_vdpa_alloc_as() 109 if (asid >= v->vdpa->nas) in vhost_vdpa_alloc_as() [all …]
|
/linux-6.1.9/drivers/misc/sgi-gru/ |
D | grumain.c | 93 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 …]
|
D | grutlbpurge.c | 152 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()
|
D | gruhandles.c | 141 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-6.1.9/arch/loongarch/include/asm/ |
D | mmu_context.h | 34 #define cpu_context(cpu, mm) ((mm)->context.asid[cpu]) 54 u64 asid = asid_cache(cpu); in get_new_mmu_context() local 56 if (!((++asid) & cpu_asid_mask(&cpu_data[cpu]))) in get_new_mmu_context() 59 cpu_context(cpu, mm) = asid_cache(cpu) = asid; in get_new_mmu_context() 130 int asid; in drop_mmu_context() local 135 asid = read_csr_asid() & cpu_asid_mask(¤t_cpu_data); in drop_mmu_context() 137 if (asid == cpu_asid(cpu, mm)) { in drop_mmu_context()
|
/linux-6.1.9/drivers/misc/habanalabs/common/ |
D | asid.c | 50 void hl_asid_free(struct hl_device *hdev, unsigned long asid) in hl_asid_free() argument 52 if (asid == HL_KERNEL_ASID_ID || asid >= hdev->asic_prop.max_asid) { in hl_asid_free() 53 dev_crit(hdev->dev, "Invalid ASID %lu", asid); in hl_asid_free() 57 clear_bit(asid, hdev->asid_bitmap); in hl_asid_free()
|
/linux-6.1.9/drivers/iommu/arm/arm-smmu-v3/ |
D | arm-smmu-v3-sva.c | 45 arm_smmu_share_asid(struct mm_struct *mm, u16 asid) in arm_smmu_share_asid() argument 53 cd = xa_load(&arm_smmu_asid_xa, asid); in arm_smmu_share_asid() 77 cd->asid = new_asid; in arm_smmu_share_asid() 86 arm_smmu_tlb_inv_asid(smmu, asid); in arm_smmu_share_asid() 88 xa_erase(&arm_smmu_asid_xa, asid); in arm_smmu_share_asid() 94 u16 asid; in arm_smmu_alloc_shared_cd() local 103 asid = arm64_mm_context_get(mm); in arm_smmu_alloc_shared_cd() 104 if (!asid) { in arm_smmu_alloc_shared_cd() 118 ret = arm_smmu_share_asid(mm, asid); in arm_smmu_alloc_shared_cd() 124 err = xa_insert(&arm_smmu_asid_xa, asid, cd, GFP_KERNEL); in arm_smmu_alloc_shared_cd() [all …]
|
/linux-6.1.9/arch/mips/lib/ |
D | r3k_dump_tlb.c | 27 unsigned int asid; in dump_tlb() local 31 asid = read_c0_entryhi() & asid_mask; in dump_tlb() 46 (entryhi & asid_mask) == asid)) { in dump_tlb() 65 write_c0_entryhi(asid); in dump_tlb()
|
/linux-6.1.9/arch/riscv/include/asm/ |
D | tlbflush.h | 26 static inline void local_flush_tlb_all_asid(unsigned long asid) in local_flush_tlb_all_asid() argument 30 : "r" (asid) in local_flush_tlb_all_asid() 35 unsigned long asid) in local_flush_tlb_page_asid() argument 39 : "r" (addr), "r" (asid) in local_flush_tlb_page_asid()
|
D | insn-def.h | 92 #define HFENCE_VVMA(vaddr, asid) \ argument 94 __RD(0), RS1(vaddr), RS2(asid)) 117 #define SINVAL_VMA(vaddr, asid) \ argument 119 __RD(0), RS1(vaddr), RS2(asid)) 129 #define HINVAL_VVMA(vaddr, asid) \ argument 131 __RD(0), RS1(vaddr), RS2(asid))
|
/linux-6.1.9/drivers/misc/habanalabs/gaudi/ |
D | gaudi.c | 482 static int gaudi_mmu_update_asid_hop0_addr(struct hl_device *hdev, u32 asid, 495 static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid); 5925 static int gaudi_context_switch(struct hl_device *hdev, u32 asid) in gaudi_context_switch() argument 6122 void gaudi_mmu_prepare_reg(struct hl_device *hdev, u64 reg, u32 asid) in gaudi_mmu_prepare_reg() argument 6126 WREG32_OR(reg, asid); in gaudi_mmu_prepare_reg() 6129 static void gaudi_mmu_prepare(struct hl_device *hdev, u32 asid) in gaudi_mmu_prepare() argument 6136 if (asid & ~DMA0_QM_GLBL_NON_SECURE_PROPS_0_ASID_MASK) { in gaudi_mmu_prepare() 6137 dev_crit(hdev->dev, "asid %u is too big\n", asid); in gaudi_mmu_prepare() 6141 gaudi_mmu_prepare_reg(hdev, mmDMA0_QM_GLBL_NON_SECURE_PROPS_0, asid); in gaudi_mmu_prepare() 6142 gaudi_mmu_prepare_reg(hdev, mmDMA0_QM_GLBL_NON_SECURE_PROPS_1, asid); in gaudi_mmu_prepare() [all …]
|
/linux-6.1.9/arch/riscv/mm/ |
D | context.c | 99 unsigned long asid, ver = atomic_long_read(¤t_version); in __new_context() local 126 asid = find_next_zero_bit(context_asid_map, num_asids, cur_idx); in __new_context() 127 if (asid != num_asids) in __new_context() 137 asid = find_next_zero_bit(context_asid_map, num_asids, 1); in __new_context() 140 __set_bit(asid, context_asid_map); in __new_context() 141 cur_idx = asid; in __new_context() 142 return asid | ver; in __new_context()
|
D | tlbflush.c | 30 unsigned long asid = atomic_long_read(&mm->context.id); in __sbi_tlb_flush_range() local 42 sbi_remote_sfence_vma_asid(cmask, start, size, asid); in __sbi_tlb_flush_range() 44 local_flush_tlb_page_asid(start, asid); in __sbi_tlb_flush_range() 46 local_flush_tlb_all_asid(asid); in __sbi_tlb_flush_range()
|
/linux-6.1.9/arch/csky/include/asm/ |
D | asid.h | 46 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()
|