From: "Erik Bosman" Subject: Re: [Patch] Allow bitmasks with the badpage bootoption Date: Wed, 5 Apr 2006 13:57:18 +0200 Message-ID: References: <49a267fe3eb03564486d6e7dbb21de83@cl.cam.ac.uk> <983b2c50588af9fa126c1db34bb59267@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_5949_31815417.1144238238976" Return-path: In-Reply-To: <983b2c50588af9fa126c1db34bb59267@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org ------=_Part_5949_31815417.1144238238976 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Erik Bosman ------=_Part_5949_31815417.1144238238976 Content-Type: text/x-patch; name=badpage-range.patch; charset=us-ascii Content-Transfer-Encoding: 7bit X-Attachment-Id: f_elnlrrno Content-Disposition: attachment; filename="badpage-range.patch" diff -ru xen-3.0.1-orig/xen/common/page_alloc.c xen-3.0.1-range/xen/common/page_alloc.c --- xen-3.0.1-orig/xen/common/page_alloc.c 2006-03-14 12:17:06.000000000 +0100 +++ xen-3.0.1-range/xen/common/page_alloc.c 2006-04-05 13:34:05.000000000 +0200 @@ -155,7 +155,7 @@ void init_boot_pages(physaddr_t ps, physaddr_t pe) { - unsigned long bad_pfn; + unsigned long bad_spfn, bad_epfn, i; char *p; ps = round_pgup(ps); @@ -169,18 +169,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); } } ------=_Part_5949_31815417.1144238238976 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ------=_Part_5949_31815417.1144238238976--