They might be in e.g. flash or something but more likely they could
be in a bank of RAM which we aren't handling or in RAM which the
bootloader hasn't told us about for some reason.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Cc: Fu Wei <fu.wei@linaro.org>
Cc: Roy Franz <roy.franz@linaro.org>
paddr_t s = mi->module[i].start;
paddr_t e = s + PAGE_ALIGN(mi->module[i].size);
- if ( mi->module[i].kind != BOOTMOD_XEN )
- dt_unreserved_regions(s, e, init_domheap_pages, 0);
+ if ( mi->module[i].kind == BOOTMOD_XEN )
+ continue;
+
+ if ( !mfn_valid(paddr_to_pfn(s)) || !mfn_valid(paddr_to_pfn(e)))
+ continue;
+
+ dt_unreserved_regions(s, e, init_domheap_pages, 0);
}
mi->nr_mods = 0;