]> xenbits.xensource.com Git - xen.git/commit
xen/arm: bootfdt: Always sort memory banks
authorOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Mon, 5 Jul 2021 17:48:51 +0000 (20:48 +0300)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 16 Jul 2021 20:11:51 +0000 (13:11 -0700)
commit49299c4813b7847d29df07bf790f5489060f2a9c
treec745aab979c80c8b5c3c2a845d12f05847e4d371
parentb46af13fa1241ed5d443315313c2f1fd081c0813
xen/arm: bootfdt: Always sort memory banks

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@amazon.com>
Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit 4473f3601098a2c3cf5ab89d5a29504772985e3a)
xen/arch/arm/bootfdt.c