# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1222682429 -3600
# Node ID ccf0205255e15632b2eadde02795fbe4ab87c6c5
# Parent 2e7f5c177495fd8dc21c6af1e20df9a9c2d28972
xc_save: use correct size when unmapping live p2m.
Otherwise we unmap a larger region than was mapped when saving 32 bit
guest from 64 bit tools, leading to badness.
The equivalent change was made to the restore code in
18329:ca7dd77d5365
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
tools/libxc/xc_domain_save.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff -r 2e7f5c177495 -r ccf0205255e1 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c Mon Sep 29 09:43:05 2008 +0100
+++ b/tools/libxc/xc_domain_save.c Mon Sep 29 11:00:29 2008 +0100
@@ -727,7 +727,7 @@ static xen_pfn_t *map_and_save_p2m_table
out:
if ( !success && p2m )
- munmap(p2m, ROUNDUP(p2m_size * sizeof(xen_pfn_t), PAGE_SHIFT));
+ munmap(p2m, P2M_FLL_ENTRIES * PAGE_SIZE);
if ( live_p2m_frame_list_list )
munmap(live_p2m_frame_list_list, PAGE_SIZE);
@@ -1608,7 +1608,7 @@ int xc_domain_save(int xc_handle, int io
munmap(live_shinfo, PAGE_SIZE);
if ( live_p2m )
- munmap(live_p2m, ROUNDUP(p2m_size * sizeof(xen_pfn_t), PAGE_SHIFT));
+ munmap(live_p2m, P2M_FLL_ENTRIES * PAGE_SIZE);
if ( live_m2p )
munmap(live_m2p, M2P_SIZE(max_mfn));
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|