]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
27aef45dd995ba4c30eb06de558a024a51d7ba78
[thirdparty/kernel/stable-queue.git] /
1 From 0145058c3d30b4319d747f64caa16a9cb15f0581 Mon Sep 17 00:00:00 2001
2 From: Catalin Marinas <catalin.marinas@arm.com>
3 Date: Fri, 16 Jan 2015 13:56:38 +0000
4 Subject: arm64: partially revert "ARM: 8167/1: extend the reserved memory for initrd to be page aligned"
5
6 From: Catalin Marinas <catalin.marinas@arm.com>
7
8 commit 0145058c3d30b4319d747f64caa16a9cb15f0581 upstream.
9
10 This patch partially reverts commit 421520ba98290a73b35b7644e877a48f18e06004
11 (only the arm64 part). There is no guarantee that the boot-loader places other
12 images like dtb in a different page than initrd start/end, especially when the
13 kernel is built with 64KB pages. When this happens, such pages must not be
14 freed. The free_reserved_area() already takes care of rounding up "start" and
15 rounding down "end" to avoid freeing partially used pages.
16
17 Reported-by: Peter Maydell <Peter.Maydell@arm.com>
18 Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
19 Signed-off-by: Will Deacon <will.deacon@arm.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21
22 ---
23 arch/arm64/mm/init.c | 8 +-------
24 1 file changed, 1 insertion(+), 7 deletions(-)
25
26 --- a/arch/arm64/mm/init.c
27 +++ b/arch/arm64/mm/init.c
28 @@ -333,14 +333,8 @@ static int keep_initrd;
29
30 void free_initrd_mem(unsigned long start, unsigned long end)
31 {
32 - if (!keep_initrd) {
33 - if (start == initrd_start)
34 - start = round_down(start, PAGE_SIZE);
35 - if (end == initrd_end)
36 - end = round_up(end, PAGE_SIZE);
37 -
38 + if (!keep_initrd)
39 free_reserved_area((void *)start, (void *)end, 0, "initrd");
40 - }
41 }
42
43 static int __init keepinitrd_setup(char *__unused)