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.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
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);
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);