From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>, xen-devel@lists.xen.org
Cc: andrew.cooper3@citrix.com, jbeulich@suse.com
Subject: Re: [PATCH 1/2] x86/VPMU: Support only versions 2 and 3 of architectural performance monitoring
Date: Tue, 1 Dec 2015 09:36:51 -0500 [thread overview]
Message-ID: <565DB083.8080901@oracle.com> (raw)
In-Reply-To: <2883096.ryV0xpaQmQ@amur>
On 12/01/2015 04:01 AM, Dietmar Hahn wrote:
> Am Montag 30 November 2015, 13:38:40 schrieb Boris Ostrovsky:
>> We need to have at least version 2 since it's the first version to
>> support various control and status registers (such as
>> MSR_CORE_PERF_GLOBAL_CTRL) that VPMU relies on always having.
>>
>> With explicit testing for PMU version we can now remove CPUID model
>> check.
>>
>> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
>> ---
>> xen/arch/x86/cpu/vpmu_intel.c | 55 +++++++------------------------------------
>> 1 file changed, 8 insertions(+), 47 deletions(-)
>>
>> diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
>> index d5ea7fe..bb4ddcc 100644
>> --- a/xen/arch/x86/cpu/vpmu_intel.c
>> +++ b/xen/arch/x86/cpu/vpmu_intel.c
>> @@ -955,59 +955,20 @@ int vmx_vpmu_initialise(struct vcpu *v)
>> int __init core2_vpmu_init(void)
>> {
>> u64 caps;
>> + unsigned int version = 0;
>>
>> - if ( current_cpu_data.x86 != 6 )
>> + if ( current_cpu_data.cpuid_level >= 0xa )
>> + version = cpuid_eax(0xa) & 0xff;
>> + if ( (version != 2) && (version != 3) )
>> {
>> - printk(XENLOG_WARNING "VPMU: only family 6 is supported\n");
>> + printk(XENLOG_WARNING "VPMU: version %d is not supported\n", version);
>> return -EINVAL;
> But this means that all (newer?) processors with version=4 are not supported
> even though the SDM 3B tells:
> "Processors supporting architectural performance monitoring version 4 also
> supports version 1, 2, and 3, ..."
>
> Shold we not only write a hint that version 4 capabilities are not supported
> and fake this cpuid-flag for the guests to the version 3?
I in fact didn't know there was version 4 since I've always been looking
at (apparently) old version of the SDM (Jan 2013).
We should indeed then downgrade version 4 to 3 as reported by .do_cpud() op.
-boris
next prev parent reply other threads:[~2015-12-01 14:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 18:38 [PATCH 1/2] x86/VPMU: Support only versions 2 and 3 of architectural performance monitoring Boris Ostrovsky
2015-11-30 18:38 ` [PATCH 2/2] x86/VPMU: No need to check whether VPMU quirk is needed on Intel Boris Ostrovsky
2015-12-01 13:07 ` Jan Beulich
2015-12-01 9:01 ` [PATCH 1/2] x86/VPMU: Support only versions 2 and 3 of architectural performance monitoring Dietmar Hahn
2015-12-01 14:36 ` Boris Ostrovsky [this message]
2015-12-01 13: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=565DB083.8080901@oracle.com \
--to=boris.ostrovsky@oracle.com \
--cc=andrew.cooper3@citrix.com \
--cc=dietmar.hahn@ts.fujitsu.com \
--cc=jbeulich@suse.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.