arm64: mte: Switch GCR_EL1 in kernel entry and exit
When MTE is present, the GCR_EL1 register contains the tags mask that allows to exclude tags from the random generation via the IRG instruction. With the introduction of the new Tag-Based KASAN API that provides a mechanism to reserve tags for special reasons, the MTE implementation has to make sure that the GCR_EL1 setting for the kernel does not affect the userspace processes and viceversa. Save and restore the kernel/user mask in GCR_EL1 in kernel entry and exit. Signed-off-by:Vincenzo Frascino <vincenzo.frascino@arm.com> Co-developed-by:
Andrey Konovalov <andreyknvl@google.com> Signed-off-by:
Andrey Konovalov <andreyknvl@google.com> Reviewed-by:
Catalin Marinas <catalin.marinas@arm.com> --- Change-Id: I0081cba5ace27a9111bebb239075c9a466af4c84
Showing
- arch/arm64/include/asm/mte-def.h 0 additions, 1 deletionarch/arm64/include/asm/mte-def.h
- arch/arm64/include/asm/mte-kasan.h 5 additions, 0 deletionsarch/arm64/include/asm/mte-kasan.h
- arch/arm64/include/asm/mte.h 2 additions, 0 deletionsarch/arm64/include/asm/mte.h
- arch/arm64/kernel/asm-offsets.c 3 additions, 0 deletionsarch/arm64/kernel/asm-offsets.c
- arch/arm64/kernel/entry.S 41 additions, 0 deletionsarch/arm64/kernel/entry.S
- arch/arm64/kernel/mte.c 28 additions, 3 deletionsarch/arm64/kernel/mte.c
Please register or sign in to comment