OSDN Git Service

arm64: mte: Document that user PSTATE.TCO is ignored by kernel uaccess
authorCatalin Marinas <catalin.marinas@arm.com>
Wed, 28 Oct 2020 14:55:24 +0000 (14:55 +0000)
committerWill Deacon <will@kernel.org>
Wed, 28 Oct 2020 17:50:39 +0000 (17:50 +0000)
commitef5dd6a0c828b6fbd9d595e5772fcb51ff86697e
treea6ffc55d94c20666a7551b9b8a5132872ff39c4d
parent13150bc5416f45234c955e5bed91623d178c6117
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: df9d7a22dd21 ("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>
Documentation/arm64/memory-tagging-extension.rst