[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [ PATCH ] hpet: recover timer offset correctly
From: |
Pavel Dovgalyuk |
Subject: |
Re: [Qemu-devel] [ PATCH ] hpet: recover timer offset correctly |
Date: |
Wed, 20 Dec 2017 13:02:46 +0300 |
> * Pavel Dovgalyuk (address@hidden) wrote:
> > > From: Dr. David Alan Gilbert [mailto:address@hidden
> > > * Pavel Dovgalyuk (address@hidden) wrote:
> > > > 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.
> > >
> > > Please put the extra data in a subsection and tie the subsection to a
> > > property enabled by the machine type. That avoids breaking backwards
> > > migration compatibility.
> >
> > I thought about it and haven't found how to preserve the backward migration
> > compatibility
> > without breaking everything else.
> > Loading old (or compatible) snapshot without changing the version will
> > corrupt the offset in
> > post_load.
>
> There are lots of ways; for example you could initialise hpet_offset to
> a dummy value in a pre-load and spot that in the post-load instead of
> the version_id, or set a flag in a post-load on the subsection.
Thanks. Please check the second version.
Pavel Dovgalyuk