Skip to content

Commit f755560

Browse files
Alexander GordeevVasily Gorbik
authored andcommitted
s390/mm: cleanup virtual memory constants usage
Remove duplicate definitions and consolidate usage of virutal and address translation constants. Signed-off-by: Alexander Gordeev <[email protected]> Reviewed-by: Heiko Carstens <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 6a3eb35 commit f755560

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

arch/s390/include/asm/mmu_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ static inline int init_new_context(struct task_struct *tsk,
4242
*/
4343
case 0:
4444
/* context created by exec, set asce limit to 4TB */
45-
mm->context.asce_limit = STACK_TOP_MAX;
45+
mm->context.asce_limit = _REGION2_SIZE;
4646
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
4747
_ASCE_USER_BITS | _ASCE_TYPE_REGION3;
4848
break;
49-
case -PAGE_SIZE:
49+
case TASK_SIZE_MAX:
5050
/* forked 5-level task, set new asce with new_mm->pgd */
5151
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
5252
_ASCE_USER_BITS | _ASCE_TYPE_REGION1;

arch/s390/include/asm/processor.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ extern void __bpon(void);
9393
*/
9494

9595
#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_31BIT) ? \
96-
(1UL << 31) : -PAGE_SIZE)
96+
_REGION3_SIZE : TASK_SIZE_MAX)
9797
#define TASK_UNMAPPED_BASE (test_thread_flag(TIF_31BIT) ? \
98-
(1UL << 30) : (1UL << 41))
98+
(_REGION3_SIZE >> 1) : (_REGION2_SIZE >> 1))
9999
#define TASK_SIZE TASK_SIZE_OF(current)
100100
#define TASK_SIZE_MAX (-PAGE_SIZE)
101101

102102
#define STACK_TOP (test_thread_flag(TIF_31BIT) ? \
103-
(1UL << 31) : (1UL << 42))
104-
#define STACK_TOP_MAX (1UL << 42)
103+
_REGION3_SIZE : _REGION2_SIZE)
104+
#define STACK_TOP_MAX _REGION2_SIZE
105105

106106
#define HAVE_ARCH_PICK_MMAP_LAYOUT
107107

arch/s390/mm/pgalloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ int crst_table_upgrade(struct mm_struct *mm, unsigned long end)
121121
__pgd = (unsigned long *) mm->pgd;
122122
pgd_populate(mm, (pgd_t *) pgd, (p4d_t *) __pgd);
123123
mm->pgd = (pgd_t *) pgd;
124-
mm->context.asce_limit = -PAGE_SIZE;
124+
mm->context.asce_limit = TASK_SIZE_MAX;
125125
mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
126126
_ASCE_USER_BITS | _ASCE_TYPE_REGION1;
127127
}
@@ -527,7 +527,7 @@ void base_asce_free(unsigned long asce)
527527
base_region2_walk(table, 0, _REGION1_SIZE, 0);
528528
break;
529529
case _ASCE_TYPE_REGION1:
530-
base_region1_walk(table, 0, -_PAGE_SIZE, 0);
530+
base_region1_walk(table, 0, TASK_SIZE_MAX, 0);
531531
break;
532532
}
533533
base_crst_free(table);

0 commit comments

Comments
 (0)