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

Re: [PATCH v2] xen/x86: public: add TSC defines for cpuid leaf 4


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Krister Johansen <kjlx@xxxxxxxxxxxxxxxxxx>
  • Date: Fri, 27 Jan 2023 10:37:10 -0800
  • Arc-authentication-results: i=1; rspamd-5fb8f68d88-ns49n; auth=pass smtp.auth=dreamhost smtp.mailfrom=kjlx@xxxxxxxxxxxxxxxxxx
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1674844633; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vC3M/mfIsIhsrlC/2752bkkfLE5eFiFR7/YgAX2CWkQ=; b=yl6L32KYOt6vAiden3mXGMIuOW4QJGmIyvYbS4QACsve5R6toAG8wKPXp3JPI3LHF6t9Y3 2O8Xt0n7CngQl3ckXltPxZ96u/0S+/BiKZhElUpX9d6A0VU9TQ1A9fxve7L5zZFQImeFv0 jp8YOtj+kq66VKuR6QbG8PA6NzA7lZF/iD0TM3qjUMM+PC7Ep6bMEys300k6itNDTY9aFD MSl9v2LMjA+2MGPrT22/QilrhXUn0fDhA3tipI1PmuIt5/n7yY+oCyoRp45zLZp1CbktGO rIP0qlUy9fFwFLhC8mHcGa94YtAcD6vm7TSe0W85Auu1Uifq87XIxo7IHUrnhg==
  • Arc-seal: i=1; s=arc-2022; d=mailchannels.net; t=1674844633; a=rsa-sha256; cv=none; b=4LFIQX4S3tZOfDEp+xy33gVo7jaLUXDb6wet+ASLjAPV261Zy61B5oNRM5WO3f38Mv4Cwh kWCYXPe4G/NV2JsOZIKd2D/0QYiTpixH3dwMHJvS8Epo+CRktRJ5BIKedNQ/1lrWzhRZHz 4B5SgdQrkx9t/bDlKK/BGDxY7glJeowCCNXBeVjxtCqfs+thsPdqIkVYAjeF3kCDCRmArl vAE/IhN9Y/6DOdnP9Ju7fHfYh5MJhh7sFen4muBlkc/+UP9+PuOukJ5qxueAgFaSWkrcp0 DYj8fMag+5MC4fFE7aSdqYhzfl4Yi5zrLuJ+ReFl5qwKPQDXYAzITEdwFXK4qA==
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, David Reaver <me@xxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 27 Jan 2023 18:37:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Jan 27, 2023 at 08:16:18AM +0100, Jan Beulich wrote:
> On 26.01.2023 19:02, Krister Johansen wrote:
> > On Thu, Jan 26, 2023 at 10:57:01AM +0100, Jan Beulich wrote:
> >> On 25.01.2023 19:45, Krister Johansen wrote:
> >>> --- a/xen/include/public/arch-x86/cpuid.h
> >>> +++ b/xen/include/public/arch-x86/cpuid.h
> >>> @@ -72,6 +72,14 @@
> >>>   * Sub-leaf 2: EAX: host tsc frequency in kHz
> >>>   */
> >>>  
> >>> +#define XEN_CPUID_TSC_EMULATED               (1u << 0)
> >>> +#define XEN_CPUID_HOST_TSC_RELIABLE          (1u << 1)
> >>> +#define XEN_CPUID_RDTSCP_INSTR_AVAIL         (1u << 2)
> >>> +#define XEN_CPUID_TSC_MODE_DEFAULT           (0)
> >>> +#define XEN_CPUID_TSC_MODE_EMULATE           (1u)
> >>> +#define XEN_CPUID_TSC_MODE_NOEMULATE         (2u)
> >>> +#define XEN_CPUID_TSC_MODE_NOEMULATE_TSC_AUX (3u)
> >>
> >> Actually I think we'd better stick to the names found in asm/time.h
> >> (and then replace their uses, dropping the #define-s there). If you
> >> agree, I'd be happy to make the adjustment while committing.
> > 
> > Just to confirm, this would be moving these:
> > 
> >    #define TSC_MODE_DEFAULT          0
> >    #define TSC_MODE_ALWAYS_EMULATE   1
> >    #define TSC_MODE_NEVER_EMULATE    2
> >    
> > To cpuid.h?  I'm generally fine with this.  I don't see anything in
> > Linux that's using these names.  The only question I have is whether
> > we'd still want to prefix the names with XEN so that if they're pulled
> > in to Linux it's clear that the define is Xen specific?  E.g. something
> > like this perhaps?
> > 
> >    #define XEN_TSC_MODE_DEFAULT          0
> >    #define XEN_TSC_MODE_ALWAYS_EMULATE   1
> >    #define XEN_TSC_MODE_NEVER_EMULATE    2
> > 
> > That does increase the number of files we'd need to touch to make the
> > change, though. (And the other defines in that file all start with
> > XEN_CPUID).
> > 
> > Though, if you mean doing it this way:
> > 
> >    #define XEN_CPUID_TSC_MODE_DEFAULT          0
> >    #define XEN_CPUID_TSC_MODE_ALWAYS_EMULATE   1
> >    #define XEN_CPUID_TSC_MODE_NEVER_EMULATE    2
> >  
> > then no objection to that at all.  Apologies for overlooking the naming
> > overlap when I put this together the first time.
> 
> Yes, it's the last variant you list that I was after. And I'd be okay to
> leave dropping the so far private constants to a separate follow-on patch.

Ok, thanks. I'll send you a v3 that makes these changes, unless you've
already fixed this up and committed the v2.  In that case, feel free to
disregard.

-K



 


Rackspace

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