Skip to content

Commit

Permalink
arm64: partially revert "ARM: 8167/1: extend the reserved memory for …
Browse files Browse the repository at this point in the history
…initrd to be page aligned"

This patch partially reverts commit 421520b
(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: <[email protected]> # 3.17+
Reported-by: Peter Maydell <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
ctmarinas authored and wildea01 committed Jan 16, 2015
1 parent cd25b85 commit 0145058
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions arch/arm64/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,8 @@ static int keep_initrd;

void free_initrd_mem(unsigned long start, unsigned long end)
{
if (!keep_initrd) {
if (start == initrd_start)
start = round_down(start, PAGE_SIZE);
if (end == initrd_end)
end = round_up(end, PAGE_SIZE);

if (!keep_initrd)
free_reserved_area((void *)start, (void *)end, 0, "initrd");
}
}

static int __init keepinitrd_setup(char *__unused)
Expand Down

0 comments on commit 0145058

Please sign in to comment.