hw/arm/msf2-som: Exit when the cpu is not the expected one
PATCH 1/1 hw/arm/msf2-som: Exit when the cpu is not the expected one
This machine correctly defines its default_cpu_type to cortex-m3 and report an error if the user requested another cpu_type, however it does not exit, and this can confuse users trying to use another core:
$ qemu-system-arm -M emcraft-sf2 -cpu cortex-m4 -kernel test-m4.elf qemu-system-arm: This board can only be used with CPU cortex-m3-arm-cpu [output related to M3 core ...]
The CPU is indeed a M3 core:
(qemu) info qom-tree
/machine (emcraft-sf2-machine)
/unattached (container)
/device[0] (msf2-soc)
/armv7m (armv7m)
/cpu (cortex-m3-arm-cpu)Add the missing exit() call to return to the shell.
--- hw/arm/msf2-som.c | 1 + 1 file changed, 1 insertion(+)
hw/arm/msf2-som.c +1 -0
@@ -53,6 +53,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine)if (strcmp (machine->cpu_type, mc->default_cpu_type) !=0 ) {error_report ("This board can only be used with CPU %s" , mc->default_cpu_type); +exit (1 ); } memory_region_init_ram(ddr, NULL, "ddr-ram", DDR_SIZE,
Signature · 1 line
2.20.1
Quoted 14 lines · Philippe Mathieu-Daudé
This machine correctly defines its
default_cpu_typeto cortex-m3 and report an error if the user requested anothercpu_type, however it does not exit, and this can confuse users trying to use another core:$ qemu-system-arm -M emcraft-sf2 -cpu cortex-m4 -kernel test-m4.elf qemu-system-arm: This board can only be used with CPU cortex-m3-arm-cpu [output related to M3 core ...]The CPU is indeed a M3 core:
(qemu) info qom-tree
/machine (emcraft-sf2-machine)
Quoted 8 lines
/unattached (container) /device[0] (msf2-soc) /armv7m (armv7m) /cpu (cortex-m3-arm-cpu)Add the missing
exit()call to return to the shell.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Alistair
Quoted 20 lines
--- hw/arm/msf2-som.c | 1 + 1 file changed, 1 insertion(+)hw/arm/msf2-som.c +1
-1@@ -53,6 +53,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine)if (strcmp (machine->cpu_type, mc->default_cpu_type) !=0 ) {error_report ("This board can only be used with CPU %s" , mc->default_cpu_type); +exit (1 ); } memory_region_init_ram(ddr, NULL, "ddr-ram", DDR_SIZE, --2.20.1
Quoted 13 lines · Philippe Mathieu-Daudé
This machine correctly defines its
default_cpu_typeto cortex-m3 and report an error if the user requested anothercpu_type, however it does not exit, and this can confuse users trying to use another core:$ qemu-system-arm -M emcraft-sf2 -cpu cortex-m4 -kernel test-m4.elf qemu-system-arm: This board can only be used with CPU cortex-m3-arm-cpu [output related to M3 core ...]The CPU is indeed a M3 core:
(qemu) info qom-tree
/machine (emcraft-sf2-machine)
Quoted 8 lines
/unattached (container) /device[0] (msf2-soc) /armv7m (armv7m) /cpu (cortex-m3-arm-cpu)Add the missing
exit()call to return to the shell.Signed-off-by Philippe Mathieu-Daudé <[email protected]>
Signature · 1 line
Eduardo
Peter Maydell
AppliedQuoted 19 lines · Philippe Mathieu-Daudé
This machine correctly defines its
default_cpu_typeto cortex-m3 and report an error if the user requested anothercpu_type, however it does not exit, and this can confuse users trying to use another core:$ qemu-system-arm -M emcraft-sf2 -cpu cortex-m4 -kernel test-m4.elf qemu-system-arm: This board can only be used with CPU cortex-m3-arm-cpu [output related to M3 core ...]The CPU is indeed a M3 core:
(qemu) info qom-tree
/machine (emcraft-sf2-machine)/unattached (container) /device[0] (msf2-soc) /armv7m (armv7m) /cpu (cortex-m3-arm-cpu)
Quoted 4 lines
Add the missing
exit()call to return to the shell.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
Applied to target-arm.next, thanks.
-- PMM