xen/arm32: head: Move assembly switch to the runtime PT in secondary CPUs path
authorJulien Grall <julien.grall@arm.com>
Sat, 20 Apr 2019 17:18:01 +0000 (18:18 +0100)
committerJulien Grall <julien.grall@arm.com>
Sat, 7 Sep 2019 11:10:55 +0000 (12:10 +0100)
commit507c6902eb86da74ad7448ce7aaca3e5fb1a6c40
tree926727474f29e05a17210d4f459dc153c412e805
parentd14d218a4bcc608ea24e9dcd14aeb88b958f9b16
xen/arm32: head: Move assembly switch to the runtime PT in secondary CPUs path

The assembly switch to the runtime PT is only necessary for the
secondary CPUs. So move the code in the secondary CPUs path.

While this is definitely not compliant with the Arm Arm as we are
switching between two differents set of page-tables without turning off
the MMU. Turning off the MMU is impossible here as the ID map may clash
with other mappings in the runtime page-tables. This will require more
rework to avoid the problem. So for now add a TODO in the code.

Finally, the code is currently assume that r5 will be properly set to 0
before hand. This is done by create_page_tables() which is called quite
early in the boot process. There are a risk this may be oversight in the
future and therefore breaking secondary CPUs boot. Instead, set r5 to 0
just before using it.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/arm32/head.S