WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.0-testing] libxc: fix incorrect scanning of pfn a

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] libxc: fix incorrect scanning of pfn array in pagebuf during migration
From: Xen patchbot-4.0-testing <patchbot@xxxxxxx>
Date: Sun, 20 Mar 2011 03:35:10 +0000
Delivery-date: Sat, 19 Mar 2011 20:35:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Shriram Rajagopalan <rshriram@xxxxxxxxx>
# Date 1300121888 0
# Node ID b024d5ecc1943c0d74bfc04cb440ea96159e429b
# Parent  f637d2ec63b354300deb13a7daff895bef64d4f9
libxc: fix incorrect scanning of pfn array in pagebuf during migration

xc_domain_restore.c:apply_batch function makes two passes over the
pfn_types array in pagebuf to allocate the needed MFNs. The curbatch
parameter to this function specifies the array offset in pfn_types,
from where the current scan should begin. But this variable is not
taken into account (index always starts at 0) during the two
passes. While this [bug] does not manifest itsef during save/restore
or live migration, under Remus, xc_domain_restore fails due to corrupt
guest page tables.

(This appears to have been broken by 21588:6c3d8aec202d which reverted
two changesets from before Remus support was added and hence
reintroduced some none-Remus compatible bits.)

Signed-off-by: Shriram Rajagopalan <rshriram@xxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
xen-unstable changeset:   22967:5bc39222773d
xen-unstable date:        Thu Mar 03 16:55:27 2011 +0000
---


diff -r f637d2ec63b3 -r b024d5ecc194 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c   Sat Mar 12 13:28:05 2011 +0000
+++ b/tools/libxc/xc_domain_restore.c   Mon Mar 14 16:58:08 2011 +0000
@@ -825,8 +825,8 @@
     for ( i = 0; i < j; i++ )
     {
         unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
+        pfn      = pagebuf->pfn_types[i + curbatch] & 
~XEN_DOMCTL_PFINFO_LTAB_MASK;
+        pagetype = pagebuf->pfn_types[i + curbatch] &  
XEN_DOMCTL_PFINFO_LTAB_MASK;
 
         if ( (pagetype != XEN_DOMCTL_PFINFO_XTAB) && 
              (ctx->p2m[pfn] == INVALID_P2M_ENTRY) )
@@ -852,8 +852,8 @@
     for ( i = 0; i < j; i++ )
     {
         unsigned long pfn, pagetype;
-        pfn      = pagebuf->pfn_types[i] & ~XEN_DOMCTL_PFINFO_LTAB_MASK;
-        pagetype = pagebuf->pfn_types[i] &  XEN_DOMCTL_PFINFO_LTAB_MASK;
+        pfn      = pagebuf->pfn_types[i + curbatch] & 
~XEN_DOMCTL_PFINFO_LTAB_MASK;
+        pagetype = pagebuf->pfn_types[i + curbatch] &  
XEN_DOMCTL_PFINFO_LTAB_MASK;
 
         if ( pagetype == XEN_DOMCTL_PFINFO_XTAB )
             region_mfn[i] = ~0UL; /* map will fail but we don't care */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] libxc: fix incorrect scanning of pfn array in pagebuf during migration, Xen patchbot-4 . 0-testing <=