]> xenbits.xensource.com Git - mini-os.git/commitdiff
mini-os: correct wrong calculation of alloc bitmap size
authorJuergen Gross <jgross@suse.com>
Thu, 18 Aug 2016 11:58:42 +0000 (13:58 +0200)
committerWei Liu <wei.liu2@citrix.com>
Wed, 24 Aug 2016 10:37:05 +0000 (11:37 +0100)
When remapping the page allocator's bitmap for the ballooning support
the calculation of the needed size is wrong. This doesn't really
matter today as nothing is allocated after that bitmap, but it should
be corrected nevertheless.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
balloon.c

index 8d2f1515082c59f57f00d5b00b3a8817fe44d2b9..8669edb6ad78c8e69aa31aeda402fa62a0526d64 100644 (file)
--- a/balloon.c
+++ b/balloon.c
@@ -52,7 +52,7 @@ void mm_alloc_bitmap_remap(void)
 {
     unsigned long i;
 
-    if ( mm_alloc_bitmap_size >= ((nr_max_pages + 1) >> (PAGE_SHIFT + 3)) )
+    if ( mm_alloc_bitmap_size >= ((nr_max_pages + 1) >> 3) )
         return;
 
     for ( i = 0; i < mm_alloc_bitmap_size; i += PAGE_SIZE )
@@ -62,7 +62,7 @@ void mm_alloc_bitmap_remap(void)
     }
 
     mm_alloc_bitmap = (unsigned long *)virt_kernel_area_end;
-    virt_kernel_area_end += round_pgup((nr_max_pages + 1) >> (PAGE_SHIFT + 3));
+    virt_kernel_area_end += round_pgup((nr_max_pages + 1) >> 3);
     ASSERT(virt_kernel_area_end <= VIRT_DEMAND_AREA);
 }