Skip to contentSkip to conversation

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

PATCH Applied Philippe Mathieu-Daudé 4 participants 4 messages Oct 19, 2020 – Oct 20, 2020

lore
Share & tools
lore
#0 lore raw

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

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")
---
 hw/arm/nseries.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/nseries.c +1 -0
index e48092ca047..76fd7fe9854 100644
@@ -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);
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Philippe Mathieu-Daudé

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)
Quoted 8 lines

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")
---
 hw/arm/nseries.c | 1 +
 1 file changed, 1 insertion(+)

r~

Tested-by on v1 1/1
#2 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 24 lines · Philippe Mathieu-Daudé

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")
---
 hw/arm/nseries.c | 1 +
 1 file changed, 1 insertion(+)
hw/arm/nseries.c +0 -0
index e48092ca047..76fd7fe9854 100644

hw/arm/nseries.c static void n8x0_init(MachineState *machine, · line 1324

Quoted 7 lines
hw/arm/nseries.c +1 -0
@@ -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:

#3 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 10 lines · Philippe Mathieu-Daudé

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)
Quoted 5 lines

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")

Applied to target-arm.next, thanks.

-- PMM