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-3.0.4-testing] [LIBXC] Fix iteration over GDT in sa

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.4-testing] [LIBXC] Fix iteration over GDT in save/restore code.
From: "Xen patchbot-3.0.4-testing" <patchbot-3.0.4-testing@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 03 Jan 2007 14:15:25 -0800
Delivery-date: Wed, 03 Jan 2007 14:15:27 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1166609193 0
# Node ID 5700d0a35f896c0a2d4eda36a41af95a9c496e49
# Parent  489f28021f26435b21ec8d21a1c408d0aebeaeb9
[LIBXC] Fix iteration over GDT in save/restore code.
Bug spotted by Tim Wood.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

Based on xen-unstable changeset 13092:1818b322ede953f4fcca2d3d1239ce5111a811c5
---
 tools/libxc/xc_linux_restore.c |    2 +-
 tools/libxc/xc_linux_save.c    |   17 ++++++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff -r 489f28021f26 -r 5700d0a35f89 tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Wed Dec 20 09:47:24 2006 +0000
+++ b/tools/libxc/xc_linux_restore.c    Wed Dec 20 10:06:33 2006 +0000
@@ -709,7 +709,7 @@ int xc_linux_restore(int xc_handle, int 
         goto out;
     }
 
-    for (i = 0; i < ctxt.gdt_ents; i += 512) {
+    for (i = 0; (512*i) < ctxt.gdt_ents; i++) {
         pfn = ctxt.gdt_frames[i];
         if ((pfn >= max_pfn) || (pfn_type[pfn] != XEN_DOMCTL_PFINFO_NOTAB)) {
             ERROR("GDT frame number is bad");
diff -r 489f28021f26 -r 5700d0a35f89 tools/libxc/xc_linux_save.c
--- a/tools/libxc/xc_linux_save.c       Wed Dec 20 09:47:24 2006 +0000
+++ b/tools/libxc/xc_linux_save.c       Wed Dec 20 10:06:33 2006 +0000
@@ -1052,7 +1052,7 @@ int xc_linux_save(int xc_handle, int io_
             DPRINTF("(of which %ld were fixups)\n", needed_to_fix  );
         }
 
-        if (last_iter && debug){
+        if (last_iter && debug) {
             int minusone = -1;
             memset(to_send, 0xff, BITMAP_SIZE);
             debug = 0;
@@ -1068,17 +1068,14 @@ int xc_linux_save(int xc_handle, int io_
             continue;
         }
 
-        if (last_iter) break;
+        if (last_iter)
+            break;
 
         if (live) {
-
-
-            if(
-                ((sent_this_iter > sent_last_iter) && RATE_IS_MAX()) ||
+            if (((sent_this_iter > sent_last_iter) && RATE_IS_MAX()) ||
                 (iter >= max_iters) ||
                 (sent_this_iter+skip_this_iter < 50) ||
-                (total_sent > max_pfn*max_factor) ) {
-
+                (total_sent > max_pfn*max_factor)) {
                 DPRINTF("Start last iteration\n");
                 last_iter = 1;
 
@@ -1106,8 +1103,6 @@ int xc_linux_save(int xc_handle, int io_
             print_stats(xc_handle, dom, sent_this_iter, &stats, 1);
 
         }
-
-
     } /* end of while 1 */
 
     DPRINTF("All memory is saved\n");
@@ -1159,7 +1154,7 @@ int xc_linux_save(int xc_handle, int io_
     }
 
     /* Canonicalise each GDT frame number. */
-    for ( i = 0; i < ctxt.gdt_ents; i += 512 ) {
+    for ( i = 0; (512*i) < ctxt.gdt_ents; i++ ) {
         if ( !translate_mfn_to_pfn(&ctxt.gdt_frames[i]) ) {
             ERROR("GDT frame is not in range of pseudophys map");
             goto out;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.4-testing] [LIBXC] Fix iteration over GDT in save/restore code., Xen patchbot-3.0.4-testing <=