arm64: mte: avoid TFSRE0_EL1 related operations unless in async mode
authorPeter Collingbourne <pcc@google.com>
Fri, 9 Jul 2021 02:35:32 +0000 (19:35 -0700)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 27 Jul 2021 17:12:18 +0000 (18:12 +0100)
commit42b6b10a54f0bf00397511fc6d5b8a296b405563
treea191e4a0b12d002bf08c2a061dcfa9b4cb55a4a0
parentff1176468d368232b684f75e82563369208bc371
arm64: mte: avoid TFSRE0_EL1 related operations unless in async mode

There is no reason to touch TFSRE0_EL1 nor issue a DSB unless our task
is in asynchronous mode. Since these operations (especially the DSB) may
be expensive on certain microarchitectures, only perform them if
necessary.

Furthermore, stop clearing TFSRE0_EL1 on entry because it will be
cleared on exit and it is not necessary to have any particular value in
TFSRE0_EL1 between entry and exit.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Link: https://linux-review.googlesource.com/id/Ib353a63e3d0abc2b0b008e96aa2d9692cfc1b815
Link: https://lore.kernel.org/r/20210709023532.2133673-1-pcc@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/entry.S