/arch/powerpc/include/asm/ |
D | mmu_context.h | 18 extern int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 20 extern void destroy_context(struct mm_struct *mm); 25 extern bool mm_iommu_preregistered(struct mm_struct *mm); 26 extern long mm_iommu_new(struct mm_struct *mm, 29 extern long mm_iommu_newdev(struct mm_struct *mm, unsigned long ua, 32 extern long mm_iommu_put(struct mm_struct *mm, 34 extern void mm_iommu_init(struct mm_struct *mm); 35 extern void mm_iommu_cleanup(struct mm_struct *mm); 36 extern struct mm_iommu_table_group_mem_t *mm_iommu_lookup(struct mm_struct *mm, 39 struct mm_struct *mm, unsigned long ua, unsigned long size); [all …]
|
D | pkeys.h | 52 #define mm_pkey_allocation_map(mm) (mm->context.pkey_allocation_map) argument 54 #define __mm_pkey_allocated(mm, pkey) { \ argument 55 mm_pkey_allocation_map(mm) |= pkey_alloc_mask(pkey); \ 58 #define __mm_pkey_free(mm, pkey) { \ argument 59 mm_pkey_allocation_map(mm) &= ~pkey_alloc_mask(pkey); \ 62 #define __mm_pkey_is_allocated(mm, pkey) \ argument 63 (mm_pkey_allocation_map(mm) & pkey_alloc_mask(pkey)) 68 static inline bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument 77 return __mm_pkey_is_allocated(mm, pkey); in mm_pkey_is_allocated() 85 static inline int mm_pkey_alloc(struct mm_struct *mm) in mm_pkey_alloc() argument [all …]
|
/arch/s390/include/asm/ |
D | pgalloc.h | 26 struct page *page_table_alloc_pgste(struct mm_struct *mm); 37 int crst_table_upgrade(struct mm_struct *mm, unsigned long limit); 39 static inline unsigned long check_asce_limit(struct mm_struct *mm, unsigned long addr, in check_asce_limit() argument 44 if (addr + len > mm->context.asce_limit && in check_asce_limit() 46 rc = crst_table_upgrade(mm, addr + len); in check_asce_limit() 53 static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long address) in p4d_alloc_one() argument 55 unsigned long *table = crst_table_alloc(mm); in p4d_alloc_one() 62 static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) in p4d_free() argument 64 if (!mm_p4d_folded(mm)) in p4d_free() 65 crst_table_free(mm, (unsigned long *) p4d); in p4d_free() [all …]
|
D | mmu_context.h | 20 struct mm_struct *mm) in init_new_context() argument 24 spin_lock_init(&mm->context.lock); in init_new_context() 25 INIT_LIST_HEAD(&mm->context.pgtable_list); in init_new_context() 26 INIT_LIST_HEAD(&mm->context.gmap_list); in init_new_context() 27 cpumask_clear(&mm->context.cpu_attach_mask); in init_new_context() 28 atomic_set(&mm->context.flush_count, 0); in init_new_context() 29 atomic_set(&mm->context.is_protected, 0); in init_new_context() 30 mm->context.gmap_asce = 0; in init_new_context() 31 mm->context.flush_mm = 0; in init_new_context() 33 mm->context.alloc_pgste = page_table_allocate_pgste || in init_new_context() [all …]
|
D | tlbflush.h | 47 static inline void __tlb_flush_mm(struct mm_struct *mm) in __tlb_flush_mm() argument 57 atomic_inc(&mm->context.flush_count); in __tlb_flush_mm() 59 cpumask_copy(mm_cpumask(mm), &mm->context.cpu_attach_mask); in __tlb_flush_mm() 61 gmap_asce = READ_ONCE(mm->context.gmap_asce); in __tlb_flush_mm() 65 __tlb_flush_idte(mm->context.asce); in __tlb_flush_mm() 70 atomic_dec(&mm->context.flush_count); in __tlb_flush_mm() 82 static inline void __tlb_flush_mm_lazy(struct mm_struct * mm) in __tlb_flush_mm_lazy() argument 84 spin_lock(&mm->context.lock); in __tlb_flush_mm_lazy() 85 if (mm->context.flush_mm) { in __tlb_flush_mm_lazy() 86 mm->context.flush_mm = 0; in __tlb_flush_mm_lazy() [all …]
|
/arch/x86/include/asm/ |
D | mmu_context.h | 61 static inline void init_new_context_ldt(struct mm_struct *mm) in init_new_context_ldt() argument 63 mm->context.ldt = NULL; in init_new_context_ldt() 64 init_rwsem(&mm->context.ldt_usr_sem); in init_new_context_ldt() 66 int ldt_dup_context(struct mm_struct *oldmm, struct mm_struct *mm); 67 void destroy_context_ldt(struct mm_struct *mm); 68 void ldt_arch_exit_mmap(struct mm_struct *mm); 70 static inline void init_new_context_ldt(struct mm_struct *mm) { } in init_new_context_ldt() argument 72 struct mm_struct *mm) in ldt_dup_context() argument 76 static inline void destroy_context_ldt(struct mm_struct *mm) { } in destroy_context_ldt() argument 77 static inline void ldt_arch_exit_mmap(struct mm_struct *mm) { } in ldt_arch_exit_mmap() argument [all …]
|
D | pkeys.h | 24 extern int __execute_only_pkey(struct mm_struct *mm); 25 static inline int execute_only_pkey(struct mm_struct *mm) in execute_only_pkey() argument 30 return __execute_only_pkey(mm); in execute_only_pkey() 49 #define mm_pkey_allocation_map(mm) (mm->context.pkey_allocation_map) argument 50 #define mm_set_pkey_allocated(mm, pkey) do { \ argument 51 mm_pkey_allocation_map(mm) |= (1U << pkey); \ 53 #define mm_set_pkey_free(mm, pkey) do { \ argument 54 mm_pkey_allocation_map(mm) &= ~(1U << pkey); \ 58 bool mm_pkey_is_allocated(struct mm_struct *mm, int pkey) in mm_pkey_is_allocated() argument 74 if (pkey == mm->context.execute_only_pkey) in mm_pkey_is_allocated() [all …]
|
D | pgalloc.h | 13 static inline int __paravirt_pgd_alloc(struct mm_struct *mm) { return 0; } in __paravirt_pgd_alloc() argument 18 #define paravirt_pgd_alloc(mm) __paravirt_pgd_alloc(mm) argument 19 static inline void paravirt_pgd_free(struct mm_struct *mm, pgd_t *pgd) {} in paravirt_pgd_free() argument 20 static inline void paravirt_alloc_pte(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pte() argument 21 static inline void paravirt_alloc_pmd(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pmd() argument 24 static inline void paravirt_alloc_pud(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_pud() argument 25 static inline void paravirt_alloc_p4d(struct mm_struct *mm, unsigned long pfn) {} in paravirt_alloc_p4d() argument 52 extern void pgd_free(struct mm_struct *mm, pgd_t *pgd); 64 static inline void pmd_populate_kernel(struct mm_struct *mm, in pmd_populate_kernel() argument 67 paravirt_alloc_pte(mm, __pa(pte) >> PAGE_SHIFT); in pmd_populate_kernel() [all …]
|
/arch/m68k/include/asm/ |
D | mmu_context.h | 28 static inline void get_mmu_context(struct mm_struct *mm) in get_mmu_context() argument 32 if (mm->context != NO_CONTEXT) in get_mmu_context() 45 mm->context = ctx; in get_mmu_context() 46 context_mm[ctx] = mm; in get_mmu_context() 52 #define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0) argument 58 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument 60 if (mm->context != NO_CONTEXT) { in destroy_context() 61 clear_bit(mm->context, context_map); in destroy_context() 62 mm->context = NO_CONTEXT; in destroy_context() 75 get_mmu_context(tsk->mm); in switch_mm() [all …]
|
/arch/powerpc/mm/book3s64/ |
D | mmu_context.c | 92 static int hash__init_new_context(struct mm_struct *mm) in hash__init_new_context() argument 96 mm->context.hash_context = kmalloc(sizeof(struct hash_mm_context), in hash__init_new_context() 98 if (!mm->context.hash_context) in hash__init_new_context() 115 if (mm->context.id == 0) { in hash__init_new_context() 116 memset(mm->context.hash_context, 0, sizeof(struct hash_mm_context)); in hash__init_new_context() 117 slice_init_new_context_exec(mm); in hash__init_new_context() 120 …memcpy(mm->context.hash_context, current->mm->context.hash_context, sizeof(struct hash_mm_context)… in hash__init_new_context() 123 if (current->mm->context.hash_context->spt) { in hash__init_new_context() 124 mm->context.hash_context->spt = kmalloc(sizeof(struct subpage_prot_table), in hash__init_new_context() 126 if (!mm->context.hash_context->spt) { in hash__init_new_context() [all …]
|
/arch/sparc/include/asm/ |
D | mmu_context_64.h | 24 void get_new_mmu_context(struct mm_struct *mm); 27 int init_new_context(struct task_struct *tsk, struct mm_struct *mm); 29 void destroy_context(struct mm_struct *mm); 37 static inline void tsb_context_switch_ctx(struct mm_struct *mm, in tsb_context_switch_ctx() argument 40 __tsb_context_switch(__pa(mm->pgd), in tsb_context_switch_ctx() 41 &mm->context.tsb_block[MM_TSB_BASE], in tsb_context_switch_ctx() 43 (mm->context.tsb_block[MM_TSB_HUGE].tsb ? in tsb_context_switch_ctx() 44 &mm->context.tsb_block[MM_TSB_HUGE] : in tsb_context_switch_ctx() 49 , __pa(&mm->context.tsb_descr[MM_TSB_BASE]), in tsb_context_switch_ctx() 55 void tsb_grow(struct mm_struct *mm, [all …]
|
/arch/arm/include/asm/ |
D | mmu_context.h | 24 void __check_vmalloc_seq(struct mm_struct *mm); 28 void check_and_switch_context(struct mm_struct *mm, struct task_struct *tsk); 32 init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument 34 atomic64_set(&mm->context.id, 0); in init_new_context() 39 void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, 42 static inline void a15_erratum_get_cpumask(int this_cpu, struct mm_struct *mm, in a15_erratum_get_cpumask() argument 52 static inline void check_and_switch_context(struct mm_struct *mm, in check_and_switch_context() argument 55 if (unlikely(mm->context.vmalloc_seq != init_mm.context.vmalloc_seq)) in check_and_switch_context() 56 __check_vmalloc_seq(mm); in check_and_switch_context() 66 mm->context.switch_pending = 1; in check_and_switch_context() [all …]
|
/arch/mips/include/asm/ |
D | mmu_context.h | 106 static inline u64 cpu_context(unsigned int cpu, const struct mm_struct *mm) in cpu_context() argument 109 return atomic64_read(&mm->context.mmid); in cpu_context() 111 return mm->context.asid[cpu]; in cpu_context() 115 struct mm_struct *mm, u64 ctx) in set_cpu_context() argument 118 atomic64_set(&mm->context.mmid, ctx); in set_cpu_context() 120 mm->context.asid[cpu] = ctx; in set_cpu_context() 124 #define cpu_asid(cpu, mm) \ argument 125 (cpu_context((cpu), (mm)) & cpu_asid_mask(&cpu_data[cpu])) 127 extern void get_new_mmu_context(struct mm_struct *mm); 128 extern void check_mmu_context(struct mm_struct *mm); [all …]
|
/arch/sparc/mm/ |
D | tlb.c | 26 struct mm_struct *mm = tb->mm; in flush_tlb_pending() local 33 if (CTX_VALID(mm->context)) { in flush_tlb_pending() 35 global_flush_tlb_page(mm, tb->vaddrs[0]); in flush_tlb_pending() 38 smp_flush_tlb_pending(tb->mm, tb->tlb_nr, in flush_tlb_pending() 41 __flush_tlb_pending(CTX_HWBITS(tb->mm->context), in flush_tlb_pending() 69 static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr, in tlb_batch_add_one() argument 81 if (unlikely(nr != 0 && mm != tb->mm)) { in tlb_batch_add_one() 87 flush_tsb_user_page(mm, vaddr, hugepage_shift); in tlb_batch_add_one() 88 global_flush_tlb_page(mm, vaddr); in tlb_batch_add_one() 93 tb->mm = mm; in tlb_batch_add_one() [all …]
|
D | tsb.c | 121 struct mm_struct *mm = tb->mm; in flush_tsb_user() local 124 spin_lock_irqsave(&mm->context.lock, flags); in flush_tsb_user() 127 base = (unsigned long) mm->context.tsb_block[MM_TSB_BASE].tsb; in flush_tsb_user() 128 nentries = mm->context.tsb_block[MM_TSB_BASE].tsb_nentries; in flush_tsb_user() 140 else if (mm->context.tsb_block[MM_TSB_HUGE].tsb) { in flush_tsb_user() 141 base = (unsigned long) mm->context.tsb_block[MM_TSB_HUGE].tsb; in flush_tsb_user() 142 nentries = mm->context.tsb_block[MM_TSB_HUGE].tsb_nentries; in flush_tsb_user() 149 spin_unlock_irqrestore(&mm->context.lock, flags); in flush_tsb_user() 152 void flush_tsb_user_page(struct mm_struct *mm, unsigned long vaddr, in flush_tsb_user_page() argument 157 spin_lock_irqsave(&mm->context.lock, flags); in flush_tsb_user_page() [all …]
|
/arch/s390/mm/ |
D | pgtable.c | 47 static inline void ptep_ipte_local(struct mm_struct *mm, unsigned long addr, in ptep_ipte_local() argument 54 asce = READ_ONCE(mm->context.gmap_asce); in ptep_ipte_local() 58 asce = asce ? : mm->context.asce; in ptep_ipte_local() 67 static inline void ptep_ipte_global(struct mm_struct *mm, unsigned long addr, in ptep_ipte_global() argument 74 asce = READ_ONCE(mm->context.gmap_asce); in ptep_ipte_global() 78 asce = asce ? : mm->context.asce; in ptep_ipte_global() 87 static inline pte_t ptep_flush_direct(struct mm_struct *mm, in ptep_flush_direct() argument 96 atomic_inc(&mm->context.flush_count); in ptep_flush_direct() 98 cpumask_equal(mm_cpumask(mm), cpumask_of(smp_processor_id()))) in ptep_flush_direct() 99 ptep_ipte_local(mm, addr, ptep, nodat); in ptep_flush_direct() [all …]
|
/arch/alpha/include/asm/ |
D | tlbflush.h | 21 ev4_flush_tlb_current(struct mm_struct *mm) in ev4_flush_tlb_current() argument 23 __load_new_mm_context(mm); in ev4_flush_tlb_current() 28 ev5_flush_tlb_current(struct mm_struct *mm) in ev5_flush_tlb_current() argument 30 __load_new_mm_context(mm); in ev5_flush_tlb_current() 38 ev4_flush_tlb_current_page(struct mm_struct * mm, in ev4_flush_tlb_current_page() argument 44 __load_new_mm_context(mm); in ev4_flush_tlb_current_page() 51 ev5_flush_tlb_current_page(struct mm_struct * mm, in ev5_flush_tlb_current_page() argument 56 __load_new_mm_context(mm); in ev5_flush_tlb_current_page() 89 flush_tlb_other(struct mm_struct *mm) in flush_tlb_other() argument 91 unsigned long *mmc = &mm->context[smp_processor_id()]; in flush_tlb_other() [all …]
|
/arch/x86/kernel/ |
D | ldt.c | 42 void load_mm_ldt(struct mm_struct *mm) in load_mm_ldt() argument 47 ldt = READ_ONCE(mm->context.ldt); in load_mm_ldt() 138 struct mm_struct *mm = __mm; in flush_ldt() local 140 if (this_cpu_read(cpu_tlbstate.loaded_mm) != mm) in flush_ldt() 143 load_mm_ldt(mm); in flush_ldt() 189 static void do_sanity_check(struct mm_struct *mm, in do_sanity_check() argument 193 if (mm->context.ldt) { in do_sanity_check() 234 static void map_ldt_struct_to_user(struct mm_struct *mm) in map_ldt_struct_to_user() argument 236 pgd_t *k_pgd = pgd_offset(mm, LDT_BASE_ADDR); in map_ldt_struct_to_user() 243 if (boot_cpu_has(X86_FEATURE_PTI) && !mm->context.ldt) in map_ldt_struct_to_user() [all …]
|
/arch/powerpc/mm/ |
D | slice.c | 86 static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, in slice_area_is_free() argument 91 if ((mm_ctx_slb_addr_limit(&mm->context) - len) < addr) in slice_area_is_free() 93 vma = find_vma(mm, addr); in slice_area_is_free() 97 static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice) in slice_low_has_vma() argument 99 return !slice_area_is_free(mm, slice << SLICE_LOW_SHIFT, in slice_low_has_vma() 103 static int slice_high_has_vma(struct mm_struct *mm, unsigned long slice) in slice_high_has_vma() argument 114 return !slice_area_is_free(mm, start, end - start); in slice_high_has_vma() 117 static void slice_mask_for_free(struct mm_struct *mm, struct slice_mask *ret, in slice_mask_for_free() argument 127 if (!slice_low_has_vma(mm, i)) in slice_mask_for_free() 134 if (!slice_high_has_vma(mm, i)) in slice_mask_for_free() [all …]
|
/arch/arm64/include/asm/ |
D | mmu_context.h | 49 void cpu_do_switch_mm(phys_addr_t pgd_phys, struct mm_struct *mm); 51 static inline void cpu_switch_mm(pgd_t *pgd, struct mm_struct *mm) in cpu_switch_mm() argument 55 cpu_do_switch_mm(virt_to_phys(pgd),mm); in cpu_switch_mm() 99 struct mm_struct *mm = current->active_mm; in cpu_uninstall_idmap() local 105 if (mm != &init_mm && !system_uses_ttbr0_pan()) in cpu_uninstall_idmap() 106 cpu_switch_mm(mm->pgd, mm); in cpu_uninstall_idmap() 159 void check_and_switch_context(struct mm_struct *mm); 161 #define init_new_context(tsk, mm) init_new_context(tsk, mm) argument 163 init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument 165 atomic64_set(&mm->context.id, 0); in init_new_context() [all …]
|
/arch/microblaze/include/asm/ |
D | mmu_context_mm.h | 77 static inline void get_mmu_context(struct mm_struct *mm) in get_mmu_context() argument 81 if (mm->context != NO_CONTEXT) in get_mmu_context() 92 mm->context = ctx; in get_mmu_context() 93 context_mm[ctx] = mm; in get_mmu_context() 99 # define init_new_context(tsk, mm) (((mm)->context = NO_CONTEXT), 0) argument 105 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument 107 if (mm->context != NO_CONTEXT) { in destroy_context() 108 clear_bit(mm->context, context_map); in destroy_context() 109 mm->context = NO_CONTEXT; in destroy_context() 128 struct mm_struct *mm) in activate_mm() argument [all …]
|
/arch/arm/mm/ |
D | pgd.c | 30 pgd_t *pgd_alloc(struct mm_struct *mm) in pgd_alloc() argument 57 new_p4d = p4d_alloc(mm, new_pgd + pgd_index(MODULES_VADDR), in pgd_alloc() 62 new_pud = pud_alloc(mm, new_p4d, MODULES_VADDR); in pgd_alloc() 66 new_pmd = pmd_alloc(mm, new_pud, 0); in pgd_alloc() 91 new_p4d = p4d_alloc(mm, new_pgd, 0); in pgd_alloc() 95 new_pud = pud_alloc(mm, new_p4d, 0); in pgd_alloc() 99 new_pmd = pmd_alloc(mm, new_pud, 0); in pgd_alloc() 103 new_pte = pte_alloc_map(mm, new_pmd, 0); in pgd_alloc() 130 pmd_free(mm, new_pmd); in pgd_alloc() 131 mm_dec_nr_pmds(mm); in pgd_alloc() [all …]
|
/arch/arc/include/asm/ |
D | mmu_context.h | 49 #define asid_mm(mm, cpu) mm->context.asid[cpu] argument 50 #define hw_pid(mm, cpu) (asid_mm(mm, cpu) & MM_CTXT_ASID_MASK) argument 59 static inline void get_new_mmu_context(struct mm_struct *mm) in get_new_mmu_context() argument 76 if (!((asid_mm(mm, cpu) ^ asid_cpu(cpu)) & MM_CTXT_CYCLE_MASK)) in get_new_mmu_context() 94 asid_mm(mm, cpu) = asid_cpu(cpu); in get_new_mmu_context() 97 mmu_setup_asid(mm, hw_pid(mm, cpu)); in get_new_mmu_context() 108 init_new_context(struct task_struct *tsk, struct mm_struct *mm) in init_new_context() argument 113 asid_mm(mm, i) = MM_CTXT_NO_ASID; in init_new_context() 119 static inline void destroy_context(struct mm_struct *mm) in destroy_context() argument 125 asid_mm(mm, smp_processor_id()) = MM_CTXT_NO_ASID; in destroy_context()
|
/arch/powerpc/include/asm/book3s/64/ |
D | tlbflush.h | 84 static inline void local_flush_tlb_mm(struct mm_struct *mm) in local_flush_tlb_mm() argument 87 return radix__local_flush_tlb_mm(mm); in local_flush_tlb_mm() 88 return hash__local_flush_tlb_mm(mm); in local_flush_tlb_mm() 99 static inline void local_flush_all_mm(struct mm_struct *mm) in local_flush_all_mm() argument 102 return radix__local_flush_all_mm(mm); in local_flush_all_mm() 103 return hash__local_flush_all_mm(mm); in local_flush_all_mm() 114 static inline void flush_tlb_mm(struct mm_struct *mm) in flush_tlb_mm() argument 117 return radix__flush_tlb_mm(mm); in flush_tlb_mm() 118 return hash__flush_tlb_mm(mm); in flush_tlb_mm() 129 static inline void flush_all_mm(struct mm_struct *mm) in flush_all_mm() argument [all …]
|
D | tlbflush-radix.h | 65 extern void radix__flush_tlb_range_psize(struct mm_struct *mm, unsigned long start, 67 void radix__flush_tlb_pwc_range_psize(struct mm_struct *mm, unsigned long start, 75 extern void radix__local_flush_tlb_mm(struct mm_struct *mm); 76 extern void radix__local_flush_all_mm(struct mm_struct *mm); 78 extern void radix__local_flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr, 82 extern void radix__flush_tlb_mm(struct mm_struct *mm); 83 extern void radix__flush_all_mm(struct mm_struct *mm); 85 extern void radix__flush_tlb_page_psize(struct mm_struct *mm, unsigned long vmaddr, 88 #define radix__flush_tlb_mm(mm) radix__local_flush_tlb_mm(mm) argument 89 #define radix__flush_all_mm(mm) radix__local_flush_all_mm(mm) argument [all …]
|