aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm64/mm/mmu.c')
-rw-r--r--arch/arm64/mm/mmu.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index c43f1dd19489..c55567283cde 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -32,6 +32,7 @@
32#include <asm/setup.h> 32#include <asm/setup.h>
33#include <asm/sizes.h> 33#include <asm/sizes.h>
34#include <asm/tlb.h> 34#include <asm/tlb.h>
35#include <asm/memblock.h>
35#include <asm/mmu_context.h> 36#include <asm/mmu_context.h>
36 37
37#include "mm.h" 38#include "mm.h"
@@ -204,9 +205,16 @@ static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr,
204 unsigned long end, unsigned long phys, 205 unsigned long end, unsigned long phys,
205 int map_io) 206 int map_io)
206{ 207{
207 pud_t *pud = pud_offset(pgd, addr); 208 pud_t *pud;
208 unsigned long next; 209 unsigned long next;
209 210
211 if (pgd_none(*pgd)) {
212 pud = early_alloc(PTRS_PER_PUD * sizeof(pud_t));
213 pgd_populate(&init_mm, pgd, pud);
214 }
215 BUG_ON(pgd_bad(*pgd));
216
217 pud = pud_offset(pgd, addr);
210 do { 218 do {
211 next = pud_addr_end(addr, end); 219 next = pud_addr_end(addr, end);
212 220
@@ -290,10 +298,10 @@ static void __init map_mem(void)
290 * memory addressable from the initial direct kernel mapping. 298 * memory addressable from the initial direct kernel mapping.
291 * 299 *
292 * The initial direct kernel mapping, located at swapper_pg_dir, 300 * The initial direct kernel mapping, located at swapper_pg_dir,
293 * gives us PGDIR_SIZE memory starting from PHYS_OFFSET (which must be 301 * gives us PUD_SIZE memory starting from PHYS_OFFSET (which must be
294 * aligned to 2MB as per Documentation/arm64/booting.txt). 302 * aligned to 2MB as per Documentation/arm64/booting.txt).
295 */ 303 */
296 limit = PHYS_OFFSET + PGDIR_SIZE; 304 limit = PHYS_OFFSET + PUD_SIZE;
297 memblock_set_current_limit(limit); 305 memblock_set_current_limit(limit);
298 306
299 /* map all the memory banks */ 307 /* map all the memory banks */