summaryrefslogtreecommitdiff
path: root/arch/arm/mm/nommu.c
diff options
context:
space:
mode:
authorNicolas Pitre <nicolas.pitre@linaro.org>2017-10-01 04:06:27 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2017-10-12 13:18:17 +0300
commit195320fd6e9946a0aedeb2fd0e1ac47aa5dc81c4 (patch)
tree97ad40707dfb7d352ee770661a239beedc66bffa /arch/arm/mm/nommu.c
parent2bd6bf03f4c1c59381d62c61d03f6cc3fe71f66e (diff)
downloadlinux-195320fd6e9946a0aedeb2fd0e1ac47aa5dc81c4.tar.xz
ARM: 8700/1: nommu: always reserve address 0 away
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>
Diffstat (limited to 'arch/arm/mm/nommu.c')
-rw-r--r--arch/arm/mm/nommu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 3b8e728cc944..91537d90f5f5 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -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)