~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/arm64/mte/mte_def.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /* Copyright (C) 2020 ARM Limited */
  3 
  4 /*
  5  * Below definitions may be found in kernel headers, However, they are
  6  * redefined here to decouple the MTE selftests compilations from them.
  7  */
  8 #ifndef SEGV_MTEAERR
  9 #define SEGV_MTEAERR    8
 10 #endif
 11 #ifndef SEGV_MTESERR
 12 #define SEGV_MTESERR    9
 13 #endif
 14 #ifndef PROT_MTE
 15 #define PROT_MTE         0x20
 16 #endif
 17 #ifndef HWCAP2_MTE
 18 #define HWCAP2_MTE      (1 << 18)
 19 #endif
 20 
 21 #ifndef PR_MTE_TCF_SHIFT
 22 #define PR_MTE_TCF_SHIFT        1
 23 #endif
 24 #ifndef PR_MTE_TCF_NONE
 25 #define PR_MTE_TCF_NONE         (0UL << PR_MTE_TCF_SHIFT)
 26 #endif
 27 #ifndef PR_MTE_TCF_SYNC
 28 #define PR_MTE_TCF_SYNC         (1UL << PR_MTE_TCF_SHIFT)
 29 #endif
 30 #ifndef PR_MTE_TCF_ASYNC
 31 #define PR_MTE_TCF_ASYNC        (2UL << PR_MTE_TCF_SHIFT)
 32 #endif
 33 #ifndef PR_MTE_TAG_SHIFT
 34 #define PR_MTE_TAG_SHIFT        3
 35 #endif
 36 
 37 /* MTE Hardware feature definitions below. */
 38 #define MT_TAG_SHIFT            56
 39 #define MT_TAG_MASK             0xFUL
 40 #define MT_FREE_TAG             0x0UL
 41 #define MT_GRANULE_SIZE         16
 42 #define MT_TAG_COUNT            16
 43 #define MT_INCLUDE_TAG_MASK     0xFFFF
 44 #define MT_EXCLUDE_TAG_MASK     0x0
 45 
 46 #define MT_ALIGN_GRANULE        (MT_GRANULE_SIZE - 1)
 47 #define MT_CLEAR_TAG(x)         ((x) & ~(MT_TAG_MASK << MT_TAG_SHIFT))
 48 #define MT_SET_TAG(x, y)        ((x) | (y << MT_TAG_SHIFT))
 49 #define MT_FETCH_TAG(x)         ((x >> MT_TAG_SHIFT) & (MT_TAG_MASK))
 50 #define MT_ALIGN_UP(x)          ((x + MT_ALIGN_GRANULE) & ~(MT_ALIGN_GRANULE))
 51 
 52 #define MT_PSTATE_TCO_SHIFT     25
 53 #define MT_PSTATE_TCO_MASK      ~(0x1 << MT_PSTATE_TCO_SHIFT)
 54 #define MT_PSTATE_TCO_EN        1
 55 #define MT_PSTATE_TCO_DIS       0
 56 
 57 #define MT_EXCLUDE_TAG(x)               (1 << (x))
 58 #define MT_INCLUDE_VALID_TAG(x)         (MT_INCLUDE_TAG_MASK ^ MT_EXCLUDE_TAG(x))
 59 #define MT_INCLUDE_VALID_TAGS(x)        (MT_INCLUDE_TAG_MASK ^ (x))
 60 #define MTE_ALLOW_NON_ZERO_TAG          MT_INCLUDE_VALID_TAG(0)
 61 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php