From: Durrant, Paul <pdurr...@amazon.com> Sent: Wednesday, December 18, 2019 
7:24 AM

> > From: Wei Liu <wei.liu....@gmail.com> On Behalf Of Wei Liu
> > Sent: 18 December 2019 14:43

[snip]

> > +
> > +static inline uint64_t read_hyperv_timer(void)
> > +{
> > +    uint64_t scale, offset, ret, tsc;
> > +    uint32_t seq;
> > +    const struct ms_hyperv_tsc_page *tsc_page = hyperv_tsc;
> > +
> > +    do {
> > +        seq = tsc_page->tsc_sequence;
> > +
> > +        /* Seq 0 is special. It means the TSC enlightenment is not
> > +         * available at the moment. The reference time can only be
> > +         * obtained from the Reference Counter MSR.
> > +         */
> > +        if ( seq == 0 )
> 
> Older versions of the spec used to use 0xFFFFFFFF I think, although when I 
> look again they
> seem to have been retro-actively fixed. In any case I think you should treat 
> both
> 0xFFFFFFFF and 0 as invalid.

FWIW, the 0xFFFFFFFF was just a bug in the spec.  Hyper-V implementations only
set the value to 0 to indicate invalid.  The equivalent Linux code checks only 
for 0.

Michael

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to