From: Oleksandr Tyshchenko <
oleksandr_tyshchenko@xxxxxxxx>
At the moment, Xen on Arm64 expects the memory banks to be ordered.
Unfortunately, there may be a case when updated by firmware
device tree contains unordered banks. This means Xen will panic
when setting xenheap mappings for the subsequent bank with start
address being less than xenheap_mfn_start (start address of
the first bank).
As there is no clear requirement regarding ordering in the device
tree, update code to be able to deal with by sorting memory
banks. There is only one heap region on Arm32, so the sorting
is fine to be done in the common code.
Suggested-by: Julien Grall <
jgrall@xxxxxxxxxx>
Signed-off-by: Oleksandr Tyshchenko <
oleksandr_tyshchenko@xxxxxxxx>
Reviewed-by: Stefano Stabellini <
sstabellini@xxxxxxxxxx>