Skip to contentSkip to conversation

'-M virt -cpu cortex-a7'

Qemu-arm ratna manoj 2 participants 2 messages Mar 31, 2019

lore
Share & tools
lore
#0 lore raw

Hi,

$> qemu-3.1.0/build/arm-softmmu/qemu-system-arm -M virt -cpu help|grep cortex-a7
cortex-a7
$>

As shown above 'virt' machine type lists 'cortex-a7' as supported processor, but when I try to load a kernel with -cpu cortext-a7 option it says:

qemu-system-arm: mach-virt: CPU type cortex-a7-arm-cpu not supported

This is because of the check for valid_cpus in hw/arm/virt.c, where cortex-a7 is not listed.

From hw/arm/virt.c:

static const char *valid_cpus[] = {
    ARM_CPU_TYPE_NAME("cortex-a15"),
    ARM_CPU_TYPE_NAME("cortex-a53"),
    ARM_CPU_TYPE_NAME("cortex-a57"),
    ARM_CPU_TYPE_NAME("cortex-a72"),
    ARM_CPU_TYPE_NAME("host"),
    ARM_CPU_TYPE_NAME("max"),
};

If I add "ARM_CPU_TYPE_NAME("cortex-a7")," to the above array, it works and I get correct CPU type as I see it in /proc/cpuinfo.

Is my change make sense ? Thanks.

#1 lore raw
Quoted 11 lines · ratna manoj

Hi,

$> qemu-3.1.0/build/arm-softmmu/qemu-system-arm -M virt -cpu help|grep cortex-a7
cortex-a7
$>

As shown above 'virt' machine type lists 'cortex-a7' as supported processor, but when I try to load a kernel with -cpu cortext-a7 option it says:

qemu-system-arm: mach-virt: CPU type cortex-a7-arm-cpu not supported

Yes. The '-cpu help' list lists all the CPUs qemu-system-arm supports -- it is not cross-referenced against a supplied machine to eliminate CPUs that will not work with that machine. (It's a very long standing bug that '-cpu help' on its own will not print the list: this is because the "must specify a machine" check kicks in before we handle printing various -foo help texts.)

Quoted 12 lines

This is because of the check for valid_cpus in hw/arm/virt.c, where cortex-a7 is not listed.

From hw/arm/virt.c:

static const char *valid_cpus[] = {
    ARM_CPU_TYPE_NAME("cortex-a15"),
    ARM_CPU_TYPE_NAME("cortex-a53"),
    ARM_CPU_TYPE_NAME("cortex-a57"),
    ARM_CPU_TYPE_NAME("cortex-a72"),
    ARM_CPU_TYPE_NAME("host"),
    ARM_CPU_TYPE_NAME("max"),
};
Quoted 3 lines

If I add "ARM_CPU_TYPE_NAME("cortex-a7")," to the above array, it works and I get correct CPU type as I see it in /proc/cpuinfo.

Is my change make sense ? Thanks.

Yes, it would be reasonable for us to allow Cortex-A7 on the virt board. It will behave almost identically to cortex-a15, though, so you could probably just use that.

thanks
-- PMM