|
@@ -15,17 +15,25 @@
|
|
|
static inline int init_new_context(struct task_struct *tsk,
|
|
|
struct mm_struct *mm)
|
|
|
{
|
|
|
+ spin_lock_init(&mm->context.list_lock);
|
|
|
+ INIT_LIST_HEAD(&mm->context.pgtable_list);
|
|
|
+ INIT_LIST_HEAD(&mm->context.gmap_list);
|
|
|
cpumask_clear(&mm->context.cpu_attach_mask);
|
|
|
atomic_set(&mm->context.attach_count, 0);
|
|
|
mm->context.flush_mm = 0;
|
|
|
- mm->context.asce_bits = _ASCE_TABLE_LENGTH | _ASCE_USER_BITS;
|
|
|
- mm->context.asce_bits |= _ASCE_TYPE_REGION3;
|
|
|
#ifdef CONFIG_PGSTE
|
|
|
mm->context.alloc_pgste = page_table_allocate_pgste;
|
|
|
mm->context.has_pgste = 0;
|
|
|
mm->context.use_skey = 0;
|
|
|
#endif
|
|
|
- mm->context.asce_limit = STACK_TOP_MAX;
|
|
|
+ if (mm->context.asce_limit == 0) {
|
|
|
+ /* context created by exec, set asce limit to 4TB */
|
|
|
+ mm->context.asce_bits = _ASCE_TABLE_LENGTH |
|
|
|
+ _ASCE_USER_BITS | _ASCE_TYPE_REGION3;
|
|
|
+ mm->context.asce_limit = STACK_TOP_MAX;
|
|
|
+ } else if (mm->context.asce_limit == (1UL << 31)) {
|
|
|
+ mm_inc_nr_pmds(mm);
|
|
|
+ }
|
|
|
crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
|
|
|
return 0;
|
|
|
}
|
|
@@ -111,8 +119,6 @@ static inline void activate_mm(struct mm_struct *prev,
|
|
|
static inline void arch_dup_mmap(struct mm_struct *oldmm,
|
|
|
struct mm_struct *mm)
|
|
|
{
|
|
|
- if (oldmm->context.asce_limit < mm->context.asce_limit)
|
|
|
- crst_table_downgrade(mm, oldmm->context.asce_limit);
|
|
|
}
|
|
|
|
|
|
static inline void arch_exit_mmap(struct mm_struct *mm)
|