
From: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> virt inclusion category: feature bugzilla: https://gitee.com/openeuler/qemu/issues/IBSJV9 ------------------------------------------------------------------------ For now this is the same as the host CPU. Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com> Signed-off-by: Jinqian Yang <yangjinqian1@huawei.com> --- hw/arm/virt.c | 3 +++ target/arm/cpu64.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 8823f2ed1c..0ce826a0fd 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -232,6 +232,9 @@ static const char *valid_cpus[] = { ARM_CPU_TYPE_NAME("Kunpeng-920"), ARM_CPU_TYPE_NAME("host"), ARM_CPU_TYPE_NAME("max"), +#if defined(CONFIG_KVM) + ARM_CPU_TYPE_NAME("kunpeng-920"), +#endif /* CONFIG_KVM */ }; static CPUArchId *virt_find_cpu_slot(MachineState *ms, int vcpuid); diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 6eca55ac29..69c3f5710e 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -817,6 +817,18 @@ static void aarch64_max_initfn(Object *obj) } } +static void aarch64_kunpeng_920_initfn_hack(Object *obj) +{ + ARMCPU *cpu = ARM_CPU(obj); + + if (kvm_enabled()) { + aarch64_host_initfn(obj); + } else { + cpu->host_cpu_probe_failed = true; + return; + } +} + static const ARMCPUInfo aarch64_cpus[] = { { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, @@ -825,6 +837,9 @@ static const ARMCPUInfo aarch64_cpus[] = { #if defined(CONFIG_KVM) || defined(CONFIG_HVF) { .name = "host", .initfn = aarch64_host_initfn }, #endif +#if defined(CONFIG_KVM) + { .name = "kunpeng-920", .initfn = aarch64_kunpeng_920_initfn_hack }, +#endif }; static bool aarch64_cpu_get_aarch64(Object *obj, Error **errp) -- 2.33.0