Commit 4ca3bc86 authored by Mark Rutland's avatar Mark Rutland Committed by Will Deacon
Browse files

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

Fixes: 1570f0d7

 ("arm64: support initrd outside kernel linear map")
Cc: Mark Salter <>
Signed-off-by: default avatarMark Rutland <>
Signed-off-by: default avatarWill Deacon <>
parent abffa6f3
......@@ -364,6 +364,8 @@ static void __init relocate_initrd(void)
to_free = ram_end - orig_start;
size = orig_end - orig_start;
if (!size)
/* initrd needs to be relocated completely inside linear mapping */
new_start = memblock_find_in_range(0, PFN_PHYS(max_pfn),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment