Skip to content

Commit

Permalink
arm64: only consider memblocks with NOMAP cleared for linear mapping
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
Ard Biesheuvel authored and wildea01 committed Dec 9, 2015
1 parent bf3d3cc commit 68709f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
/*
Expand Down

0 comments on commit 68709f4

Please sign in to comment.