From f57f0bf8975d24fe1e7c4936fdfb5c3b123ab75f Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 20 Mar 2018 11:50:58 +0000 Subject: ARM: Include stack and malloc space in zImage size Include the stack and malloc space in our calculation of the zImage size, both of which must be avoided when locating the dtb. Signed-off-by: Russell King --- kexec/arch/arm/kexec-zImage-arm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kexec/arch/arm/kexec-zImage-arm.c b/kexec/arch/arm/kexec-zImage-arm.c index 3305d9b..2a7eea9 100644 --- a/kexec/arch/arm/kexec-zImage-arm.c +++ b/kexec/arch/arm/kexec-zImage-arm.c @@ -552,6 +552,12 @@ int zImage_arm_load(int argc, char **argv, const char *buf, off_t len, */ kernel_mem_size = len + 4; + /* + * The zImage length does not include its stack (4k) or its + * malloc space (64k). Include this. + */ + len += 0x11000; + dbgprintf("zImage requires 0x%08llx bytes\n", (unsigned long long)len); /* -- cgit