]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86: Fix teardown of relocated vcpu_info structures.
authorKeir Fraser <keir.fraser@citrix.com>
Sun, 1 Jun 2008 08:29:24 +0000 (09:29 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Sun, 1 Jun 2008 08:29:24 +0000 (09:29 +0100)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen-unstable changeset:   17761:85fa199b4b7b
xen-unstable date:        Sun Jun 01 09:16:26 2008 +0100

xen/arch/x86/domain.c

index 8ac1e55485a8c75a72a0a805a666880bfb599319..c6014db5f263e77e4b77b0035ec0e1b24aa1dab4 100644 (file)
@@ -55,8 +55,6 @@ DEFINE_PER_CPU(struct vcpu *, curr_vcpu);
 DEFINE_PER_CPU(u64, efer);
 DEFINE_PER_CPU(unsigned long, cr4);
 
-static void unmap_vcpu_info(struct vcpu *v);
-
 static void paravirt_ctxt_switch_from(struct vcpu *v);
 static void paravirt_ctxt_switch_to(struct vcpu *v);
 
@@ -430,8 +428,6 @@ void vcpu_destroy(struct vcpu *v)
     if ( is_pv_32on64_vcpu(v) )
         release_compat_l4(v);
 
-    unmap_vcpu_info(v);
-
     if ( is_hvm_vcpu(v) )
         hvm_vcpu_destroy(v);
 }
@@ -1816,17 +1812,20 @@ int domain_relinquish_resources(struct domain *d)
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
-        /* Drop the in-use references to page-table bases. */
         for_each_vcpu ( d, v )
+        {
+            /* Drop the in-use references to page-table bases. */
             vcpu_destroy_pagetables(v);
 
-        /*
-         * Relinquish GDT mappings. No need for explicit unmapping of the LDT
-         * as it automatically gets squashed when the guest's mappings go away.
-         */
-        for_each_vcpu(d, v)
+            /*
+             * Relinquish GDT mappings. No need for explicit unmapping of the
+             * LDT as it automatically gets squashed with the guest mappings.
+             */
             destroy_gdt(v);
 
+            unmap_vcpu_info(v);
+        }
+
         d->arch.relmem = RELMEM_xen_l4;
         /* fallthrough */