Skip to content
Commit b3aad324 authored by Andrey Konovalov's avatar Andrey Konovalov Committed by Alistair Delva
Browse files

ANDROID: gki_defconfig: enable CONFIG_KASAN_HW_TAGS



Enable in-kernel MTE (Memory Tagging Extension) support via
CONFIG_KASAN_HW_TAGS=y. With this change in-kernel MTE will be
auto-enabled during boot on hardware that supports MTE.

Currently, in-kernel MTE is only supported for slab and page_alloc
allocations. Future changes might include support for vmalloc, stack,
and globals.

By default:

- MTE works in synchronous mode, which means that tag faults are be
  reported at the point of occurence.
- When a tag fault is detected, a report is printed into the kernel log.
  Only the first tag fault gets reported. No panic occurs unless either
  kasan.fault=panic or panic_on_warn is set.
- A report contains the accessed address and a stack trace. There are no
  alloc/free stack traces for the accessed page or slab object
  (as specified via CONFIG_CMDLINE).

These defaults can be overridden via command line parameters, see
Documentation/dev-tools/kasan.rst for details.

Using kasan=off command line parameter will turn in-kernel MTE off.

A performance impact of ~10% is expected, but there is no MTE-enabled
hardware yet to run benchmarks. A future change of integrating in-kernel
MTE with init_on_alloc/free might significantly bring down the perfomance
impact.

There is no performance impact when in-kernel MTE is disabled via command
line or when hardware without MTE support (pre-ARMv8.5) is in use. There
is still a side-effect of TTBR1 TBI (Top Byte Ignore) getting enabled.

Signed-off-by: default avatarAndrey Konovalov <andreyknvl@google.com>
Bug: 172318110
Change-Id: I3d7fe6d41f916553b0bcad6402d4e373a7cd75cd
parent dd3f538b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment