From: "Jan Beulich" Subject: Re: [PATCH v18 15/16] x86/VPMU: VPMU should not exist when vpmu_initialise() is called Date: Fri, 20 Feb 2015 15:06:19 +0000 Message-ID: <54E75B7B02000078000621A4@mail.emea.novell.com> References: <1424125619-10851-1-git-send-email-boris.ostrovsky@oracle.com> <1424125619-10851-16-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: <1424125619-10851-16-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, 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 16.02.15 at 23:26, wrote: > We don't need to try to destroy it since it can't be already allocated at the > time we try to initialize it. > > Signed-off-by: Boris Ostrovsky > Suggested-by: Andrew Cooper > --- > xen/arch/x86/hvm/vpmu.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c > index cdead13..fa34127 100644 > --- a/xen/arch/x86/hvm/vpmu.c > +++ b/xen/arch/x86/hvm/vpmu.c > @@ -480,10 +480,8 @@ void vpmu_initialise(struct vcpu *v) > BUILD_BUG_ON(sizeof(struct xen_pmu_regs) > XENPMU_REGS_PAD_SZ); > BUILD_BUG_ON(sizeof(struct compat_pmu_regs) > XENPMU_REGS_PAD_SZ); > > - if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) ) > - vpmu_destroy(v); > - vpmu_clear(vpmu); > - vpmu->context = NULL; > + ASSERT(!vpmu->flags && !vpmu->context); > + If this is legitimately a separate patch, it would seem to belong at the beginning of the series. Otherwise it should be integrated into whatever patch arranges for this no longer being possible. Jan