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>
This commit is contained in:
Pavel Dovgalyuk 2018-01-11 11:24:58 +03:00 committed by Paolo Bonzini
parent 8cd91acec8
commit 829600a519
2 changed files with 33 additions and 3 deletions

View file

@ -2,7 +2,11 @@
#define HW_COMPAT_H
#define HW_COMPAT_2_11 \
/* empty */
{\
.driver = "hpet",\
.property = "hpet-offset-saved",\
.value = "false",\
},
#define HW_COMPAT_2_10 \
{\