From: "Jan Beulich" Subject: Re: [PATCH v15 13/21] x86/VPMU: Initialize PMU for PV(H) guests Date: Tue, 25 Nov 2014 14:03:49 +0000 Message-ID: <54749A55020000780004AB2C@mail.emea.novell.com> References: <1416179271-1221-1-git-send-email-boris.ostrovsky@oracle.com> <1416179271-1221-14-git-send-email-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1416179271-1221-14-git-send-email-boris.ostrovsky@oracle.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Boris Ostrovsky Cc: kevin.tian@intel.com, keir@xen.org, suravee.suthikulpanit@amd.com, andrew.cooper3@citrix.com, tim@xen.org, dietmar.hahn@ts.fujitsu.com, xen-devel@lists.xen.org, Aravind.Gopalakrishnan@amd.com, jun.nakajima@intel.com, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org >>> On 17.11.14 at 00:07, wrote: > --- a/xen/arch/x86/hvm/vmx/vpmu_core2.c > +++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c > @@ -362,24 +362,34 @@ static int core2_vpmu_alloc_resource(struct vcpu *v) > struct xen_pmu_intel_ctxt *core2_vpmu_cxt = NULL; > uint64_t *p = NULL; > > - if ( !acquire_pmu_ownership(PMU_OWNER_HVM) ) > - return 0; > - > - wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); > - if ( vmx_add_host_load_msr(MSR_CORE_PERF_GLOBAL_CTRL) ) > + p = xzalloc_bytes(sizeof(uint64_t)); xzalloc(uint64_t)? > + if ( !p ) > goto out_err; > > - if ( vmx_add_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL) ) > - goto out_err; > - vmx_write_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, 0); > - > - core2_vpmu_cxt = xzalloc_bytes(sizeof(*core2_vpmu_cxt) + > - sizeof(uint64_t) * fixed_pmc_cnt + > - sizeof(struct xen_pmu_cntr_pair) * > - arch_pmc_cnt); > - p = xzalloc(uint64_t); At least it was that way before... With that fixed, feel free to add Acked-by: Jan Beulich Jan