[PATCH] arm64: kasan: mte: move GCR_EL1 switch to task switch when KASAN disabled

Peter Collingbourne pcc at google.com
Tue Sep 14 14:54:22 PDT 2021


On Thu, Aug 26, 2021 at 8:07 PM Peter Collingbourne <pcc at google.com> wrote:
>
> It is not necessary to write to GCR_EL1 on every kernel entry and
> exit when HW tag-based KASAN is disabled because the kernel will not
> execute any IRG instructions in that mode. Since accessing GCR_EL1
> can be expensive on some microarchitectures, avoid doing so by moving
> the access to task switch when HW tag-based KASAN is disabled.

It was discovered that this patch broke booting on non-MTE hardware
when configured with CONFIG_ARM64_MTE=y. Fixed in v2.

Peter



More information about the linux-arm-kernel mailing list