arm64: mte: Add in-kernel MTE helpers
Provide helper functions to manipulate allocation and pointer tags for kernel addresses. Low-level helper functions (mte_assign_*, written in assembly) operate tag values from the [0x0, 0xF] range. High-level helper functions (mte_get/set_*) use the [0xF0, 0xFF] range to preserve compatibility with normal kernel pointers that have 0xFF in their top byte. MTE_GRANULE_SIZE and related definitions are moved to mte-def.h header that doesn't have any dependencies and is safe to include into any low-level header. 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: I1b5230254f90dc21a913447cb17f07fea7944ece
Showing
- arch/arm64/include/asm/esr.h 1 addition, 0 deletionsarch/arm64/include/asm/esr.h
- arch/arm64/include/asm/mte-def.h 15 additions, 0 deletionsarch/arm64/include/asm/mte-def.h
- arch/arm64/include/asm/mte-kasan.h 56 additions, 0 deletionsarch/arm64/include/asm/mte-kasan.h
- arch/arm64/include/asm/mte.h 14 additions, 6 deletionsarch/arm64/include/asm/mte.h
- arch/arm64/kernel/mte.c 48 additions, 0 deletionsarch/arm64/kernel/mte.c
- arch/arm64/lib/mte.S 16 additions, 0 deletionsarch/arm64/lib/mte.S
arch/arm64/include/asm/mte-def.h
0 → 100644
arch/arm64/include/asm/mte-kasan.h
0 → 100644
Please register or sign in to comment