xen/arm: cope with modules outside of "visible" RAM
authorIan Campbell <ian.campbell@citrix.com>
Thu, 26 Sep 2013 11:35:38 +0000 (12:35 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 26 Sep 2013 15:21:36 +0000 (16:21 +0100)
This can happen if modules are in a bank which we can't cope with e.g. due to
being non-contiguous.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/arm/setup.c

index 82158978e296fd78b6e423e939f3abb716fa9d80..02200ff883651440cc504d6abebfa28a4cb6c0e2 100644 (file)
@@ -390,6 +390,12 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size)
             e = n = ram_end;
         }
 
+        /* Module in RAM which we cannot see here, due to not handling
+         * non-contiguous memory regions yet
+         */
+        if ( e > ram_end )
+            e = ram_end;
+
         /* Avoid the xenheap */
         if ( s < ((xenheap_mfn_start+xenheap_pages) << PAGE_SHIFT)
              && (xenheap_mfn_start << PAGE_SHIFT) < e )