xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Haozhong Zhang <haozhong.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Keir Fraser <keir@xen.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xen.org,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v5 1/6] x86/hvm: Collect information of TSC scaling ratio
Date: Wed, 24 Feb 2016 14:00:20 +0800	[thread overview]
Message-ID: <20160224060020.GA3974@hz-desktop.sh.intel.com> (raw)
In-Reply-To: <56CC8ACC02000078000D5480@prv-mh.provo.novell.com>

On 02/23/16 08:37, Jan Beulich wrote:
> >>> On 23.02.16 at 15:16, <boris.ostrovsky@oracle.com> wrote:
> > On 02/23/2016 09:10 AM, Jan Beulich wrote:
> >>>>> On 23.02.16 at 15:00, <boris.ostrovsky@oracle.com> wrote:
> >>> On 02/22/2016 09:04 PM, Haozhong Zhang wrote:
> >>>
> >>>>    
> >>>> +    if ( cpu_has_tsc_ratio )
> >>>> +        svm_function_table.tsc_scaling.ratio_frac_bits = 32;
> >>>> +
> >>>
> >>>>    
> >>>> +#define hvm_tsc_scaling_supported \
> >>>> +    (!!hvm_funcs.tsc_scaling.ratio_frac_bits)
> >>>> +
> >>> What is the difference (in usage) between cpu_has_tsc_ratio and
> >>> hvm_tsc_scaling_supported? Isn't the first imply the second (and if yes
> >>> then what's the reason for having the latter)?
> >> Iiuc cpu_has_tsc_ratio is AMD/SVM specific, while
> >> hvm_tsc_scaling_supported is meant to be vendor independent.
> >

Yes, it's to be vendor independent. Earlier versions of this patch
series set a field tsc_scaling_supported in hvm_function_table if
cpu_has_vmx_tsc_scaling or cpu_has_tsc_ratio. Jan suggested we could get
the same information if some of other fields are initialized
conditionally, and no extra field (tsc_scaling_supported) would be
needed any more.

> > Ah, OK. Can we then
> > 
> > #define hvm_tsc_scaling_supported (cpu_has_vmx_tsc_scaling || 
> > cpu_has_tsc_ratio)
> 
> Why would we? The above is doing precisely (but implicitly) that,
> just with only one memory access instead of two.
>

Boris, does the current one look fine for you, as it does the same thing
as your suggested one?

Thanks,
Haozhong

  reply	other threads:[~2016-02-24  6:00 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23  2:04 [PATCH v5 0/6] Add VMX TSC scaling support Haozhong Zhang
2016-02-23  2:04 ` [PATCH v5 1/6] x86/hvm: Collect information of TSC scaling ratio Haozhong Zhang
2016-02-23 14:00   ` Boris Ostrovsky
2016-02-23 14:10     ` Jan Beulich
2016-02-23 14:16       ` Boris Ostrovsky
2016-02-23 15:37         ` Jan Beulich
2016-02-24  6:00           ` Haozhong Zhang [this message]
2016-02-24 13:46             ` Haozhong Zhang
2016-02-24 14:49               ` Boris Ostrovsky
2016-02-24 14:36   ` Jan Beulich
2016-02-24 15:03     ` Haozhong Zhang
2016-02-26  4:27   ` Tian, Kevin
2016-02-23  2:05 ` [PATCH v5 2/6] x86/hvm: Setup " Haozhong Zhang
2016-02-24 15:01   ` Jan Beulich
2016-02-24 15:42     ` Haozhong Zhang
2016-02-24 15:51       ` Jan Beulich
2016-02-24 16:05         ` Haozhong Zhang
2016-02-23  2:05 ` [PATCH v5 3/6] x86/hvm: Replace architecture TSC scaling by a common function Haozhong Zhang
2016-02-24 15:07   ` Jan Beulich
2016-02-26  4:30   ` Tian, Kevin
2016-02-23  2:05 ` [PATCH v5 4/6] x86/hvm: Move saving/loading vcpu's TSC to common code Haozhong Zhang
2016-02-23  2:05 ` [PATCH v5 5/6] vmx: Add VMX RDTSC(P) scaling support Haozhong Zhang
2016-02-24 15:09   ` Jan Beulich
2016-02-26  4:31   ` Tian, Kevin
2016-02-23  2:05 ` [PATCH v5 6/6] docs: Add descriptions of TSC scaling in xl.cfg and tscmode.txt Haozhong Zhang
2016-02-26  4:37   ` Tian, Kevin
2016-02-26  4:44     ` Zhang, Haozhong
2016-02-26  8:01     ` Jan Beulich
2016-02-26  8:05       ` Haozhong Zhang
2016-02-29  2:02       ` Tian, Kevin
2016-02-29  2:45         ` Zhang, Haozhong
2016-02-29  9:04           ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160224060020.GA3974@hz-desktop.sh.intel.com \
    --to=haozhong.zhang@intel.com \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).