All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
To: xen-devel@lists.xen.org
Cc: andrew.cooper3@citrix.com,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	wei.liu2@citrix.com, jbeulich@suse.com
Subject: Re: [PATCH for 4.6] x86/VPMU: Set VPMU context pointer to NULL when freeing it
Date: Wed, 09 Sep 2015 09:45:19 +0200	[thread overview]
Message-ID: <1925010.vC6CuAkC7f@amur> (raw)
In-Reply-To: <1441767352-9022-1-git-send-email-boris.ostrovsky@oracle.com>

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@ts.fujitsu.com>

> 
> Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
> ---
>  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

  parent reply	other threads:[~2015-09-09  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  2:55 [PATCH for 4.6] x86/VPMU: Set VPMU context pointer to NULL when freeing it Boris Ostrovsky
2015-09-09  6:55 ` Jan Beulich
2015-09-09  7:45 ` Dietmar Hahn [this message]
2015-09-09  9:16 ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1925010.vC6CuAkC7f@amur \
    --to=dietmar.hahn@ts.fujitsu.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.