[TOOLS] Fix PAE save/restore/migrate: we must flush
authorkfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com>
Tue, 13 Jun 2006 16:30:30 +0000 (17:30 +0100)
committerkfraser@dhcp93.uk.xensource.com <kfraser@dhcp93.uk.xensource.com>
Tue, 13 Jun 2006 16:30:30 +0000 (17:30 +0100)
all pending 'mmu updates' before moving page directories
below 4GB.
Signed-off-by: Keir Fraser <keir@xensource.com>
tools/libxc/xc_linux_restore.c

index da365dffd7a88440b4f9745d313fb96a4f0fc5ea..88b60fe329ad0d0729fdfc2fc4bf549ff1bf8cb9 100644 (file)
@@ -456,6 +456,15 @@ int xc_linux_restore(int xc_handle, int io_fd,
         n+= j; /* crude stats */
     }
 
+    /*
+     * Ensure we flush all machphys updates before potential PAE-specific
+     * reallocations below.
+     */
+    if (xc_finish_mmu_updates(xc_handle, mmu)) {
+        ERR("Error doing finish_mmu_updates()");
+        goto out;
+    }
+
     DPRINTF("Received all pages (%d races)\n", nraces);
 
     if ((pt_levels == 3) && !pae_extended_cr3) {
@@ -550,15 +559,12 @@ int xc_linux_restore(int xc_handle, int io_fd,
             }
         }
 
+        if (xc_finish_mmu_updates(xc_handle, mmu)) {
+            ERR("Error doing finish_mmu_updates()");
+            goto out;
+        }
     }
 
-
-    if (xc_finish_mmu_updates(xc_handle, mmu)) {
-        ERR("Error doing finish_mmu_updates()");
-        goto out;
-    }
-
-
     /*
      * Pin page tables. Do this after writing to them as otherwise Xen
      * will barf when doing the type-checking.