From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky 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 Message-ID: <565DB083.8080901@oracle.com> References: <1448908721-1777-1-git-send-email-boris.ostrovsky@oracle.com> <2883096.ryV0xpaQmQ@amur> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <2883096.ryV0xpaQmQ@amur> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dietmar Hahn , xen-devel@lists.xen.org Cc: andrew.cooper3@citrix.com, jbeulich@suse.com List-Id: xen-devel@lists.xenproject.org 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 >> --- >> 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