aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/vmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/mm/vmem.c')
-rw-r--r--arch/s390/mm/vmem.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index b1593c2f751a..ef7d6c8fea66 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -38,12 +38,10 @@ static inline pud_t *vmem_pud_alloc(void)
38{ 38{
39 pud_t *pud = NULL; 39 pud_t *pud = NULL;
40 40
41#ifdef CONFIG_64BIT
42 pud = vmem_alloc_pages(2); 41 pud = vmem_alloc_pages(2);
43 if (!pud) 42 if (!pud)
44 return NULL; 43 return NULL;
45 clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4); 44 clear_table((unsigned long *) pud, _REGION3_ENTRY_EMPTY, PAGE_SIZE * 4);
46#endif
47 return pud; 45 return pud;
48} 46}
49 47
@@ -51,12 +49,10 @@ static inline pmd_t *vmem_pmd_alloc(void)
51{ 49{
52 pmd_t *pmd = NULL; 50 pmd_t *pmd = NULL;
53 51
54#ifdef CONFIG_64BIT
55 pmd = vmem_alloc_pages(2); 52 pmd = vmem_alloc_pages(2);
56 if (!pmd) 53 if (!pmd)
57 return NULL; 54 return NULL;
58 clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4); 55 clear_table((unsigned long *) pmd, _SEGMENT_ENTRY_EMPTY, PAGE_SIZE * 4);
59#endif
60 return pmd; 56 return pmd;
61} 57}
62 58
@@ -98,7 +94,7 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
98 pgd_populate(&init_mm, pg_dir, pu_dir); 94 pgd_populate(&init_mm, pg_dir, pu_dir);
99 } 95 }
100 pu_dir = pud_offset(pg_dir, address); 96 pu_dir = pud_offset(pg_dir, address);
101#if defined(CONFIG_64BIT) && !defined(CONFIG_DEBUG_PAGEALLOC) 97#ifndef CONFIG_DEBUG_PAGEALLOC
102 if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address && 98 if (MACHINE_HAS_EDAT2 && pud_none(*pu_dir) && address &&
103 !(address & ~PUD_MASK) && (address + PUD_SIZE <= end)) { 99 !(address & ~PUD_MASK) && (address + PUD_SIZE <= end)) {
104 pud_val(*pu_dir) = __pa(address) | 100 pud_val(*pu_dir) = __pa(address) |
@@ -115,7 +111,7 @@ static int vmem_add_mem(unsigned long start, unsigned long size, int ro)
115 pud_populate(&init_mm, pu_dir, pm_dir); 111 pud_populate(&init_mm, pu_dir, pm_dir);
116 } 112 }
117 pm_dir = pmd_offset(pu_dir, address); 113 pm_dir = pmd_offset(pu_dir, address);
118#if defined(CONFIG_64BIT) && !defined(CONFIG_DEBUG_PAGEALLOC) 114#ifndef CONFIG_DEBUG_PAGEALLOC
119 if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address && 115 if (MACHINE_HAS_EDAT1 && pmd_none(*pm_dir) && address &&
120 !(address & ~PMD_MASK) && (address + PMD_SIZE <= end)) { 116 !(address & ~PMD_MASK) && (address + PMD_SIZE <= end)) {
121 pmd_val(*pm_dir) = __pa(address) | 117 pmd_val(*pm_dir) = __pa(address) |
@@ -222,7 +218,6 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
222 218
223 pm_dir = pmd_offset(pu_dir, address); 219 pm_dir = pmd_offset(pu_dir, address);
224 if (pmd_none(*pm_dir)) { 220 if (pmd_none(*pm_dir)) {
225#ifdef CONFIG_64BIT
226 /* Use 1MB frames for vmemmap if available. We always 221 /* Use 1MB frames for vmemmap if available. We always
227 * use large frames even if they are only partially 222 * use large frames even if they are only partially
228 * used. 223 * used.
@@ -240,7 +235,6 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
240 address = (address + PMD_SIZE) & PMD_MASK; 235 address = (address + PMD_SIZE) & PMD_MASK;
241 continue; 236 continue;
242 } 237 }
243#endif
244 pt_dir = vmem_pte_alloc(address); 238 pt_dir = vmem_pte_alloc(address);
245 if (!pt_dir) 239 if (!pt_dir)
246 goto out; 240 goto out;