From 00dc8b3bf1c13ed371db56e770d9db8a9e333b54 Mon Sep 17 00:00:00 2001 From: "kfraser@dhcp93.uk.xensource.com" Date: Tue, 13 Jun 2006 17:30:30 +0100 Subject: [PATCH] [TOOLS] Fix PAE save/restore/migrate: we must flush all pending 'mmu updates' before moving page directories below 4GB. Signed-off-by: Keir Fraser --- tools/libxc/xc_linux_restore.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/libxc/xc_linux_restore.c b/tools/libxc/xc_linux_restore.c index da365dffd7..88b60fe329 100644 --- a/tools/libxc/xc_linux_restore.c +++ b/tools/libxc/xc_linux_restore.c @@ -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. -- 2.30.2