Commit 09414d00 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by ard

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: default avatarRyan Harkin <ryan.harkin@linaro.org>
Reviewed-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
parent c7936206
...@@ -191,7 +191,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low, ...@@ -191,7 +191,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max_low,
#ifdef CONFIG_HAVE_ARCH_PFN_VALID #ifdef CONFIG_HAVE_ARCH_PFN_VALID
int pfn_valid(unsigned long pfn) int pfn_valid(unsigned long pfn)
{ {
return memblock_is_memory(__pfn_to_phys(pfn)); return memblock_is_map_memory(__pfn_to_phys(pfn));
} }
EXPORT_SYMBOL(pfn_valid); EXPORT_SYMBOL(pfn_valid);
#endif #endif
...@@ -432,6 +432,9 @@ static void __init free_highpages(void) ...@@ -432,6 +432,9 @@ static void __init free_highpages(void)
if (end <= max_low) if (end <= max_low)
continue; continue;
if (memblock_is_nomap(mem))
continue;
/* Truncate partial highmem entries */ /* Truncate partial highmem entries */
if (start < max_low) if (start < max_low)
start = max_low; start = max_low;
......
...@@ -1435,6 +1435,9 @@ static void __init map_lowmem(void) ...@@ -1435,6 +1435,9 @@ static void __init map_lowmem(void)
phys_addr_t end = start + reg->size; phys_addr_t end = start + reg->size;
struct map_desc map; struct map_desc map;
if (memblock_is_nomap(reg))
continue;
if (end > arm_lowmem_limit) if (end > arm_lowmem_limit)
end = arm_lowmem_limit; end = arm_lowmem_limit;
if (start >= end) if (start >= end)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment