]> git.proxmox.com Git - mirror_qemu.git/commitdiff
pl031: Update last RTCLR value on write in case it's read back
authorJessica Clarke <jrtc27@jrtc27.com>
Mon, 26 Feb 2024 14:07:24 +0000 (14:07 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 27 Feb 2024 13:01:41 +0000 (13:01 +0000)
The PL031 allows you to read RTCLR, which is meant to give you the last
value written. PL031State has an lr field which is used when reading
from RTCLR, and is present in the VM migration state, but we never
actually update it, so it always reads as its initial 0 value.

Cc: qemu-stable@nongnu.org
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-id: 20240222000341.1562443-1-jrtc27@jrtc27.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/rtc/pl031.c

index 837b0bdf9bdec56f0f656cc89c5c8adc205eebd0..563bb4b446ebdfd16049baf9fab42c4ece155bda 100644 (file)
@@ -141,6 +141,7 @@ static void pl031_write(void * opaque, hwaddr offset,
         g_autofree const char *qom_path = object_get_canonical_path(opaque);
         struct tm tm;
 
+        s->lr = value;
         s->tick_offset += value - pl031_get_count(s);
 
         qemu_get_timedate(&tm, s->tick_offset);