From: Ard Biesheuvel Date: Mon, 30 Nov 2015 12:28:16 +0000 (+0100) Subject: BACKPORT: arm64: only consider memblocks with NOMAP cleared for linear mapping X-Git-Tag: firefly_0821_release~176^2~152 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1c4a6945fde71d5a426ea8adab895643ff848c3f;p=firefly-linux-kernel-4.4.55.git BACKPORT: arm64: only consider memblocks with NOMAP cleared for linear mapping Take the new memblock attribute MEMBLOCK_NOMAP into account when deciding whether a certain region is or should be covered by the kernel direct mapping. Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel Signed-off-by: Will Deacon Change-Id: Id7346a09bb3aee5e9a5ef8812251f80cf8265532 (cherry picked from commit 68709f45385aeddb0ca96a060c0c8259944f321b) Signed-off-by: Sami Tolvanen --- diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index fe4fe832ee47..05a1088377aa 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -131,7 +131,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) int pfn_valid(unsigned long pfn) { - return (pfn & PFN_MASK) == pfn && memblock_is_memory(pfn << PAGE_SHIFT); + return (pfn & PFN_MASK) == pfn && memblock_is_map_memory(pfn << PAGE_SHIFT); } EXPORT_SYMBOL(pfn_valid); #endif diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 2da97065c2fe..1cab2703f5a8 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -438,6 +438,8 @@ static void __init map_mem(pgd_t *pgd) if (start >= end) break; + if (memblock_is_nomap(reg)) + continue; __map_memblock(pgd, start, end); }