[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: Check if the range is valid in init_domheap_pages



commit 45ffa79447954e68892322d985e72620d32ac16d
Author:     Julien Grall <julien.grall@xxxxxxxxxx>
AuthorDate: Wed Nov 13 13:37:50 2013 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Thu Nov 21 10:43:01 2013 +0000

    xen: Check if the range is valid in init_domheap_pages
    
    On ARM, when an initrd is given to xen by U-boot, it will reserve the memory
    in the device tree.
    In this case, when xen decides to free unused memory, dt_unreserved_regions
    will call init_domheap_pages with the start and the end of range equals. But
    the latter assumes that (start > end), if not Xen will hang because the
    number of pages is equals to (unsigned)-1.
    
    Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
    Acked-by: Ian Campbell <Ian.campbell@xxxxxxxxxx>
    CC: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/common/page_alloc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 4c17fbd..0701333 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1429,6 +1429,9 @@ void init_domheap_pages(paddr_t ps, paddr_t pe)
     smfn = round_pgup(ps) >> PAGE_SHIFT;
     emfn = round_pgdown(pe) >> PAGE_SHIFT;
 
+    if ( emfn <= smfn )
+        return;
+
     init_heap_pages(mfn_to_page(smfn), emfn - smfn);
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.