arch: arm64: invalidate TLBs after ptables swap

This prevent the new thread to attempt accessing cached ptable entries
which are no longer valid.

Signed-off-by: Manuel Argüelles <manuel.arguelles@coredumplabs.com>
This commit is contained in:
Manuel Argüelles 2021-08-11 15:45:34 +07:00 committed by Christopher Friedt
commit 9ff6282089

View file

@ -24,15 +24,15 @@ SECTION_FUNC(TEXT, z_arm64_set_ttbr0)
msr sctlr_el1, x1
isb
/* Switch the TTBR0 */
msr ttbr0_el1, x0
isb
/* Invalidate the TLBs */
tlbi vmalle1
dsb sy
isb
/* Switch the TTBR0 */
msr ttbr0_el1, x0
isb
/* Restore the saved SCTLR_EL1 */
msr sctlr_el1, x2
isb