From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Ostrovsky Subject: Re: [PATCH v6] x86/VPMU: implement ipc and arch filter flags Date: Fri, 8 Jan 2016 10:06:07 -0500 Message-ID: <568FD05F.1090707@oracle.com> References: <1452248101-4802-1-git-send-email-bgregg@netflix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1452248101-4802-1-git-send-email-bgregg@netflix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Brendan Gregg , xen-devel@lists.xen.org Cc: andrew.cooper3@citrix.com, kevin.tian@intel.com, jbeulich@suse.com, jun.nakajima@intel.com, dietmar.hahn@ts.fujitsu.com List-Id: xen-devel@lists.xenproject.org On 01/08/2016 05:15 AM, Brendan Gregg wrote: > This introduces a way to have a restricted VPMU, by specifying one of two > predefined groups of PMCs to make available. For secure environments, this > allows the VPMU to be used without needing to enable all PMCs. > > Signed-off-by: Brendan Gregg > Reviewed-by: Boris Ostrovsky This still stands with one correction below > @@ -656,12 +661,51 @@ static int core2_vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content, > tmp = msr - MSR_P6_EVNTSEL(0); > if ( tmp >= 0 && tmp < arch_pmc_cnt ) > { > + bool_t blocked = 0; > + uint64_t umaskevent; > struct xen_pmu_cntr_pair *xen_pmu_cntr_pair = > vpmu_reg_pointer(core2_vpmu_cxt, arch_counters); > > if ( msr_content & ARCH_CTRL_MASK ) > return -EINVAL; > > + /* PMC filters */ > + umaskevent = msr_content & MSR_IA32_CMT_EVTSEL_UE_MASK; > + if ( vpmu_features & (XENPMU_FEATURE_IPC_ONLY || > + XENPMU_FEATURE_ARCH_ONLY) ) > + { > Typo: Should be '|', not '||'. -boris