Commit b22d7c4c authored by Peter Collingbourne's avatar Peter Collingbourne
Browse files

FROMGIT: arm64: mte: Make mte_check_tfsr_*() conditional on KASAN instead of MTE

The check in mte_check_tfsr_el1() is only necessary if HW tag
based KASAN is enabled. However, we were also executing the check
if MTE is enabled and KASAN is enabled at build time but disabled
at runtime. This turned out to cause a measurable increase in
power consumption on a specific microarchitecture after enabling
MTE. Moreover, on the same system, an increase in invalid syscall
latency (as measured by [1]) of around 20-30% (depending on the
cluster) was observed after enabling MTE; this almost entirely goes
away after removing this check. Therefore, make the check conditional
on whether KASAN is enabled rather than on whether MTE is enabled.

[1] https://lore.kernel.org/all/CAMn1gO4MwRV8bmFJ_SeY5tsYNPn2ZP56LjAhafygjFaKuu5ouw@mail.gmail.com/

Bug: 331979504
(cherry picked from commit 26ca4423
 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git

 for-next/mte)
Signed-off-by: default avatarPeter Collingbourne <pcc@google.com>
Change-Id: I22d98d1483dd400a95595946552b769a5a1ad7bd
Link: https://linux-review.googlesource.com/id/I22d98d1483dd400a95595946552b769a5a1ad7bd


Reviewed-by: default avatarAlexandru Elisei <alexandru.elisei@arm.com>
Link: https://lore.kernel.org/r/20240528225131.3577704-1-pcc@google.com


Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 1331956f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment