[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Extend the 'badpage' boot option to parse inclusive



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID bb316b4df46f0dc436859de52ac68b4fd798f582
# Parent  02e8dd5e4c572dac62750ccd7e8dd93829a79e0c
Extend the 'badpage' boot option to parse inclusive
ranges of bad panges '<start_page>-<end_page>'.

Signed-off-by: Erik Bosman <ebosman@xxxxxxxxx>

diff -r 02e8dd5e4c57 -r bb316b4df46f xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Wed Apr  5 11:23:49 2006
+++ b/xen/common/page_alloc.c   Wed Apr  5 12:38:54 2006
@@ -170,7 +170,7 @@
 
 void init_boot_pages(paddr_t ps, paddr_t pe)
 {
-    unsigned long bad_pfn;
+    unsigned long bad_spfn, bad_epfn, i;
     char *p;
 
     ps = round_pgup(ps);
@@ -184,18 +184,31 @@
     p = opt_badpage;
     while ( *p != '\0' )
     {
-        bad_pfn = simple_strtoul(p, &p, 0);
+        bad_spfn = simple_strtoul(p, &p, 0);
+        bad_epfn = bad_spfn;
+
+        if ( *p == '-' )
+        {
+            p++;
+            bad_epfn = simple_strtoul(p, &p, 0);
+            if ( bad_epfn < bad_spfn )
+                bad_epfn = bad_spfn;
+        }
 
         if ( *p == ',' )
             p++;
         else if ( *p != '\0' )
             break;
 
-        if ( (bad_pfn < max_page) && !allocated_in_map(bad_pfn) )
-        {
-            printk("Marking page %lx as bad\n", bad_pfn);
-            map_alloc(bad_pfn, 1);
-        }
+        if ( bad_epfn == bad_spfn )
+            printk("Marking page %lx as bad\n", bad_spfn);
+        else
+            printk("Marking pages %lx through %lx as bad\n",
+                   bad_spfn, bad_epfn);
+
+        for ( i = bad_spfn; i <= bad_epfn; i++ )
+            if ( (i < max_page) && !allocated_in_map(i) )
+                map_alloc(i, 1);
     }
 }
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.