xen/arm32: mm: Consolidate the domheap mappings initialization
authorJulien Grall <jgrall@amazon.com>
Fri, 29 Jul 2022 21:48:16 +0000 (22:48 +0100)
committerJulien Grall <julien@xen.org>
Fri, 29 Jul 2022 22:03:22 +0000 (23:03 +0100)
commit04248b82f9621c511f3d5502ce74df7122ed157e
tree07e53eabd006d42433b665993a61546ee53fa397
parent6dc9a1fe982f52c709ed03df8fdc6d58c4d96826
xen/arm32: mm: Consolidate the domheap mappings initialization

At the moment, the domheap mappings initialization is done separately for
the boot CPU and secondary CPUs. The main difference is for the former
the pages are part of Xen binary whilst for the latter they are
dynamically allocated.

It would be good to have a single helper so it is easier to rework
on the domheap is initialized.

For CPU0, we still need to use pre-allocated pages because the
allocators may use domain_map_page(), so we need to have the domheap
area ready first. But we can still delay the initialization to setup_mm().

Introduce a new helper init_domheap_mappings() that will be called
from setup_mm() for the boot CPU and from init_secondary_pagetables()
for secondary CPUs.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Tested-by: Luca Fancellu <luca.fancellu@arm.com>
xen/arch/arm/include/asm/arm32/mm.h
xen/arch/arm/mm.c
xen/arch/arm/setup.c