diff options
author | Heiko Carstens <hca@linux.ibm.com> | 2020-11-16 10:06:41 +0300 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2020-11-23 14:01:12 +0300 |
commit | 0290c9e328e04052e317171953feb18177a34aed (patch) | |
tree | 9ba70533fc8727ef2d664542b62f90180d44819c /arch/s390/include | |
parent | 87d5986345219a7e4f204726d9085ea87f3e22d0 (diff) | |
download | linux-0290c9e328e04052e317171953feb18177a34aed.tar.xz |
s390/mm: use invalid asce instead of kernel asce
Create a region 3 page table which contains only invalid entries, and
use that via "s390_invalid_asce" instead of the kernel ASCE whenever
there is either
- no user address space available, e.g. during early startup
- as an intermediate ASCE when address spaces are switched
This makes sure that user space accesses in such situations are
guaranteed to fail.
Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/mmu_context.h | 2 | ||||
-rw-r--r-- | arch/s390/include/asm/pgtable.h | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h index 51def960a3dd..87a84fc59fc3 100644 --- a/arch/s390/include/asm/mmu_context.h +++ b/arch/s390/include/asm/mmu_context.h @@ -79,7 +79,7 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, S390_lowcore.user_asce = next->context.asce; cpumask_set_cpu(cpu, &next->context.cpu_attach_mask); /* Clear previous user-ASCE from CR7 */ - __ctl_load(S390_lowcore.kernel_asce, 7, 7); + __ctl_load(s390_invalid_asce, 7, 7); if (prev != next) cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask); } diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index a8edd96b2103..794746a32806 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h @@ -23,6 +23,7 @@ extern pgd_t swapper_pg_dir[]; extern void paging_init(void); +extern unsigned long s390_invalid_asce; enum { PG_DIRECT_MAP_4K = 0, |