From: Jessica Clarke Date: Mon, 26 Feb 2024 14:07:24 +0000 (+0000) Subject: pl031: Update last RTCLR value on write in case it's read back X-Git-Tag: v7.2.10~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77f7beb8cfe6266a5823737028809f749be608f3;p=thirdparty%2Fqemu.git pl031: Update last RTCLR value on write in case it's read back 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 Reviewed-by: Alex Bennée Message-id: 20240222000341.1562443-1-jrtc27@jrtc27.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 4d28d57c9f2eb1cdf70b29cea6e50282e010075b) Signed-off-by: Michael Tokarev --- diff --git a/hw/rtc/pl031.c b/hw/rtc/pl031.c index b01d0e75d1a..2f3cd04eeb4 100644 --- a/hw/rtc/pl031.c +++ b/hw/rtc/pl031.c @@ -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);