From: Ian Campbell Subject: [PATCH] xc_save: use correct size when unmapping live p2m. Date: Mon, 29 Sep 2008 10:55:51 +0100 Message-ID: <1222682151.4317.5.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-AtuOS2CtKgsh+wsn6VSs" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --=-AtuOS2CtKgsh+wsn6VSs Content-Type: text/plain Content-Transfer-Encoding: 7bit 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 --=-AtuOS2CtKgsh+wsn6VSs Content-Disposition: attachment; filename=xc-save-munmap Content-Type: text/plain; name=xc-save-munmap; charset=UTF-8 Content-Transfer-Encoding: 7bit # HG changeset patch # User Ian Campbell # Date 1222680951 -3600 # Node ID 0565658208c54d11e6fedc84497a6ef1bb365ee8 # Parent 2e8ad0c35792d1961c17d37f073e85b863519a92 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 diff -r 2e8ad0c35792 -r 0565658208c5 tools/libxc/xc_domain_save.c --- a/tools/libxc/xc_domain_save.c Thu Sep 18 10:43:08 2008 +0100 +++ b/tools/libxc/xc_domain_save.c Mon Sep 29 10:35:51 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); @@ -1595,7 +1595,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)); --=-AtuOS2CtKgsh+wsn6VSs Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-AtuOS2CtKgsh+wsn6VSs--