On 1/13/23 15:04, Fabiano Rosas wrote:
> The cortex-a15 is not present anymore when CONFIG_TCG=n, so use the
> cortex-a57 as default cpu for KVM.
>
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
Our recommendation currently for KVM on ARM is to always use CPU="host", as named cpu models generally don't work (yet?) with KVM.
https://qemu-project.gitlab.io/qemu/system/arm/cpu-features.html
Should then "host" be the default for KVM if CONFIG_TCG=N or CONFIG_TCG=M and the TCG .so is not loaded?
Thanks,
Claudio
> ---
> hw/arm/virt.c | 6 ++++++
> tests/qtest/arm-cpu-features.c | 3 +--
> 2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/virt.c b/hw/arm/virt.c
> index ea2413a0ba..19854f4137 100644
> --- a/hw/arm/virt.c
> +++ b/hw/arm/virt.c
> @@ -203,8 +203,10 @@ static const int a15irqmap[] = {
> };
>
> static const char *valid_cpus[] = {
> +#ifdef CONFIG_TCG
> ARM_CPU_TYPE_NAME("cortex-a7"),
> ARM_CPU_TYPE_NAME("cortex-a15"),
> +#endif
> ARM_CPU_TYPE_NAME("cortex-a35"),
> ARM_CPU_TYPE_NAME("cortex-a53"),
> ARM_CPU_TYPE_NAME("cortex-a55"),
> @@ -3003,7 +3005,11 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
> mc->minimum_page_bits = 12;
> mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids;
> mc->cpu_index_to_instance_props = virt_cpu_index_to_props;
> +#ifdef CONFIG_TCG
> mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
> +#else
> + mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57");
> +#endif
> mc->get_default_cpu_node_id = virt_get_default_cpu_node_id;
> mc->kvm_type = virt_kvm_type;
> assert(!mc->get_hotplug_handler);
> diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c
> index 8691802950..4be1415823 100644
> --- a/tests/qtest/arm-cpu-features.c
> +++ b/tests/qtest/arm-cpu-features.c
> @@ -507,8 +507,7 @@ static void test_query_cpu_model_expansion_kvm(const void *data)
> char *error;
>
> assert_error(qts, "cortex-a15",
> - "We cannot guarantee the CPU type 'cortex-a15' works "
> - "with KVM on this host", NULL);
> + "The CPU type 'cortex-a15' is not a recognized ARM CPU type", NULL);
>
> assert_has_feature_enabled(qts, "host", "aarch64");
>