Skip to content

Commit 09414d0

Browse files
author
Ard Biesheuvel
committed
ARM: 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. Tested-by: Ryan Harkin <ryan.harkin@linaro.org> Reviewed-by: Matt Fleming <matt@codeblueprint.co.uk> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
1 parent c793620 commit 09414d0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎arch/arm/mm/init.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
191191
#ifdef CONFIG_HAVE_ARCH_PFN_VALID
192192
int pfn_valid(unsigned long pfn)
193193
{
194-
return memblock_is_memory(__pfn_to_phys(pfn));
194+
return memblock_is_map_memory(__pfn_to_phys(pfn));
195195
}
196196
EXPORT_SYMBOL(pfn_valid);
197197
#endif
@@ -432,6 +432,9 @@ static void __init free_highpages(void)
432432
if (end <= max_low)
433433
continue;
434434

435+
if (memblock_is_nomap(mem))
436+
continue;
437+
435438
/* Truncate partial highmem entries */
436439
if (start < max_low)
437440
start = max_low;

‎arch/arm/mm/mmu.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,9 @@ static void __init map_lowmem(void)
14351435
phys_addr_t end = start + reg->size;
14361436
struct map_desc map;
14371437

1438+
if (memblock_is_nomap(reg))
1439+
continue;
1440+
14381441
if (end > arm_lowmem_limit)
14391442
end = arm_lowmem_limit;
14401443
if (start >= end)

0 commit comments

Comments
 (0)