]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commit
xen/arm: Extract MMU-specific MM code
authorHenry Wang <Henry.Wang@arm.com>
Thu, 16 Nov 2023 14:50:28 +0000 (22:50 +0800)
committerJulien Grall <jgrall@amazon.com>
Mon, 20 Nov 2023 19:07:45 +0000 (19:07 +0000)
commitf661a20aa880255b6f5e6799d35cc92d9af5ea59
tree2ecc186d5115e449b172e0dc84916640790f6912
parentea59db96a41a80d923678a782842ffe269ab7ff5
xen/arm: Extract MMU-specific MM code

Currently, most of the code is in arm/mm.{c,h} and arm/arm64/mm.c
is MMU-specific. To make the MM code extendable, this commit extracts
the MMU-specific MM code.

Extract the boot CPU MM bringup code from arm/mm.c to mmu/setup.c.
While moving, mark pte_of_xenaddr() as __init to make clear that
this helper is only intended to be used during early boot.

Move arm/arm64/mm.c to arm/arm64/mmu/mm.c. Since the function
setup_directmap_mappings() has different implementations between
arm32 and arm64, move their arch-specific implementation to
arch-specific arm{32,64}/mmu/mm.c instead using #ifdef again.

For header files, move MMU-related function declarations in
asm/mm.h, declaration of global variable init_ttbr and the
declaration of dump_pt_walk() in asm/page.h to asm/mmu/mm.h

Also modify the build system (Makefiles in this case) to pick above
mentioned code changes.

Take the opportunity to fix the in-code comment coding styles when
possible, and drop the unnecessary #include headers in the original
arm/mm.c.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Acked-by: Julien Grall <jgrall@amazon.com>
13 files changed:
xen/arch/arm/arm32/Makefile
xen/arch/arm/arm32/mmu/Makefile [new file with mode: 0644]
xen/arch/arm/arm32/mmu/mm.c [new file with mode: 0644]
xen/arch/arm/arm64/Makefile
xen/arch/arm/arm64/mm.c [deleted file]
xen/arch/arm/arm64/mmu/Makefile
xen/arch/arm/arm64/mmu/mm.c [new file with mode: 0644]
xen/arch/arm/include/asm/mm.h
xen/arch/arm/include/asm/mmu/mm.h [new file with mode: 0644]
xen/arch/arm/include/asm/page.h
xen/arch/arm/mm.c
xen/arch/arm/mmu/Makefile
xen/arch/arm/mmu/setup.c [new file with mode: 0644]