]> xenbits.xensource.com Git - people/royger/xen.git/commit
xen/arm64: Split and move MMU-specific head.S to mmu/head.S
authorHenry Wang <Henry.Wang@arm.com>
Mon, 28 Aug 2023 01:32:14 +0000 (09:32 +0800)
committerStefano Stabellini <stefano.stabellini@amd.com>
Fri, 8 Sep 2023 22:07:30 +0000 (15:07 -0700)
commit6734327d76be38d20f280ecc96392e385fbc1d8b
tree8b1466c2d64cbd0b690139e7d377191960b65242
parentd52e9afe50686dfbf097af1067fd01633c217bd3
xen/arm64: Split and move MMU-specific head.S to mmu/head.S

The MMU specific code in head.S will not be used on MPU systems.
Instead of introducing more #ifdefs which will bring complexity
to the code, move MMU related code to mmu/head.S and keep common
code in head.S. Two notes while moving:
- As "fail" in original head.S is very simple and this name is too
  easy to be conflicted, duplicate it in mmu/head.S instead of
  exporting it.
- Use ENTRY() for enable_secondary_cpu_mm, enable_boot_cpu_mm and
  setup_fixmap as they will be used externally.

Also move the assembly macros shared by head.S and mmu/head.S to
macros.h.

Note that, only the first 4KB of Xen image will be mapped as
identity (PA == VA). At the moment, Xen guarantees this by having
everything that needs to be used in the identity mapping in
.text.header section of head.S, and the size will be checked by
_idmap_start and _idmap_end at link time if this fits in 4KB.
Since we are introducing a new head.S in this patch, although
we can add .text.header to the new file to guarantee all identity
map code still in the first 4KB. However, the order of these two
files on this 4KB depends on the build toolchains. Hence, introduce
a new section named .text.idmap in the region between _idmap_start
and _idmap_end. And in Xen linker script, we force the .text.idmap
contents to linked after .text.header. This will ensure code of
head.S always be at the top of Xen binary.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
Signed-off-by: Wei Chen <wei.chen@arm.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/arm64/Makefile
xen/arch/arm/arm64/head.S
xen/arch/arm/arm64/mmu/Makefile [new file with mode: 0644]
xen/arch/arm/arm64/mmu/head.S [new file with mode: 0644]
xen/arch/arm/include/asm/arm64/macros.h
xen/arch/arm/xen.lds.S