(Series fully reviewed) When using HVF, the accelerator gets the host Generic Timer frequency and update cpu->gt_cntfrq_hz; it is however too late, as the timers have been created in arm_cpu_realizefn() using the default frequency. Then guest virtualization code depending on timers ends very slow (experienced on Silicon M1, timer running at 24MHz but QEMU timer a 1GHz, ~70x slower).
This series fixes that by introducing a cpu_target_realize() callback for accelerators, creating ARM timers *after* calling this callback, and correctly setting the per-cpu timer freq there. Philippe Mathieu-Daudé (4): accel: Introduce AccelOpsClass::cpu_target_realize() hook accel/hvf: Add hvf_arch_cpu_realize() stubs target/arm: Create GTimers *after* features finalized / accel realized target/arm/hvf: Really set Generic Timer counter frequency include/accel/accel-cpu-ops.h | 1 + include/system/hvf_int.h | 2 ++ accel/accel-common.c | 5 +++ accel/hvf/hvf-accel-ops.c | 2 ++ target/arm/cpu.c | 65 ++++++++++++++++++----------------- target/arm/hvf/hvf.c | 20 ++++++++++- target/i386/hvf/hvf.c | 5 +++ 7 files changed, 67 insertions(+), 33 deletions(-) -- 2.49.0