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-testing] [TOOLS] Fix pagetable-pinning loop in

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0-testing] [TOOLS] Fix pagetable-pinning loop in xc_linux_restore.
From: Xen patchbot-3.0-testing <patchbot-3.0-testing@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 23 Jun 2006 14:03:58 +0000
Delivery-date: Fri, 23 Jun 2006 07:05:55 -0700
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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID cb1e561583ac112b7b62bbd4d5232bc590053de3
# Parent  c2a8f93d0dc89af2cc4dda7116c3955c3a0f197d
[TOOLS] Fix pagetable-pinning loop in xc_linux_restore.
Previously it would not pin last PFN in physmap even if it was
a pagetable page.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset:   10475:94e354294cca7ce0c4f1b7ae2ec5eb62ddac71ac
xen-unstable date:        Thu Jun 22 14:12:01 2006 +0100
---
 tools/libxc/xc_linux_restore.c |   66 ++++++++++++++++++++++-------------------
 1 files changed, 36 insertions(+), 30 deletions(-)

diff -r c2a8f93d0dc8 -r cb1e561583ac tools/libxc/xc_linux_restore.c
--- a/tools/libxc/xc_linux_restore.c    Tue Jun 20 18:29:46 2006 +0100
+++ b/tools/libxc/xc_linux_restore.c    Thu Jun 22 14:20:01 2006 +0100
@@ -545,42 +545,48 @@ int xc_linux_restore(int xc_handle, int 
     nr_pins = 0; 
     for (i = 0; i < max_pfn; i++) {
 
-        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
+        if ( (pfn_type[i] & LPINTAB) == 0 )
+            continue;
+
+        switch(pfn_type[i]) { 
+
+        case (L1TAB|LPINTAB): 
+            pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
+            break; 
+            
+        case (L2TAB|LPINTAB): 
+            pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
+            break; 
+            
+        case (L3TAB|LPINTAB): 
+            pin[nr_pins].cmd = MMUEXT_PIN_L3_TABLE;
+            break; 
+
+        case (L4TAB|LPINTAB):
+            pin[nr_pins].cmd = MMUEXT_PIN_L4_TABLE;
+            break; 
+            
+        default: 
+            continue; 
+        }
+
+        pin[nr_pins].arg1.mfn = p2m[i];
+        nr_pins++; 
+
+        /* Batch full? Then flush. */
+        if (nr_pins == MAX_PIN_BATCH) {
             if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
                 ERR("Failed to pin batch of %d page tables", nr_pins); 
                 goto out;
             } 
             nr_pins = 0;
         }
-
-        if ( (pfn_type[i] & LPINTAB) == 0 )
-            continue;
-
-        switch(pfn_type[i]) { 
-
-        case (L1TAB|LPINTAB): 
-            pin[nr_pins].cmd = MMUEXT_PIN_L1_TABLE;
-            break; 
-            
-        case (L2TAB|LPINTAB): 
-            pin[nr_pins].cmd = MMUEXT_PIN_L2_TABLE;
-            break; 
-            
-        case (L3TAB|LPINTAB): 
-            pin[nr_pins].cmd = MMUEXT_PIN_L3_TABLE;
-            break; 
-
-        case (L4TAB|LPINTAB):
-            pin[nr_pins].cmd = MMUEXT_PIN_L4_TABLE;
-            break; 
-            
-        default: 
-            continue; 
-        }
-
-        pin[nr_pins].arg1.mfn = p2m[i];
-        nr_pins++; 
-
+    }
+
+    /* Flush final partial batch. */
+    if ((nr_pins != 0) && (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0)) { 
+        ERR("Failed to pin batch of %d page tables", nr_pins); 
+        goto out;
     }
 
     DPRINTF("\b\b\b\b100%%\n");

_______________________________________________
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-testing] [TOOLS] Fix pagetable-pinning loop in xc_linux_restore., Xen patchbot-3 . 0-testing <=