Skip to contentSkip to conversation

fix rounding issue in init_boot_pages

PATCH New Matt Chapman 1 participant 1 message May 18, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix rounding issue in init_boot_pages

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.)

Thanks,
Matt

===== page_alloc.c 1.66 vs edited =====

page_alloc.c renamed from xen/common/page_alloc.c +2 -0
@@ -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);
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel