ia64/xen-unstable

changeset 9591:bb316b4df46f

Extend the 'badpage' boot option to parse inclusive
ranges of bad panges '<start_page>-<end_page>'.

Signed-off-by: Erik Bosman <ebosman@gmail.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Apr 05 13:38:54 2006 +0100 (2006-04-05)
parents 02e8dd5e4c57
children 08aede767c63
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Wed Apr 05 12:23:49 2006 +0100
     1.2 +++ b/xen/common/page_alloc.c	Wed Apr 05 13:38:54 2006 +0100
     1.3 @@ -170,7 +170,7 @@ paddr_t init_boot_allocator(paddr_t bitm
     1.4  
     1.5  void init_boot_pages(paddr_t ps, paddr_t pe)
     1.6  {
     1.7 -    unsigned long bad_pfn;
     1.8 +    unsigned long bad_spfn, bad_epfn, i;
     1.9      char *p;
    1.10  
    1.11      ps = round_pgup(ps);
    1.12 @@ -184,18 +184,31 @@ void init_boot_pages(paddr_t ps, paddr_t
    1.13      p = opt_badpage;
    1.14      while ( *p != '\0' )
    1.15      {
    1.16 -        bad_pfn = simple_strtoul(p, &p, 0);
    1.17 +        bad_spfn = simple_strtoul(p, &p, 0);
    1.18 +        bad_epfn = bad_spfn;
    1.19 +
    1.20 +        if ( *p == '-' )
    1.21 +        {
    1.22 +            p++;
    1.23 +            bad_epfn = simple_strtoul(p, &p, 0);
    1.24 +            if ( bad_epfn < bad_spfn )
    1.25 +                bad_epfn = bad_spfn;
    1.26 +        }
    1.27  
    1.28          if ( *p == ',' )
    1.29              p++;
    1.30          else if ( *p != '\0' )
    1.31              break;
    1.32  
    1.33 -        if ( (bad_pfn < max_page) && !allocated_in_map(bad_pfn) )
    1.34 -        {
    1.35 -            printk("Marking page %lx as bad\n", bad_pfn);
    1.36 -            map_alloc(bad_pfn, 1);
    1.37 -        }
    1.38 +        if ( bad_epfn == bad_spfn )
    1.39 +            printk("Marking page %lx as bad\n", bad_spfn);
    1.40 +        else
    1.41 +            printk("Marking pages %lx through %lx as bad\n",
    1.42 +                   bad_spfn, bad_epfn);
    1.43 +
    1.44 +        for ( i = bad_spfn; i <= bad_epfn; i++ )
    1.45 +            if ( (i < max_page) && !allocated_in_map(i) )
    1.46 +                map_alloc(i, 1);
    1.47      }
    1.48  }
    1.49