]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
arm64: futex: Support futex with FEAT_LSUI
authorYeoreum Yun <yeoreum.yun@arm.com>
Sat, 14 Mar 2026 17:51:30 +0000 (17:51 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 27 Mar 2026 12:52:04 +0000 (12:52 +0000)
commit44adf2bf40efe56c68c1563779ab2047eb0a57ea
treebc6699ee5864a3daf0ca6dc588f785d6f35ba8cd
parenteaa3babcceaaf191228d6ea897f677ed7549d0e2
arm64: futex: Support futex with FEAT_LSUI

Current futex atomic operations are implemented using LL/SC instructions
while temporarily clearing PSTATE.PAN and setting PSTATE.TCO (if
KASAN_HW_TAGS is enabled). With Armv9.6, FEAT_LSUI provides atomic
instructions for user memory access in the kernel without the need for
PSTATE bits toggling.

Use the FEAT_LSUI instructions to implement the futex atomic operations.
Note that some futex operations do not have a matching LSUI instruction,
(eor or word-sized cmpxchg). For such cases, use cas{al}t to implement
the operation.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
[catalin.marinas@arm.com: add comment on -EAGAIN in __lsui_futex_cmpxchg()]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/include/asm/futex.h
arch/arm64/include/asm/lsui.h [new file with mode: 0644]