aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2016-05-11 04:52:07 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-06-13 09:58:13 -0400
commit2dffdcbac91c8da1eb0663d6eab92f2e5b56a798 (patch)
tree00a307b551736f80e02561a2c0255d0c0689e31f /arch/s390/mm
parent2e9996fcf8b8f933f9496cc885c9e05730f23c9e (diff)
s390/vmem: introduce and use SEGMENT_KERNEL and REGION3_KERNEL
Instead of open-coded SEGMENT_KERNEL and REGION3_KERNEL assignments use defines. Also to make e.g. pmd_wrprotect() work on the kernel mapping a couple more flags must be set. Therefore add the missing flags also. In order to make everything symmetrical this patch also adds software dirty, young, read and write bits for region 3 table entries. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm')
-rw-r--r--arch/s390/mm/vmem.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index a64b91a8e5ac..2020ef8c0413 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -99,9 +99,8 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
99 if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address && 99 if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address &&
100 !(address & ~PUD_MASK) && (address + PUD_SIZE <= end) && 100 !(address & ~PUD_MASK) && (address + PUD_SIZE <= end) &&
101 !debug_pagealloc_enabled()) { 101 !debug_pagealloc_enabled()) {
102 pud_val(*pu_dir) = __pa(address) | 102 pud_val(*pu_dir) = address |
103 _REGION_ENTRY_TYPE_R3 | _REGION3_ENTRY_LARGE | 103 pgprot_val(ro ? REGION3_KERNEL_RO : REGION3_KERNEL);
104 (ro ? _REGION_ENTRY_PROTECT : 0);
105 address += PUD_SIZE; 104 address += PUD_SIZE;
106 continue; 105 continue;
107 } 106 }
@@ -115,10 +114,8 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
115 if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address && 114 if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address &&
116 !(address & ~PMD_MASK) && (address + PMD_SIZE <= end) && 115 !(address & ~PMD_MASK) && (address + PMD_SIZE <= end) &&
117 !debug_pagealloc_enabled()) { 116 !debug_pagealloc_enabled()) {
118 pmd_val(*pm_dir) = __pa(address) | 117 pmd_val(*pm_dir) = address |
119 _SEGMENT_ENTRY | _SEGMENT_ENTRY_LARGE | 118 pgprot_val(ro ? SEGMENT_KERNEL_RO : SEGMENT_KERNEL);
120 _SEGMENT_ENTRY_YOUNG |
121 (ro ? _SEGMENT_ENTRY_PROTECT : 0);
122 address += PMD_SIZE; 119 address += PMD_SIZE;
123 continue; 120 continue;
124 } 121 }
@@ -130,7 +127,7 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
130 } 127 }
131 128
132 pt_dir = pte_offset_kernel(pm_dir, address); 129 pt_dir = pte_offset_kernel(pm_dir, address);
133 pte_val(*pt_dir) = __pa(address) | 130 pte_val(*pt_dir) = address |
134 pgprot_val(ro ? PAGE_KERNEL_RO : PAGE_KERNEL); 131 pgprot_val(ro ? PAGE_KERNEL_RO : PAGE_KERNEL);
135 address += PAGE_SIZE; 132 address += PAGE_SIZE;
136 } 133 }