Skip to content

Commit ef5dd6a

Browse files
ctmarinaswilldeacon
authored andcommitted
arm64: mte: Document that user PSTATE.TCO is ignored by kernel uaccess
On exception entry, the kernel explicitly resets the PSTATE.TCO (tag check override) so that any kernel memory accesses will be checked (the bit is restored on exception return). This has the side-effect that the uaccess routines will not honour the PSTATE.TCO that may have been set by the user prior to a syscall. There is no issue in practice since PSTATE.TCO is expected to be used only for brief periods in specific routines (e.g. garbage collection). To control the tag checking mode of the uaccess routines, the user will have to invoke a corresponding prctl() call. Document the kernel behaviour w.r.t. PSTATE.TCO accordingly. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Fixes: df9d7a2 ("arm64: mte: Add Memory Tagging Extension documentation") Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com> Cc: Will Deacon <will@kernel.org> Cc: Szabolcs Nagy <szabolcs.nagy@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 13150bc commit ef5dd6a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Documentation/arm64/memory-tagging-extension.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ applications.
102102
system call) are not checked if the user thread tag checking mode is
103103
``PR_MTE_TCF_NONE`` or ``PR_MTE_TCF_ASYNC``. If the tag checking mode is
104104
``PR_MTE_TCF_SYNC``, the kernel makes a best effort to check its user
105-
address accesses, however it cannot always guarantee it.
105+
address accesses, however it cannot always guarantee it. Kernel accesses
106+
to user addresses are always performed with an effective ``PSTATE.TCO``
107+
value of zero, regardless of the user configuration.
106108

107109
Excluding Tags in the ``IRG``, ``ADDG`` and ``SUBG`` instructions
108110
-----------------------------------------------------------------

0 commit comments

Comments
 (0)