]> xenbits.xensource.com Git - xen.git/commit
xen/arm: Stop relocating Xen
authorJulien Grall <julien.grall@arm.com>
Tue, 18 Dec 2018 13:07:39 +0000 (13:07 +0000)
committerStefano Stabellini <sstabellini@kernel.org>
Tue, 18 Dec 2018 22:45:00 +0000 (14:45 -0800)
commitf60658c6ae47e74792e6cc48ea2effac8bb52826
tree52e4b898feefa308360032f3fc3501bf60d017a9
parent2148a125b73bf6d0e777ad37840690a524eb8a44
xen/arm: Stop relocating Xen

At the moment, Xen is relocated towards the end of the memory. While
this has the advantage to free space in low memory, the code is not
compliant with the break-before-make because it requires to switch
between two sets of page-table. This is not entirely trivial to fix as
it would require us to go through an identity mapping and disabling MMU.

Furthermore, it looks like that some platform (such as the Hikey960)
may not be able to bring-up secondary CPUs if the entry is too high.

While Xen should be quite tiny (< 2MB), the current algorithm to
allocate Dom0 memory will allocate memory chunks of at least 128MB.
Those memory chunks will always be 128MB. This means that depending on
where the modules are loaded, an extra 128MB may disappear.

As there are up to 4 modules (initramfs, XSM, kernel, DTB) loaded in
low memory. The problem is not entirely new as you could already waste
512MB of low-memory. The right solution would be to fix the allocation
algorithm. But this is independent from this patch.

For user in control of the memory (such as in U-boot), all modules
should be loaded as much as possible together or outside low-memory (i.e
above 4GB). For other users (i.e Grub/UEFI), I believe the bootloader is
already keeping everything together.

Based on the above, it would be fine to stop relocating Xen. This has
the advantage to simplify the code and should speed-up the boot as
relocation is not necessary anymore.

Note that the break-before-make issue is not fixed by this patch.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reported-by: Matthew Daley <mattd@bugfuzz.com>
Tested-by: Matthew Daley <mattd@bugfuzz.com>
Tested-by: Andrii Anisov <andrii_anisov@epam.com>
Reviewed-by: Andrii Anisov <andrii_anisov@epam.com>
Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm32/head.S
xen/arch/arm/arm64/head.S
xen/arch/arm/mm.c
xen/arch/arm/setup.c
xen/include/asm-arm/mm.h