summaryrefslogtreecommitdiffstats
path: root/hw/arm
diff options
context:
space:
mode:
authorAndrew Jones2019-07-01 18:26:14 +0200
committerPeter Maydell2019-07-01 18:28:59 +0200
commitb48b0640093764f06ae63b5df515d16fc2e26013 (patch)
tree5eabc03c44a17d5d5a1fa7adba986dfca7c74897 /hw/arm
parentMerge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-4.1-pull-re... (diff)
downloadqemu-b48b0640093764f06ae63b5df515d16fc2e26013.tar.gz
qemu-b48b0640093764f06ae63b5df515d16fc2e26013.tar.xz
qemu-b48b0640093764f06ae63b5df515d16fc2e26013.zip
hw/arm/boot: fix direct kernel boot with initrd
Fix the condition used to check whether the initrd fits into RAM; in some cases if an initrd was also passed on the command line we would get an error stating that it was too big to fit into RAM after the kernel. Despite the error the loader continued anyway, though, so also add an exit(1) when the initrd is actually too big. Fixes: 852dc64d665f ("hw/arm/boot: Diagnose layouts that put initrd or DTB off the end of RAM") Signed-off-by: Andrew Jones <drjones@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190618125844.4863-1-drjones@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/boot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index b2f93f6bef..1fb24fbef2 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -1109,10 +1109,11 @@ static void arm_setup_direct_kernel_boot(ARMCPU *cpu,
info->initrd_filename);
exit(1);
}
- if (info->initrd_start + initrd_size > info->ram_size) {
+ if (info->initrd_start + initrd_size > ram_end) {
error_report("could not load initrd '%s': "
"too big to fit into RAM after the kernel",
info->initrd_filename);
+ exit(1);
}
} else {
initrd_size = 0;