qemu/include/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.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
allwinner-a10-pit.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
arm_mptimer.h arm_mptimer: Convert to use ptimer 2016-10-24 16:26:53 +01:00
armv7m_systick.h arm: Move system_clock_scale to armv7m_systick.h 2019-05-23 14:47:43 +01:00
aspeed_rtc.h hw: timer: Add ASPEED RTC device 2019-07-01 17:28:59 +01:00
aspeed_timer.h aspeed/timer: fix compile breakage with clang 3.4.2 2018-09-25 15:13:24 +01:00
cmsdk-apb-dualtimer.h hw/timer/cmsdk-apb-dualtimer: Implement CMSDK dual timer module 2018-08-24 13:17:41 +01:00
cmsdk-apb-timer.h hw/char/cmsdk-apb-timer: Implement CMSDK APB timer device 2017-07-17 13:36:08 +01:00
digic-timer.h Use scripts/clean-includes to drop redundant qemu/typedefs.h 2016-03-22 22:20:16 +01:00
hpet.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
i8254_internal.h hw/timer/i8254: rename pit_init() -> i8254_pit_init() 2017-12-18 17:07:02 +03:00
i8254.h hw/timer/i8254: rename pit_init() -> i8254_pit_init() 2017-12-18 17:07:02 +03:00
imx_epit.h i.MX: Split the CCM class into an abstract base class and a concrete class 2015-12-17 13:37:15 +00:00
imx_gpt.h i.MX: Add i.MX7 GPT variant 2018-02-09 10:40:30 +00:00
m48t59.h Include qemu-common.h exactly where needed 2019-06-12 13:20:20 +02:00
mc146818rtc_regs.h qtest: add rtc periodic timer test 2017-06-06 20:18:35 +02:00
mc146818rtc.h hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init() 2017-12-18 17:07:02 +03:00
mips_gictimer.h hw/mips_gictimer: provide API for retrieving frequency 2017-02-21 22:24:58 +00:00
mss-timer.h msf2: Add Smartfusion2 System timer 2017-09-21 16:36:56 +01:00
nrf51_timer.h hw/timer/nrf51_timer: Add nRF51 Timer peripheral 2019-01-07 15:23:47 +00:00
pl031.h pl031: Correctly migrate state when using -rtc clock=host 2019-07-15 14:17:04 +01:00
stm32f2xx_timer.h stm32f2xx_timer: Add the stm32f2xx Timer 2015-03-11 13:21:05 +00:00
sun4v-rtc.h target-sparc: implement sun4v RTC 2017-01-18 22:03:44 +01:00
xlnx-zynqmp-rtc.h Supply missing header guards 2019-06-12 13:20:21 +02:00