aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/mmu_context.h5
-rw-r--r--arch/s390/include/asm/pgalloc.h6
-rw-r--r--arch/s390/include/asm/pgtable.h18
-rw-r--r--arch/s390/include/asm/processor.h4
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/tlb.h6
6 files changed, 27 insertions, 14 deletions
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
index dbd689d556ce..ccbb53e22024 100644
--- a/arch/s390/include/asm/mmu_context.h
+++ b/arch/s390/include/asm/mmu_context.h
@@ -46,8 +46,6 @@ static inline int init_new_context(struct task_struct *tsk,
46 mm->context.asce_limit = STACK_TOP_MAX; 46 mm->context.asce_limit = STACK_TOP_MAX;
47 mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH | 47 mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
48 _ASCE_USER_BITS | _ASCE_TYPE_REGION3; 48 _ASCE_USER_BITS | _ASCE_TYPE_REGION3;
49 /* pgd_alloc() did not account this pud */
50 mm_inc_nr_puds(mm);
51 break; 49 break;
52 case -PAGE_SIZE: 50 case -PAGE_SIZE:
53 /* forked 5-level task, set new asce with new_mm->pgd */ 51 /* forked 5-level task, set new asce with new_mm->pgd */
@@ -63,9 +61,6 @@ static inline int init_new_context(struct task_struct *tsk,
63 /* forked 2-level compat task, set new asce with new mm->pgd */ 61 /* forked 2-level compat task, set new asce with new mm->pgd */
64 mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH | 62 mm->context.asce = __pa(mm->pgd) | _ASCE_TABLE_LENGTH |
65 _ASCE_USER_BITS | _ASCE_TYPE_SEGMENT; 63 _ASCE_USER_BITS | _ASCE_TYPE_SEGMENT;
66 /* pgd_alloc() did not account this pmd */
67 mm_inc_nr_pmds(mm);
68 mm_inc_nr_puds(mm);
69 } 64 }
70 crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm)); 65 crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm));
71 return 0; 66 return 0;
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h
index f0f9bcf94c03..5ee733720a57 100644
--- a/arch/s390/include/asm/pgalloc.h
+++ b/arch/s390/include/asm/pgalloc.h
@@ -36,11 +36,11 @@ static inline void crst_table_init(unsigned long *crst, unsigned long entry)
36 36
37static inline unsigned long pgd_entry_type(struct mm_struct *mm) 37static inline unsigned long pgd_entry_type(struct mm_struct *mm)
38{ 38{
39 if (mm->context.asce_limit <= _REGION3_SIZE) 39 if (mm_pmd_folded(mm))
40 return _SEGMENT_ENTRY_EMPTY; 40 return _SEGMENT_ENTRY_EMPTY;
41 if (mm->context.asce_limit <= _REGION2_SIZE) 41 if (mm_pud_folded(mm))
42 return _REGION3_ENTRY_EMPTY; 42 return _REGION3_ENTRY_EMPTY;
43 if (mm->context.asce_limit <= _REGION1_SIZE) 43 if (mm_p4d_folded(mm))
44 return _REGION2_ENTRY_EMPTY; 44 return _REGION2_ENTRY_EMPTY;
45 return _REGION1_ENTRY_EMPTY; 45 return _REGION1_ENTRY_EMPTY;
46} 46}
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 411d435e7a7d..063732414dfb 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -493,6 +493,24 @@ static inline int is_module_addr(void *addr)
493 _REGION_ENTRY_PROTECT | \ 493 _REGION_ENTRY_PROTECT | \
494 _REGION_ENTRY_NOEXEC) 494 _REGION_ENTRY_NOEXEC)
495 495
496static inline bool mm_p4d_folded(struct mm_struct *mm)
497{
498 return mm->context.asce_limit <= _REGION1_SIZE;
499}
500#define mm_p4d_folded(mm) mm_p4d_folded(mm)
501
502static inline bool mm_pud_folded(struct mm_struct *mm)
503{
504 return mm->context.asce_limit <= _REGION2_SIZE;
505}
506#define mm_pud_folded(mm) mm_pud_folded(mm)
507
508static inline bool mm_pmd_folded(struct mm_struct *mm)
509{
510 return mm->context.asce_limit <= _REGION3_SIZE;
511}
512#define mm_pmd_folded(mm) mm_pmd_folded(mm)
513
496static inline int mm_has_pgste(struct mm_struct *mm) 514static inline int mm_has_pgste(struct mm_struct *mm)
497{ 515{
498#ifdef CONFIG_PGSTE 516#ifdef CONFIG_PGSTE
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
index 302795c47c06..81038ab357ce 100644
--- a/arch/s390/include/asm/processor.h
+++ b/arch/s390/include/asm/processor.h
@@ -236,7 +236,7 @@ static inline unsigned long current_stack_pointer(void)
236 return sp; 236 return sp;
237} 237}
238 238
239static __no_sanitize_address_or_inline unsigned short stap(void) 239static __no_kasan_or_inline unsigned short stap(void)
240{ 240{
241 unsigned short cpu_address; 241 unsigned short cpu_address;
242 242
@@ -330,7 +330,7 @@ static inline void __load_psw(psw_t psw)
330 * Set PSW mask to specified value, while leaving the 330 * Set PSW mask to specified value, while leaving the
331 * PSW addr pointing to the next instruction. 331 * PSW addr pointing to the next instruction.
332 */ 332 */
333static __no_sanitize_address_or_inline void __load_psw_mask(unsigned long mask) 333static __no_kasan_or_inline void __load_psw_mask(unsigned long mask)
334{ 334{
335 unsigned long addr; 335 unsigned long addr;
336 psw_t psw; 336 psw_t psw;
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index 27248f42a03c..ce4e17c9aad6 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -14,7 +14,7 @@
14 * General size of kernel stacks 14 * General size of kernel stacks
15 */ 15 */
16#ifdef CONFIG_KASAN 16#ifdef CONFIG_KASAN
17#define THREAD_SIZE_ORDER 3 17#define THREAD_SIZE_ORDER 4
18#else 18#else
19#define THREAD_SIZE_ORDER 2 19#define THREAD_SIZE_ORDER 2
20#endif 20#endif
diff --git a/arch/s390/include/asm/tlb.h b/arch/s390/include/asm/tlb.h
index 457b7ba0fbb6..b31c779cf581 100644
--- a/arch/s390/include/asm/tlb.h
+++ b/arch/s390/include/asm/tlb.h
@@ -136,7 +136,7 @@ static inline void pte_free_tlb(struct mmu_gather *tlb, pgtable_t pte,
136static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd, 136static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
137 unsigned long address) 137 unsigned long address)
138{ 138{
139 if (tlb->mm->context.asce_limit <= _REGION3_SIZE) 139 if (mm_pmd_folded(tlb->mm))
140 return; 140 return;
141 pgtable_pmd_page_dtor(virt_to_page(pmd)); 141 pgtable_pmd_page_dtor(virt_to_page(pmd));
142 tlb_remove_table(tlb, pmd); 142 tlb_remove_table(tlb, pmd);
@@ -152,7 +152,7 @@ static inline void pmd_free_tlb(struct mmu_gather *tlb, pmd_t *pmd,
152static inline void p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d, 152static inline void p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d,
153 unsigned long address) 153 unsigned long address)
154{ 154{
155 if (tlb->mm->context.asce_limit <= _REGION1_SIZE) 155 if (mm_p4d_folded(tlb->mm))
156 return; 156 return;
157 tlb_remove_table(tlb, p4d); 157 tlb_remove_table(tlb, p4d);
158} 158}
@@ -167,7 +167,7 @@ static inline void p4d_free_tlb(struct mmu_gather *tlb, p4d_t *p4d,
167static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud, 167static inline void pud_free_tlb(struct mmu_gather *tlb, pud_t *pud,
168 unsigned long address) 168 unsigned long address)
169{ 169{
170 if (tlb->mm->context.asce_limit <= _REGION2_SIZE) 170 if (mm_pud_folded(tlb->mm))
171 return; 171 return;
172 tlb_remove_table(tlb, pud); 172 tlb_remove_table(tlb, pud);
173} 173}