Hello, Current QEMU ARM MPTimer device model provides only a certain subset of the emulation behavior, so this patch series is supposed to add missing parts by converting the MPTimer to use generic ptimer helper. It fixes some important ptimer bugs and provides new features that are required for the ARM MPTimer.
Emulation behavior is verified against the real HW by running specially crafted MPTimer tests in both icount and non-icount modes: https://gist.github.com/digetx/dbd46109503b1a91941a Changelog: I ommitted old changelog since the rest of the precursor ptimer patches already been applied and the ARM MPTimer patch has Peter's Crosthwaite r-b. V14: Set the ptimer policy in the ptimer_init() instead of adding ptimer_set_policy(), keeping ptimer VMState unchanged and dropped hw_error() hardening asserts as per Peter's Maydell V13 review comments, addressed the rest of the review comments. Dmitry Osipenko (3): hw/ptimer: Support running with counter = 0 by introducing new policy feature hw/ptimer: Fix counter - 1 returned by ptimer_get_count for the active timer arm_mptimer: Convert to use ptimer hw/arm/musicpal.c | 2 +- hw/core/ptimer.c | 49 ++++++++------- hw/dma/xilinx_axidma.c | 2 +- hw/m68k/mcf5206.c | 2 +- hw/m68k/mcf5208.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/lan9118.c | 2 +- hw/timer/allwinner-a10-pit.c | 2 +- hw/timer/arm_mptimer.c | 133 +++++++++++++++++++++-------------------- hw/timer/arm_timer.c | 2 +- hw/timer/aspeed_timer.c | 2 +- hw/timer/digic-timer.c | 2 +- hw/timer/etraxfs_timer.c | 6 +- hw/timer/exynos4210_mct.c | 7 ++- hw/timer/exynos4210_pwm.c | 2 +- hw/timer/exynos4210_rtc.c | 4 +- hw/timer/grlib_gptimer.c | 2 +- hw/timer/imx_epit.c | 4 +- hw/timer/imx_gpt.c | 2 +- hw/timer/lm32_timer.c | 2 +- hw/timer/milkymist-sysctl.c | 4 +- hw/timer/puv3_ost.c | 2 +- hw/timer/sh_timer.c | 2 +- hw/timer/slavio_timer.c | 2 +- hw/timer/xilinx_timer.c | 2 +- include/hw/ptimer.h | 7 ++- include/hw/timer/arm_mptimer.h | 5 +- 27 files changed, 133 insertions(+), 122 deletions(-) -- 2.9.0