Commit d945f73e76 for qemu.org
commit d945f73e765bd38d12ca1aa591297bfdc5d0c54a
Author: Keith Monahan <keith@techtravels.org>
Date: Mon Oct 26 17:40:17 2026 +0000
target/hppa: re-arm the interval timer after loadvm
CR_IT holds the absolute expiry of the interval timer and is migrated
with the other control registers, but the QEMUTimer behind it was not
re-armed, so a restored guest never saw another clock interrupt.
Signed-off-by: Keith Monahan <keith@techtravels.org>
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/target/hppa/machine.c b/target/hppa/machine.c
index 6a143cf8df..1e59b8c2c9 100644
--- a/target/hppa/machine.c
+++ b/target/hppa/machine.c
@@ -21,6 +21,7 @@
#include "cpu.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
+#include "qemu/timer.h"
static int get_psw(QEMUFile *f, void *opaque, size_t size,
@@ -222,9 +223,21 @@ static const VMStateField vmstate_cpu_fields[] = {
VMSTATE_END_OF_LIST()
};
+static int cpu_post_load(void *opaque, int version_id)
+{
+ HPPACPU *cpu = opaque;
+
+ /* CR_IT holds the absolute expiry of the interval timer; re-arm it */
+ if (cpu->env.cr[CR_IT]) {
+ timer_mod(cpu->alarm_timer, cpu->env.cr[CR_IT]);
+ }
+ return 0;
+}
+
const VMStateDescription vmstate_hppa_cpu = {
.name = "cpu",
.version_id = 1,
.minimum_version_id = 1,
+ .post_load = cpu_post_load,
.fields = vmstate_cpu_fields,
};