hw/arm/boot: Avoid placing the initrd on top of the kernel
commite6b2b20d9735d4ef6a6c2a056b2e1b7798e9cb27
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 16 May 2019 14:47:32 +0000 (16 15:47 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 17 Jun 2019 14:11:18 +0000 (17 15:11 +0100)
tree0de3b5fb6976fc2b1faa45c43adb2b917c1c63f6
parent852dc64d665f89d8b54dd9aa7e36c3ff12bef775
hw/arm/boot: Avoid placing the initrd on top of the kernel

We currently put the initrd at the smaller of:
 * 128MB into RAM
 * halfway into the RAM
(with the dtb following it).

However for large kernels this might mean that the kernel
overlaps the initrd. For some kinds of kernel (self-decompressing
32-bit kernels, and ELF images with a BSS section at the end)
we don't know the exact size, but even there we have a
minimum size. Put the initrd at least further into RAM than
that. For image formats that can give us an exact kernel size, this
will mean that we definitely avoid overlaying kernel and initrd.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Mark Rutland <mark.rutland@arm.com>
Message-id: 20190516144733.32399-4-peter.maydell@linaro.org
hw/arm/boot.c