From: Kai Huang Subject: [v3 08/10] vmx: disable PML in vmx_vcpu_destroy Date: Fri, 24 Apr 2015 16:19:36 +0800 Message-ID: <1429863578-16741-9-git-send-email-kai.huang@linux.intel.com> References: <1429863578-16741-1-git-send-email-kai.huang@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1429863578-16741-1-git-send-email-kai.huang@linux.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: andrew.cooper3@citrix.com, tim@xen.org, jbeulich@suse.com, kevin.tian@intel.com, xen-devel@lists.xen.org Cc: Kai Huang List-Id: xen-devel@lists.xenproject.org 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 --- xen/arch/x86/hvm/vmx/vmx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index e5471b8..e189424 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -153,6 +153,14 @@ 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 '), 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. + */ + vmx_vcpu_disable_pml(v); vmx_destroy_vmcs(v); vpmu_destroy(v); passive_domain_destroy(v); -- 2.1.0