From ceaeeef160f9b477d006808363568c0b64f31e28 Mon Sep 17 00:00:00 2001 From: Mark Rutland Date: Tue, 6 Oct 2015 18:24:37 +0100 Subject: arm64: Don't relocate non-existent initrd When booting a kernel without an initrd, the kernel reports that it moves -1 bytes worth, having gone through the motions with initrd_start equal to initrd_end: Moving initrd from [4080000000-407fffffff] to [9fff49000-9fff48fff] Prevent this by bailing out early when the initrd size is zero (i.e. we have no initrd), avoiding the confusing message and other associated work. Fixes: 1570f0d7ab425c1e ("arm64: support initrd outside kernel linear map") Cc: Mark Salter Signed-off-by: Mark Rutland Signed-off-by: Will Deacon (cherry picked from commit 4ca3bc86bea23f38596ce7508f75e072839bde44) Signed-off-by: Alex Shi --- arch/arm64/kernel/setup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 389959af1cf4..8ea977f954b3 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -394,6 +394,8 @@ static void __init relocate_initrd(void) to_free = ram_end - orig_start; size = orig_end - orig_start; + if (!size) + return; /* initrd needs to be relocated completely inside linear mapping */ new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn), -- cgit v1.2.3 From d67f9e043c24cd8017f52c3514472da7073b8c62 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 11 Sep 2015 13:07:50 -0700 Subject: mm/early_ioremap: add explicit #include of asm/early_ioremap.h Commit 6b0f68e32ea8 ("mm: add utility for early copy from unmapped ram") introduces a function copy_from_early_mem() into mm/early_ioremap.c which itself calls early_memremap()/early_memunmap(). However, since early_memunmap() has not been declared yet at this point in the .c file, nor by any explicitly included header files, we are depending on a transitive include of asm/early_ioremap.h to declare it, which is fragile. So instead, include this header explicitly. Signed-off-by: Ard Biesheuvel Acked-by: Mark Salter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds (cherry picked from commit 4f1af60bcc2fc6caa7fa3036238b5994708e9a84) Signed-off-by: Alex Shi --- mm/early_ioremap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index a0baeb4be934..d0d7cdbfb69f 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef CONFIG_MMU static int early_ioremap_debug __initdata; -- cgit v1.2.3