Skip to content

Commit 68709f4

Browse files
Ard Biesheuvelwildea01
authored andcommitted
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>
1 parent bf3d3cc commit 68709f4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

arch/arm64/mm/init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max)
120120
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
121121
int pfn_valid(unsigned long pfn)
122122
{
123-
return memblock_is_memory(pfn << PAGE_SHIFT);
123+
return memblock_is_map_memory(pfn << PAGE_SHIFT);
124124
}
125125
EXPORT_SYMBOL(pfn_valid);
126126
#endif

arch/arm64/mm/mmu.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ static void __init map_mem(void)
372372

373373
if (start >= end)
374374
break;
375+
if (memblock_is_nomap(reg))
376+
continue;
375377

376378
if (ARM64_SWAPPER_USES_SECTION_MAPS) {
377379
/*

0 commit comments

Comments
 (0)