x86/HVM: Fix teardown ordering in hvm_vcpu_destroy()
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Tue, 10 Jan 2017 14:03:02 +0000 (08:03 -0600)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 10 Jan 2017 17:25:09 +0000 (17:25 +0000)
The order of destroy function calls in hvm_vcpu_destroy() should be
the reverse of init calls in hvm_vcpu_initialise().

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
[ Fix up tasklet_kill() position ]
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c

index 4c0f5619476cf19ac113f3e314f1d091ca7fb17e..9f74334f55cdde04f3c2ea51a84a6bb5df802505 100644 (file)
@@ -1626,12 +1626,12 @@ void hvm_vcpu_destroy(struct vcpu *v)
     free_compat_arg_xlat(v);
 
     tasklet_kill(&v->arch.hvm_vcpu.assert_evtchn_irq_tasklet);
-    hvm_vcpu_cacheattr_destroy(v);
+    hvm_funcs.vcpu_destroy(v);
 
     if ( is_hvm_vcpu(v) )
         vlapic_destroy(v);
 
-    hvm_funcs.vcpu_destroy(v);
+    hvm_vcpu_cacheattr_destroy(v);
 }
 
 void hvm_vcpu_down(struct vcpu *v)