All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Jan Beulich <JBeulich@suse.com>, Brendan Gregg <bgregg@netflix.com>
Cc: dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 1/2] x86/VPMU: return correct fixed PMC count
Date: Wed, 25 Nov 2015 09:26:17 -0500	[thread overview]
Message-ID: <5655C509.1040205@oracle.com> (raw)
In-Reply-To: <565593A602000078000B8DF3@prv-mh.provo.novell.com>

On 11/25/2015 04:55 AM, Jan Beulich wrote:
>>>> On 25.11.15 at 00:53, <bgregg@netflix.com> wrote:
>> --- a/xen/arch/x86/cpu/vpmu_intel.c
>> +++ b/xen/arch/x86/cpu/vpmu_intel.c
>> @@ -166,10 +166,10 @@ static int core2_get_arch_pmc_count(void)
>>    */
>>   static int core2_get_fixed_pmc_count(void)
>>   {
>> -    u32 eax;
>> +    u32 edx;
>>   
>> -    eax = cpuid_eax(0xa);
>> -    return MASK_EXTR(eax, PMU_FIXED_NR_MASK);
>> +    edx = cpuid_edx(0xa);
>> +    return MASK_EXTR(edx, PMU_FIXED_NR_MASK);
>>   }
>>   
>>   /* edx bits 5-12: Bit width of fixed-function performance counters  */
> I'll commit as is since it's an immediate improvement, but I don't think
> this is sufficient: The SDM clearly says "if Version ID > 1", which isn't
> being tested here or in the immediately following function.

Are you referring to the statement in 18.2.2:
   "The enhanced features provided by architectural performance 
monitoring version 2 include the following" ?

I'd expect CPUID to report zeroes for those enhanced featured in v1.

However, I just noticed that various control and status registers are 
not available for v1. I wonder whether we should even support version 1 
since we'd need to add whole lot of 'if (supported)' throughout the code 
plus there are some assumptions about existence of IA32_PERF_GLOBAL_CTRL 
so we'll need to add additional logic to handle that too. And it's not 
clear to me if it's all worth it.

-boris

  reply	other threads:[~2015-11-25 14:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 23:53 [PATCH v2 0/2] Restricted VPMU filter flags Brendan Gregg
2015-11-24 23:53 ` [PATCH v2 1/2] x86/VPMU: return correct fixed PMC count Brendan Gregg
2015-11-25  9:13   ` Dietmar Hahn
2015-11-25  9:55   ` Jan Beulich
2015-11-25 14:26     ` Boris Ostrovsky [this message]
2015-11-25 15:31       ` Jan Beulich
2015-11-25 19:32         ` Boris Ostrovsky
2015-11-26  7:44           ` Jan Beulich
2015-11-24 23:53 ` [PATCH v2 2/2] x86/VPMU: implement ipc and arch filter flags Brendan Gregg
2015-11-25 15:13   ` Boris Ostrovsky
2015-11-25 23:35     ` Brendan Gregg
2015-11-26  8:11   ` Dietmar Hahn
2015-12-01  0:32     ` Brendan Gregg

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=5655C509.1040205@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=bgregg@netflix.com \
    --cc=dietmar.hahn@ts.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.