[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-arm] [Qemu-devel] [PATCH] hw/arm/boot: fix direct kernel boot setup |
Date: |
Tue, 18 Jun 2019 13:31:29 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 6/18/19 1:02 PM, Peter Maydell wrote:
> On Tue, 18 Jun 2019 at 09:34, Andrew Jones <address@hidden> wrote:
>>
>> We need to check ram_end, not ram_size.
>>
>> Fixes: 852dc64d665f ("hw/arm/boot: Diagnose layouts that put initrd or
>> DTB off the end of RAM")
>> Signed-off-by: Andrew Jones <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> hw/arm/boot.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/arm/boot.c b/hw/arm/boot.c
>> index b2f93f6beff6..8a280ab3ed49 100644
>> --- a/hw/arm/boot.c
>> +++ b/hw/arm/boot.c
>> @@ -1109,7 +1109,7 @@ 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);
>> --
>> 2.20.1
>
> Reviewed-by: Peter Maydell <address@hidden>
>
> I think I missed this because my test case doesn't have an
> initrd -- direct kernel boot works fine if all you're
> passing to QEMU is the kernel... I think we could clarify
> the commit message a little:
>
> hw/arm/boot: fix direct kernel boot with initrd
>
> Fix the condition used to check whether the initrd fits
> into RAM; this meant we were spuriously refusing to do
> a direct boot of a kernel in some cases if an initrd
> was also passed on the command line.
>
> ?
>
> (if you agree I can just fix up the commit message when I apply it.)
>
> thanks
> -- PMM
>