arm64: only consider memblocks with NOMAP cleared for linear mapping
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 30 Nov 2015 12:28:16 +0000 (13:28 +0100)
committerWill Deacon <will.deacon@arm.com>
Wed, 9 Dec 2015 16:57:23 +0000 (16:57 +0000)
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 <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/mm/init.c
arch/arm64/mm/mmu.c

index 17bf39a..ac4d7cb 100644 (file)
@@ -120,7 +120,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
 #ifdef CONFIG_HAVE_ARCH_PFN_VALID
 int pfn_valid(unsigned long pfn)
 {
-       return memblock_is_memory(pfn << PAGE_SHIFT);
+       return memblock_is_map_memory(pfn << PAGE_SHIFT);
 }
 EXPORT_SYMBOL(pfn_valid);
 #endif
index 873e363..f336a77 100644 (file)
@@ -372,6 +372,8 @@ static void __init map_mem(void)
 
                if (start >= end)
                        break;
+               if (memblock_is_nomap(reg))
+                       continue;
 
                if (ARM64_SWAPPER_USES_SECTION_MAPS) {
                        /*