xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	Kevin Tian <kevin.tian@intel.com>,
	xen-devel@lists.xen.org, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH v5 1/6] x86/hvm: Collect information of TSC scaling ratio
Date: Wed, 24 Feb 2016 09:49:20 -0500	[thread overview]
Message-ID: <56CDC2F0.3060201@oracle.com> (raw)
In-Reply-To: <20160224134606.GA10229@hz-desktop.sh.intel.com>

On 02/24/2016 08:46 AM, Haozhong Zhang wrote:
> Sorry, forgot sending the last reply to Boris.
>
> On 02/24/16 14:00, Haozhong Zhang wrote:
>> 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?

Yes, this is fine. IMO using cpu_has_* would be slightly  more logical 
but as Jan pointed it is also potentially more costly.

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

-boris

  reply	other threads:[~2016-02-24 14:49 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
2016-02-24 13:46             ` Haozhong Zhang
2016-02-24 14:49               ` Boris Ostrovsky [this message]
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=56CDC2F0.3060201@oracle.com \
    --to=boris.ostrovsky@oracle.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).