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

[Xen-devel] [PATCH] xen/arm: setup_xenheap_mappings: BUG when alloc_boot_pages

On ARM64, bootmem is initialized after setup_xenheap_mappings,
so we should not call alloc_boot_pages in setup_xenheap_mappings.

We could not simply move setup_xenheap_mappings after init_boot_pages,
because in bootmem_region_add, when bootmem_region_list is NULL,
it will assign the first virtual address of the first bootmem region
to bootmem_region_list. If the bootmem is not mapped, it will trigger
data abort when writting to the bootmem_region_list[] area.

Currently we did not met issue, because FIRST_SIZE is 1GB on ARM64,
and xenheap_first_first table could hold up to 512GB virtual memory
region. we do not have SoC support such large DRAM now, but we might
have in future.

Add BUG() to let people be aware of this issue.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
 xen/arch/arm/mm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index 01ae2cccc0..dcc72ef199 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -850,8 +850,14 @@ void __init setup_xenheap_mappings(unsigned long base_mfn,
-            mfn_t first_mfn = alloc_boot_pages(1, 1);
+            mfn_t first_mfn;
+           /*
+            * TODO: bootmem not ready, need init_boot_pages before alloc
+            * boot pages.
+            */
+            BUG();
+            first_mfn = alloc_boot_pages(1, 1);
             pte = mfn_to_xen_entry(first_mfn, MT_NORMAL);
             pte.pt.table = 1;

Xen-devel mailing list



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