qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot with initrd
@ 2019-06-18 12:58 Andrew Jones
  2019-07-01 11:12 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Jones @ 2019-06-18 12:58 UTC (permalink / raw)
  To: qemu-devel, qemu-arm; +Cc: peter.maydell, Philippe Mathieu-Daudé

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>
---
 hw/arm/boot.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index b2f93f6beff6..1fb24fbef27e 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;
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot with initrd
  2019-06-18 12:58 [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot with initrd Andrew Jones
@ 2019-07-01 11:12 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2019-07-01 11:12 UTC (permalink / raw)
  To: Andrew Jones; +Cc: qemu-arm, Philippe Mathieu-Daudé, QEMU Developers

On Tue, 18 Jun 2019 at 13:59, Andrew Jones <drjones@redhat.com> wrote:
>
> 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>
> ---
>  hw/arm/boot.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)



Applied to target-arm.next, thanks.

-- PMM


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-01 11:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-18 12:58 [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot with initrd Andrew Jones
2019-07-01 11:12 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).