[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for 4.6] x86/VPMU: Set VPMU context pointer to NULL when freeing it


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxx>
  • Date: Wed, 09 Sep 2015 09:45:19 +0200
  • Cc: andrew.cooper3@xxxxxxxxxx, Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>, wei.liu2@xxxxxxxxxx, jbeulich@xxxxxxxx
  • Delivery-date: Wed, 09 Sep 2015 07:45:24 +0000
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:Received:Received:Received:From:To:Cc: Subject:Date:Message-ID:User-Agent:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Content-Type; b=P6GrWTLrR5SX2rNZ13lsIDDtxdFlZCBhIhK988a5XVpdiRTF6OZZbcTK n5EfFmk5GCJuVDQ1BtaSnf8uQLr3lV5IOKrH0ih+ert0zL8AM4Tww6rAK Af7FDw4t23Xiu6eqJaVJZ73ZG5mBAEwHm4yj2Yn5bMHHpw5IUwLHN8WQ+ 3o9DPpduksjV8jgcy29RmUclzDJ0PdX5H4SJcV2Dz4xy50OOEyEFaXJhK nNRVR71U9egni4ir8cxSmq9JNyo0Y;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

Am Dienstag 08 September 2015, 22:55:52 schrieb Boris Ostrovsky:
> Otherwise we may hit assertion in vpmu_initialise() if vcpu is offlined
> and then onlined again.
> 
> For tidyness, set priv_context to NULL as well.

Reviewed-by: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxx>

> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
> ---
>  xen/arch/x86/cpu/vpmu_amd.c   | 2 ++
>  xen/arch/x86/cpu/vpmu_intel.c | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
> index 825be72..04da81a 100644
> --- a/xen/arch/x86/cpu/vpmu_amd.c
> +++ b/xen/arch/x86/cpu/vpmu_amd.c
> @@ -438,6 +438,8 @@ static void amd_vpmu_destroy(struct vcpu *v)
>          amd_vpmu_unset_msr_bitmap(v);
>  
>      xfree(vpmu->context);
> +    vpmu->context = NULL;
> +    vpmu->priv_context = NULL;
>  
>      if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
>          release_pmu_ownship(PMU_OWNER_HVM);
> diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
> index b3750d7..12f80ae 100644
> --- a/xen/arch/x86/cpu/vpmu_intel.c
> +++ b/xen/arch/x86/cpu/vpmu_intel.c
> @@ -828,7 +828,9 @@ static void core2_vpmu_destroy(struct vcpu *v)
>      struct vpmu_struct *vpmu = vcpu_vpmu(v);
>  
>      xfree(vpmu->context);
> +    vpmu->context = NULL;
>      xfree(vpmu->priv_context);
> +    vpmu->priv_context = NULL;
>      if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
>          core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
>      release_pmu_ownship(PMU_OWNER_HVM);
> 

-- 
Company details: http://ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.