Skip to content

Commit

Permalink
ARM: 8700/1: nommu: always reserve address 0 away
Browse files Browse the repository at this point in the history
Some nommu systems have RAM at address 0. When vectors are not located
there, the very beginning of memory remains available for dynamic
allocations. The memblock allocator explicitly skips the first page
but the standard page allocator does not, and while it correctly returns
a non-null struct page pointer for that page, page_address() gives 0
which gets confused with NULL (out of memory) by callers despite having
plenty of free memory left.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
  • Loading branch information
Nicolas Pitre authored and Russell King committed Oct 12, 2017
1 parent 2bd6bf0 commit 195320f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ void __init arm_mm_memblock_reserve(void)
* reserved here.
*/
#endif
/*
* In any case, always ensure address 0 is never used as many things
* get very confused if 0 is returned as a legitimate address.
*/
memblock_reserve(0, 1);
}

void __init adjust_lowmem_bounds(void)
Expand Down

0 comments on commit 195320f

Please sign in to comment.