]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Split MMU-specific setup_mm() and related code out
authorHenry Wang <Henry.Wang@arm.com>
Thu, 16 Nov 2023 14:50:29 +0000 (22:50 +0800)
committerJulien Grall <jgrall@amazon.com>
Mon, 20 Nov 2023 19:07:45 +0000 (19:07 +0000)
commit672d67f339c09282ad7d33c8b846c8fa65c52ed0
treedede92be891a240b54fdfb07bc4d7a5a005c39ee
parentf661a20aa880255b6f5e6799d35cc92d9af5ea59
xen/arm: Split MMU-specific setup_mm() and related code out

setup_mm() is used for Xen to setup memory management subsystem,
such as boot allocator, direct-mapping, xenheap initialization,
frametable and static memory pages, at boot time.

We could inherit some components seamlessly for MPU support, such
as the setup of boot allocator, whilst we need to implement some
components differently for MPU, such as xenheap, etc. Also, there
are some components that is specific to MMU only, for example the
direct-mapping.

Therefore in this commit, we split the MMU-specific setup_mm() and
related code out. Since arm32 and arm64 have completely different
setup_mm() implementation, take the opportunity to split the
arch-specific setup_mm() to arch-specific files, so that we can
avoid #ifdef. Also, make init_pdx(), init_staticmem_pages(), and
populate_boot_allocator() public as these functions are now called
from two different units, and make setup_mm() public for future MPU
implementation.

With above code movement, mark setup_directmap_mappings() as static
because the only caller of this function is now in the same file
with it. Drop the original setup_directmap_mappings() declaration
and move the in-code comment on top of the declaration on top of
the function implementation.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/arm32/mmu/mm.c
xen/arch/arm/arm64/mmu/mm.c
xen/arch/arm/include/asm/mmu/mm.h
xen/arch/arm/include/asm/setup.h
xen/arch/arm/setup.c