target/mips: save CP0 timer in vmstate
The MIPS R4K CP0 timer (env->timer) is not included in vmstate_mips_cpu, so after loadvm the QEMUTimer has no scheduled expiry. This causes qemu_poll_ns() to block indefinitely and the guest to freeze until an external I/O event (e.g. a keypress) wakes the main loop. Fix by adding an optional vmstate subsection for the timer, following the same pattern used by ARM (gt_timer), RISC-V (env.stimer), SPARC (qtimer), and OpenRISC (timer). The .needed callback returns false when env->timer is NULL (KVM mode), keeping the subsection optional for backwards compatibility with existing snapshots. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1987 Signed-off-by: Trieu Huynh <vikingtc4@gmail.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-ID: <20260329113732.482619-1-vikingtc4@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>