Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <matt@codeblueprint.co.uk>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>

authored by

Ard Biesheuvel and committed by
Will Deacon
68709f45 bf3d3cc5

+3 -1
+1 -1
arch/arm64/mm/init.c
··· 120 120 #ifdef CONFIG_HAVE_ARCH_PFN_VALID 121 121 int pfn_valid(unsigned long pfn) 122 122 { 123 - return memblock_is_memory(pfn << PAGE_SHIFT); 123 + return memblock_is_map_memory(pfn << PAGE_SHIFT); 124 124 } 125 125 EXPORT_SYMBOL(pfn_valid); 126 126 #endif
+2
arch/arm64/mm/mmu.c
··· 372 372 373 373 if (start >= end) 374 374 break; 375 + if (memblock_is_nomap(reg)) 376 + continue; 375 377 376 378 if (ARM64_SWAPPER_USES_SECTION_MAPS) { 377 379 /*