qemu-patch-raspberry4/hw/timer
Peter Maydell 032cfe6a79 pl031: Correctly migrate state when using -rtc clock=host
The PL031 RTC tracks the difference between the guest RTC
and the host RTC using a tick_offset field. For migration,
however, we currently always migrate the offset between
the guest and the vm_clock, even if the RTC clock is not
the same as the vm_clock; this was an attempt to retain
migration backwards compatibility.

Unfortunately this results in the RTC behaving oddly across
a VM state save and restore -- since the VM clock stands still
across save-then-restore, regardless of how much real world
time has elapsed, the guest RTC ends up out of sync with the
host RTC in the restored VM.

Fix this by migrating the raw tick_offset. To retain migration
compatibility as far as possible, we have a new property
migrate-tick-offset; by default this is 'true' and we will
migrate the true tick offset in a new subsection; if the
incoming data has no subsection we fall back to the old
vm_clock-based offset information, so old->new migration
compatibility is preserved. For complete new->old migration
compatibility, the property is set to 'false' for 4.0 and
earlier machine types (this will only affect 'virt-4.0'
and below, as none of the other pl031-using machines are
versioned).

Reported-by: Russell King <rmk@armlinux.org.uk>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-id: 20190709143912.28905-1-peter.maydell@linaro.org
2019-07-15 14:17:04 +01:00
..
a9gtimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
allwinner-a10-pit.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
altera_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
arm_mptimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
arm_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
armv7m_systick.c hw/timer/armv7m_systick: Forbid non-privileged accesses 2019-07-04 17:25:30 +01:00
aspeed_rtc.c hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
aspeed_timer.c aspeed/timer: Ensure positive muldiv delta 2019-07-01 17:28:59 +01:00
cadence_ttc.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
cmsdk-apb-dualtimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
cmsdk-apb-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
digic-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
ds1338.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
etraxfs_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_mct.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_pwm.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
exynos4210_rtc.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
grlib_gptimer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
hpet.c hpet: Report warnings with warn_report(), not error_printf() 2019-04-17 21:21:49 +02:00
i8254.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
i8254_common.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
imx_epit.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
imx_gpt.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
Kconfig i386-softmmu.mak: remove all CONFIG_* except boards definitions 2019-03-07 21:45:53 +01:00
lm32_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
m41t80.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
m48t59-internal.h Normalize header guard symbol definition. 2019-05-13 08:58:55 +02:00
m48t59-isa.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
m48t59.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
Makefile.objs hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
mc146818rtc.c qapi: Rename target.json to misc-target.json 2019-07-02 13:37:00 +02:00
milkymist-sysctl.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
mips_gictimer.c hw/mips_gictimer: provide API for retrieving frequency 2017-02-21 22:24:58 +00:00
mss-timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
nrf51_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
omap_gptimer.c Replace all occurances of __FUNCTION__ with __func__ 2018-01-22 09:46:18 +01:00
omap_synctimer.c hw/timer/omap_synctimer.c: Don't use old_mmio 2017-09-21 16:34:27 +01:00
pl031.c pl031: Correctly migrate state when using -rtc clock=host 2019-07-15 14:17:04 +01:00
puv3_ost.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
pxa2xx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
sh_timer.c fix "Missing break in switch" coverity reports 2018-08-23 13:32:50 +02:00
slavio_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
stm32f2xx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
sun4v-rtc.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
trace-events hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
twl92230.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
xilinx_timer.c Include qemu/module.h where needed, drop it from qemu-common.h 2019-06-12 13:18:33 +02:00
xlnx-zynqmp-rtc.c Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00