From: Kai Huang Date: Mon, 4 May 2015 10:17:43 +0000 (+0200) Subject: vmx: disable PML in vmx_vcpu_destroy X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3353 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e18d4274772e52ac81fda1acb246d11ef666e5fe;p=xen.git vmx: disable PML in vmx_vcpu_destroy 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 Acked-by: Tim Deegan Acked-by: Kevin Tian --- diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index d225230278..74f563f151 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -152,6 +152,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);