HVF cpu_instance_init() was only implemented for X86. Add a stub for ARM, allowing to register as generic AccelOpsClass::cpu_instance_init hook. X86's ACCEL_CPU_NAME("hvf") TypeInfo is now empty, remove it. Signed-off-by: Philippe Mathieu-Daudé --- include/system/hvf_int.h | 1 + accel/hvf/hvf-accel-ops.c | 1 + target/arm/hvf/hvf.c | 4 ++++ target/i386/hvf/hvf-cpu.c | 25 +------------------------ 4 files changed, 7 insertions(+), 24 deletions(-) diff --git a/include/system/hvf_int.h b/include/system/hvf_int.h index d5eaf26dda8..cb8abbc7cc9 100644 --- a/include/system/hvf_int.h +++ b/include/system/hvf_int.h @@ -109,6 +109,7 @@ int hvf_update_guest_debug(CPUState *cpu); */ bool hvf_arch_supports_guest_debug(void); +void hvf_arch_cpu_instance_init(CPUState *cpu); bool hvf_arch_cpu_realize(CPUState *cpu, Error **errp); uint32_t hvf_arch_get_default_ipa_bit_size(void); uint32_t hvf_arch_get_max_ipa_bit_size(void); diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 6edc2242ed9..a9c9d5d9a81 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -356,6 +356,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, const void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); + ops->cpu_instance_init = hvf_arch_cpu_instance_init; ops->cpu_realize = hvf_arch_cpu_realize; ops->create_vcpu_thread = hvf_start_vcpu_thread; diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index d88cbe7c82a..b825a1ae6d4 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1504,6 +1504,10 @@ int hvf_arch_init_vcpu(CPUState *cpu) return 0; } +void hvf_arch_cpu_instance_init(CPUState *cpu) +{ +} + bool hvf_arch_cpu_realize(CPUState *cs, Error **errp) { ARMCPU *cpu = ARM_CPU(cs); diff --git a/target/i386/hvf/hvf-cpu.c b/target/i386/hvf/hvf-cpu.c index 35f6bddbc0e..5d74ca6fd56 100644 --- a/target/i386/hvf/hvf-cpu.c +++ b/target/i386/hvf/hvf-cpu.c @@ -14,7 +14,6 @@ #include "system/system.h" #include "hw/core/boards.h" #include "system/hvf.h" -#include "accel/accel-cpu-target.h" #include "hvf-i386.h" static void hvf_cpu_max_instance_init(X86CPU *cpu) @@ -56,7 +55,7 @@ static void hvf_cpu_xsave_init(void) } } -static void hvf_cpu_instance_init(CPUState *cs) +void hvf_arch_cpu_instance_init(CPUState *cpu) { X86CPU *cpu = X86_CPU(cs); X86CPUClass *xcc = X86_CPU_GET_CLASS(cpu); @@ -77,25 +76,3 @@ bool hvf_arch_cpu_realize(CPUState *cs, Error **errp) { return host_cpu_realizefn(cs, errp); } - -static void hvf_cpu_accel_class_init(ObjectClass *oc, const void *data) -{ - AccelCPUClass *acc = ACCEL_CPU_CLASS(oc); - - acc->cpu_instance_init = hvf_cpu_instance_init; -} - -static const TypeInfo hvf_cpu_accel_type_info = { - .name = ACCEL_CPU_NAME("hvf"), - - .parent = TYPE_ACCEL_CPU, - .class_init = hvf_cpu_accel_class_init, - .abstract = true, -}; - -static void hvf_cpu_accel_register_types(void) -{ - type_register_static(&hvf_cpu_accel_type_info); -} - -type_init(hvf_cpu_accel_register_types); -- 2.53.0