From: Matt Chapman Subject: [PATCH] fix rounding issue in init_boot_pages Date: Wed, 18 May 2005 15:54:36 -0600 Message-ID: <20050518215436.GA29590@kirby.fc.hp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="BOKacYhQ+x31HxR3" Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, The following patch fixes an issue in init_boot_pages that we hit on certain ia64 machines. If the supplied range lies within a single page, pe - ps becomes negative, because pe is rounded downwards and ps upwards. (One alternative might be to mandate that callers of init_boot_pages pass page-aligned addresses, but in that case the rounding done in this function is redundant.) Signed-off-by: Matthew Chapman Thanks, Matt --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="page_alloc.diff" ===== page_alloc.c 1.66 vs edited ===== --- 1.66/xen/common/page_alloc.c Tue May 10 16:28:45 2005 +++ edited/page_alloc.c Wed May 18 15:47:46 2005 @@ -156,6 +156,8 @@ ps = round_pgup(ps); pe = round_pgdown(pe); + if (pe <= ps) /* no full pages in range */ + return; map_free(ps >> PAGE_SHIFT, (pe - ps) >> PAGE_SHIFT); --BOKacYhQ+x31HxR3 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 --BOKacYhQ+x31HxR3--