hpet: recover timer offset correctly
commit829600a519386c7b188d5d813e78ba69bf0bd323
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>
Thu, 11 Jan 2018 08:24:58 +0000 (11 11:24 +0300)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 12 Jan 2018 12:22:02 +0000 (12 13:22 +0100)
tree9a6e6fe965845a0d23623b45b3c04bd4fd786c96
parent8cd91acec8dfea6065272ca828405333f564a612
hpet: recover timer offset correctly

HPET saves its state by calculating the current time and recovers timer
offset using this calculated value. But these calculations include
divisions and multiplications. Therefore the timer state cannot be recovered
precise enough.
This patch introduces saving of the original value of the offset to
preserve the determinism of the timer.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Signed-off-by: Maria Klimushenkova <maria.klimushenkova@ispras.ru>
Reviewed-by: Juan Quintela <quintela@redhat.com>
--
v3: Added compat property for correct migration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/timer/hpet.c
include/hw/compat.h