Skip to content

Commit 195320f

Browse files
Nicolas PitreRussell King
authored andcommitted
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>
1 parent 2bd6bf0 commit 195320f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

arch/arm/mm/nommu.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ void __init arm_mm_memblock_reserve(void)
344344
* reserved here.
345345
*/
346346
#endif
347+
/*
348+
* In any case, always ensure address 0 is never used as many things
349+
* get very confused if 0 is returned as a legitimate address.
350+
*/
351+
memblock_reserve(0, 1);
347352
}
348353

349354
void __init adjust_lowmem_bounds(void)

0 commit comments

Comments
 (0)