> -----Original Message-----
> From: Wei Liu <w...@xen.org>
> Sent: 18 December 2019 22:21
> To: Michael Kelley <mikel...@microsoft.com>
> Cc: Durrant, Paul <pdurr...@amazon.com>; Wei Liu <w...@xen.org>; Xen
> Development List <xen-devel@lists.xenproject.org>; Wei Liu
> <li...@microsoft.com>; Jan Beulich <jbeul...@suse.com>; Andrew Cooper
> <andrew.coop...@citrix.com>; Roger Pau Monné <roger....@citrix.com>
> Subject: Re: [PATCH v2 6/6] x86: implement Hyper-V clock source
> 
> On Wed, 18 Dec 2019 at 20:24, Michael Kelley <mikel...@microsoft.com>
> wrote:
> >
> > 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.
> >
> 
> Thanks for chiming in, Michael.
> 
> In that case I will submit a fix to change Xen's viridian code to
> remove the wrong value there.

If no consuming version of Windows is going to be upset seeing all-Fs then 
that's fine. Thanks for the clarification.

Cheers,

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

Reply via email to