x86/VPMU: Set VPMU context pointer to NULL when freeing it
PATCH 1/1 x86/VPMU: Set VPMU context pointer to NULL when freeing it
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 <[email protected]>
--- xen/arch/x86/cpu/vpmu_amd.c | 2 ++ xen/arch/x86/cpu/vpmu_intel.c | 2 ++ 2 files changed, 4 insertions(+)
xen/arch/x86/cpu/vpmu_amd.c +2 -0
@@ -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 );
xen/arch/x86/cpu/vpmu_intel.c +2 -0
@@ -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 );
Signature · 1 line
1.8.1.4
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 09.09.15 at 04:55, <[email protected]> wrote:
Otherwise we may hit assertion in
vpmu_initialise()if vcpu is offlined and then onlined again.For tidyness, set
priv_contextto NULL as well.Signed-off-by Boris Ostrovsky <[email protected]>
Acked-by Jan Beulich <[email protected]>
Am Dienstag 08 September 2015, 22:55:52 schrieb Boris Ostrovsky:
Quoted 4 lines
Otherwise we may hit assertion in
vpmu_initialise()if vcpu is offlined and then onlined again.For tidyness, set
priv_contextto NULL as well.
Reviewed-by Dietmar Hahn <[email protected]>
Quoted 35 lines
Signed-off-by Boris Ostrovsky <[email protected]>--- xen/arch/x86/cpu/vpmu_amd.c | 2 ++ xen/arch/x86/cpu/vpmu_intel.c | 2 ++ 2 files changed, 4 insertions(+)xen/arch/x86/cpu/vpmu_amd.c +2
-0@@ -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 );xen/arch/x86/cpu/vpmu_intel.c +2
-0@@ -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 );
Signature · 1 line
Company details: http://ts.fujitsu.com/imprint.html
Quoted 6 lines · Boris Ostrovsky
Otherwise we may hit assertion in
vpmu_initialise()if vcpu is offlined and then onlined again.For tidyness, set
priv_contextto NULL as well.Signed-off-by Boris Ostrovsky <[email protected]>
Release-acked-by Wei Liu <[email protected]>
Quoted 34 lines
--- xen/arch/x86/cpu/vpmu_amd.c | 2 ++ xen/arch/x86/cpu/vpmu_intel.c | 2 ++ 2 files changed, 4 insertions(+)xen/arch/x86/cpu/vpmu_amd.c +2
-0@@ -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 );xen/arch/x86/cpu/vpmu_intel.c +2
-0@@ -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 );Signature · 1 line
1.8.1.4