Lines Matching +full:mm +full:- +full:0

1 /* SPDX-License-Identifier: GPL-2.0 */
16 #include <asm-generic/mm_hooks.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()
53 #define tsb_context_switch(X) tsb_context_switch_ctx(X, 0)
55 void tsb_grow(struct mm_struct *mm,
59 void smp_tsb_sync(struct mm_struct *mm);
61 #define smp_tsb_sync(__mm) do { } while (0)
67 "\n661: stxa %0, [%1] %2\n" \
70 " stxa %0, [%1] %3\n" \
74 : "r" (CTX_HWBITS((__mm)->context)), \
79 /* Switch the current MM context. */
80 static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *ts… in switch_mm() argument
85 per_cpu(per_cpu_secondary_mm, cpu) = mm; in switch_mm()
86 if (unlikely(mm == &init_mm)) in switch_mm()
89 spin_lock_irqsave(&mm->context.lock, flags); in switch_mm()
90 ctx_valid = CTX_VALID(mm->context); in switch_mm()
92 get_new_mmu_context(mm); in switch_mm()
105 * CPU 0 CPU 1 in switch_mm()
120 * before the TSB grow performed on cpu1. cpu1 did not cross-call in switch_mm()
124 tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context)); in switch_mm()
130 if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) { in switch_mm()
131 cpumask_set_cpu(cpu, mm_cpumask(mm)); in switch_mm()
132 __flush_tlb_mm(CTX_HWBITS(mm->context), in switch_mm()
135 spin_unlock_irqrestore(&mm->context.lock, flags); in switch_mm()
138 #define activate_mm(active_mm, mm) switch_mm(active_mm, mm, NULL) argument
150 ".word 0x83438000\n\t" /* rd %mcdper, %g1 */ in arch_start_context_switch()
151 "mov %%g1, %0\n\t" in arch_start_context_switch()
173 "mov %0, %%g1\n\t" in finish_arch_post_lock_switch()
174 ".word 0x9d800001\n\t" /* wr %g0, %g1, %mcdper" */ in finish_arch_post_lock_switch()
175 ".word 0xaf902001\n\t" /* wrpr %g0, 1, %pmcdper */ in finish_arch_post_lock_switch()
179 if (current && current->mm && current->mm->context.adi) { in finish_arch_post_lock_switch()
183 regs->tstate |= TSTATE_MCDE; in finish_arch_post_lock_switch()
189 static inline unsigned long mm_untag_mask(struct mm_struct *mm) in mm_untag_mask() argument
191 return -1UL >> adi_nbits(); in mm_untag_mask()
194 #include <asm-generic/mmu_context.h>