It's possible domain still remains in log-dirty mode when it is about to be destroyed, in which case we should manually disable PML for it.
Signed-off-by: Kai Huang <kai.hu...@linux.intel.com> --- xen/arch/x86/hvm/vmx/vmx.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index fce3aa2..75ac44b 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -153,6 +153,15 @@ static int vmx_vcpu_initialise(struct vcpu *v) static void vmx_vcpu_destroy(struct vcpu *v) { + /* + * There are cases that domain still remains in log-dirty mode when it is + * about to be destroyed (ex, user types 'xl destroy <dom>'), in which case + * we should disable PML manually here. Note that vmx_vcpu_destroy is called + * prior to vmx_domain_destroy so we need to disable PML for each vcpu + * separately here. + */ + if ( vmx_vcpu_pml_enabled(v) ) + vmx_vcpu_disable_pml(v); vmx_destroy_vmcs(v); vpmu_destroy(v); passive_domain_destroy(v); -- 2.1.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel