aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2015-01-16 08:56:38 -0500
committerWill Deacon <will.deacon@arm.com>2015-01-16 08:57:33 -0500
commit0145058c3d30b4319d747f64caa16a9cb15f0581 (patch)
tree196c3c624f432c0e4f31153c6d6f8b7c38ed3077 /arch/arm64/mm
parentcd25b85ba6ee1f67c6458ba9d990170728d60828 (diff)
arm64: partially revert "ARM: 8167/1: extend the reserved memory for initrd to be page aligned"
This patch partially reverts commit 421520ba98290a73b35b7644e877a48f18e06004 (only the arm64 part). There is no guarantee that the boot-loader places other images like dtb in a different page than initrd start/end, especially when the kernel is built with 64KB pages. When this happens, such pages must not be freed. The free_reserved_area() already takes care of rounding up "start" and rounding down "end" to avoid freeing partially used pages. Cc: <stable@vger.kernel.org> # 3.17+ Reported-by: Peter Maydell <Peter.Maydell@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/init.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index bac492c12fcc..c95464a33f36 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -335,14 +335,8 @@ static int keep_initrd;
335 335
336void free_initrd_mem(unsigned long start, unsigned long end) 336void free_initrd_mem(unsigned long start, unsigned long end)
337{ 337{
338 if (!keep_initrd) { 338 if (!keep_initrd)
339 if (start == initrd_start)
340 start = round_down(start, PAGE_SIZE);
341 if (end == initrd_end)
342 end = round_up(end, PAGE_SIZE);
343
344 free_reserved_area((void *)start, (void *)end, 0, "initrd"); 339 free_reserved_area((void *)start, (void *)end, 0, "initrd");
345 }
346} 340}
347 341
348static int __init keepinitrd_setup(char *__unused) 342static int __init keepinitrd_setup(char *__unused)