diff options
Diffstat (limited to 'arch/s390/mm/init.c')
-rw-r--r-- | arch/s390/mm/init.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 3a25bbf2eb0a..b234bb4a6da7 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c | |||
@@ -81,6 +81,7 @@ void show_mem(void) | |||
81 | static void __init setup_ro_region(void) | 81 | static void __init setup_ro_region(void) |
82 | { | 82 | { |
83 | pgd_t *pgd; | 83 | pgd_t *pgd; |
84 | pud_t *pud; | ||
84 | pmd_t *pmd; | 85 | pmd_t *pmd; |
85 | pte_t *pte; | 86 | pte_t *pte; |
86 | pte_t new_pte; | 87 | pte_t new_pte; |
@@ -91,7 +92,8 @@ static void __init setup_ro_region(void) | |||
91 | 92 | ||
92 | for (; address < end; address += PAGE_SIZE) { | 93 | for (; address < end; address += PAGE_SIZE) { |
93 | pgd = pgd_offset_k(address); | 94 | pgd = pgd_offset_k(address); |
94 | pmd = pmd_offset(pgd, address); | 95 | pud = pud_offset(pgd, address); |
96 | pmd = pmd_offset(pud, address); | ||
95 | pte = pte_offset_kernel(pmd, address); | 97 | pte = pte_offset_kernel(pmd, address); |
96 | new_pte = mk_pte_phys(address, __pgprot(_PAGE_RO)); | 98 | new_pte = mk_pte_phys(address, __pgprot(_PAGE_RO)); |
97 | *pte = new_pte; | 99 | *pte = new_pte; |
@@ -103,32 +105,28 @@ static void __init setup_ro_region(void) | |||
103 | */ | 105 | */ |
104 | void __init paging_init(void) | 106 | void __init paging_init(void) |
105 | { | 107 | { |
106 | pgd_t *pg_dir; | ||
107 | int i; | ||
108 | unsigned long pgdir_k; | ||
109 | static const int ssm_mask = 0x04000000L; | 108 | static const int ssm_mask = 0x04000000L; |
110 | unsigned long max_zone_pfns[MAX_NR_ZONES]; | 109 | unsigned long max_zone_pfns[MAX_NR_ZONES]; |
110 | unsigned long pgd_type; | ||
111 | 111 | ||
112 | pg_dir = swapper_pg_dir; | 112 | init_mm.pgd = swapper_pg_dir; |
113 | 113 | S390_lowcore.kernel_asce = __pa(init_mm.pgd) & PAGE_MASK; | |
114 | #ifdef CONFIG_64BIT | 114 | #ifdef CONFIG_64BIT |
115 | pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERN_REGION_TABLE; | 115 | S390_lowcore.kernel_asce |= _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH; |
116 | for (i = 0; i < PTRS_PER_PGD; i++) | 116 | pgd_type = _REGION3_ENTRY_EMPTY; |
117 | pgd_clear_kernel(pg_dir + i); | ||
118 | #else | 117 | #else |
119 | pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE; | 118 | S390_lowcore.kernel_asce |= _ASCE_TABLE_LENGTH; |
120 | for (i = 0; i < PTRS_PER_PGD; i++) | 119 | pgd_type = _SEGMENT_ENTRY_EMPTY; |
121 | pmd_clear_kernel((pmd_t *)(pg_dir + i)); | ||
122 | #endif | 120 | #endif |
121 | clear_table((unsigned long *) init_mm.pgd, pgd_type, | ||
122 | sizeof(unsigned long)*2048); | ||
123 | vmem_map_init(); | 123 | vmem_map_init(); |
124 | setup_ro_region(); | 124 | setup_ro_region(); |
125 | 125 | ||
126 | S390_lowcore.kernel_asce = pgdir_k; | ||
127 | |||
128 | /* enable virtual mapping in kernel mode */ | 126 | /* enable virtual mapping in kernel mode */ |
129 | __ctl_load(pgdir_k, 1, 1); | 127 | __ctl_load(S390_lowcore.kernel_asce, 1, 1); |
130 | __ctl_load(pgdir_k, 7, 7); | 128 | __ctl_load(S390_lowcore.kernel_asce, 7, 7); |
131 | __ctl_load(pgdir_k, 13, 13); | 129 | __ctl_load(S390_lowcore.kernel_asce, 13, 13); |
132 | __raw_local_irq_ssm(ssm_mask); | 130 | __raw_local_irq_ssm(ssm_mask); |
133 | 131 | ||
134 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); | 132 | memset(max_zone_pfns, 0, sizeof(max_zone_pfns)); |