[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 6/6] x86: implement Hyper-V clock source


  • To: "Durrant, Paul" <pdurrant@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michael Kelley <mikelley@xxxxxxxxxxxxx>
  • Date: Wed, 18 Dec 2019 20:24:31 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0L0x5rHJmRCQhpJ22mtUJS4KQZ3hIg24AVjYni3pPwo=; b=XJkE2EDt4VgQh99Dg0mekMm2aop8F1cRV65jwy+RG2XiMBB9tAI3GOQkyfruFZcKC32rBeA+46kNTsypa3EKuKqV2YTDXhMT90KLV5NBjsw5hfYSo4xlnj8ZfQUbW3BP/aOqA6JeIRe2rFkso74AnaeylR3hG3zt6b4w5W8k5CZ7/0jMZgCqI7gVI/Tgqv8A5Ud/OoXGfQ1VgF7EodsSfEW217JYVH1ierHZOUdHHfg5/enb+cJzFz+ng3R3Fn71uW4s7uPXnoC++R/MEsWLmeWDjWU8t1jg+8Jn7c1hCRpFl11DaDsJ//bsal/Yl99eYeBYzYykVKmGYMi06RLCqA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CtdNqMDWh/jqew2IOQVRCqZCZGS74EcKBAU/qKDqqMjs0MRzqWd7GtFpRciG4P3ghMm6cISCcndGdy+Du5l/QAFqZAQl8wz2dMuEn70fMwWIGk0dWdBgEmUQHaMu3XfwuQTun8sWEmp4j9kcNSE1QvWSSIm/IB/I8VPSqSLX/D+yLmGykKlgPL93oIMLCHozV95y4Dpn1aeWGQ/PlAUgJN2zVa2OmdKk6xuvqezmYFEScD8PKfUpOruBq7GhDKMdMDBg9kdN0y8ijhNxWHMljX+Hk55abcGgRHznaRA90U3qaKwgKk1GSX+4GvZQ/6vz+opNBrfAxz2dJc+z3Bh7aw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=mikelley@xxxxxxxxxxxxx;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <liuwe@xxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 18 Dec 2019 20:24:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=True; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Owner=mikelley@xxxxxxxxxxxxxxxxxxx; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2019-12-18T20:24:29.6664157Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=General; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Application=Microsoft Azure Information Protection; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=06178f7d-d678-477a-9974-174d75fe3f3e; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Extended_MSFT_Method=Automatic
  • Thread-index: AQHVtbGNqrdYXOMZNUqZZ156KbPUoqfAAwUAgABSzqA=
  • Thread-topic: [PATCH v2 6/6] x86: implement Hyper-V clock source

From: Durrant, Paul <pdurrant@xxxxxxxxxx> Sent: Wednesday, December 18, 2019 
7:24 AM

> > From: Wei Liu <wei.liu.xen@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.