diff mbox series

hw/arm/nseries: Fix loading kernel image on n8x0 machines

Message ID 20201019095148.1602119-1-f4bug@amsat.org
State New
Headers show
Series hw/arm/nseries: Fix loading kernel image on n8x0 machines | expand

Commit Message

Philippe Mathieu-Daudé Oct. 19, 2020, 9:51 a.m. UTC
Commit 7998beb9c2e removed the ram_size initialization in the
arm_boot_info structure, however it is used by arm_load_kernel().

Initialize the field to fix:

  $ qemu-system-arm -M n800 -append 'console=ttyS1' \
    -kernel meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0
  qemu-system-arm: kernel 'meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0' is too large to fit in RAM (kernel size 1964608, RAM size 0)

Noticed while running the test introduced in commit 050a82f0c5b
("tests/acceptance: Add a test for the N800 and N810 arm machines").

Fixes: 7998beb9c2e ("arm/nseries: use memdev for RAM")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/arm/nseries.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Richard Henderson Oct. 19, 2020, 2:51 p.m. UTC | #1
On 10/19/20 2:51 AM, Philippe Mathieu-Daudé wrote:
> Commit 7998beb9c2e removed the ram_size initialization in the

> arm_boot_info structure, however it is used by arm_load_kernel().

> 

> Initialize the field to fix:

> 

>   $ qemu-system-arm -M n800 -append 'console=ttyS1' \

>     -kernel meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0

>   qemu-system-arm: kernel 'meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0' is too large to fit in RAM (kernel size 1964608, RAM size 0)

> 

> Noticed while running the test introduced in commit 050a82f0c5b

> ("tests/acceptance: Add a test for the N800 and N810 arm machines").

> 

> Fixes: 7998beb9c2e ("arm/nseries: use memdev for RAM")

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---

>  hw/arm/nseries.c | 1 +

>  1 file changed, 1 insertion(+)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
Thomas Huth Oct. 19, 2020, 4:12 p.m. UTC | #2
On 19/10/2020 11.51, Philippe Mathieu-Daudé wrote:
> Commit 7998beb9c2e removed the ram_size initialization in the
> arm_boot_info structure, however it is used by arm_load_kernel().
> 
> Initialize the field to fix:
> 
>   $ qemu-system-arm -M n800 -append 'console=ttyS1' \
>     -kernel meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0
>   qemu-system-arm: kernel 'meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0' is too large to fit in RAM (kernel size 1964608, RAM size 0)
> 
> Noticed while running the test introduced in commit 050a82f0c5b
> ("tests/acceptance: Add a test for the N800 and N810 arm machines").
> 
> Fixes: 7998beb9c2e ("arm/nseries: use memdev for RAM")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/arm/nseries.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index e48092ca047..76fd7fe9854 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -1318,6 +1318,7 @@ static void n8x0_init(MachineState *machine,
>          g_free(sz);
>          exit(EXIT_FAILURE);
>      }
> +    binfo->ram_size = machine->ram_size;
>  
>      memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE,
>                                  machine->ram);
> 

Fixes the test in "make check-acceptance" for me:

Tested-by: Thomas Huth <thuth@redhat.com>
Peter Maydell Oct. 20, 2020, 2:37 p.m. UTC | #3
On Mon, 19 Oct 2020 at 10:51, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Commit 7998beb9c2e removed the ram_size initialization in the
> arm_boot_info structure, however it is used by arm_load_kernel().
>
> Initialize the field to fix:
>
>   $ qemu-system-arm -M n800 -append 'console=ttyS1' \
>     -kernel meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0
>   qemu-system-arm: kernel 'meego-arm-n8x0-1.0.80.20100712.1431-vmlinuz-2.6.35~rc4-129.1-n8x0' is too large to fit in RAM (kernel size 1964608, RAM size 0)
>
> Noticed while running the test introduced in commit 050a82f0c5b
> ("tests/acceptance: Add a test for the N800 and N810 arm machines").
>
> Fixes: 7998beb9c2e ("arm/nseries: use memdev for RAM")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>



Applied to target-arm.next, thanks.

-- PMM
diff mbox series

Patch

diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
index e48092ca047..76fd7fe9854 100644
--- a/hw/arm/nseries.c
+++ b/hw/arm/nseries.c
@@ -1318,6 +1318,7 @@  static void n8x0_init(MachineState *machine,
         g_free(sz);
         exit(EXIT_FAILURE);
     }
+    binfo->ram_size = machine->ram_size;
 
     memory_region_add_subregion(get_system_memory(), OMAP2_Q2_BASE,
                                 machine->ram);