diff options
| author | Christophe Leroy (CS GROUP) <chleroy@kernel.org> | 2026-03-10 12:59:58 +0300 |
|---|---|---|
| committer | Madhavan Srinivasan <maddy@linux.ibm.com> | 2026-04-01 06:51:06 +0300 |
| commit | 40a1b9d044c7dbbc2976f0432e32dc57d4896b00 (patch) | |
| tree | 4d728e574893875b9c1b098d19c2a557b95bee5c | |
| parent | f26ad12356a275ab303d5d3af4790ad94acc20d7 (diff) | |
| download | linux-40a1b9d044c7dbbc2976f0432e32dc57d4896b00.tar.xz | |
powerpc/futex: Use masked user access
Commit 861574d51bbd ("powerpc/uaccess: Implement masked user access")
provides optimised user access by avoiding the cost of access_ok().
Use masked user access in arch_futex_atomic_op_inuser()
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/e29f6a5c14e5938df68d94bfac6b2f762fb922aa.1773136636.git.chleroy@kernel.org
| -rw-r--r-- | arch/powerpc/include/asm/futex.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/include/asm/futex.h b/arch/powerpc/include/asm/futex.h index b3001f8b2c1e..8cf3b2e97e17 100644 --- a/arch/powerpc/include/asm/futex.h +++ b/arch/powerpc/include/asm/futex.h @@ -33,8 +33,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, { int oldval = 0, ret; - if (!user_access_begin(uaddr, sizeof(u32))) - return -EFAULT; + uaddr = masked_user_access_begin(uaddr); switch (op) { case FUTEX_OP_SET: @@ -69,8 +68,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, int ret = 0; u32 prev; - if (!user_access_begin(uaddr, sizeof(u32))) - return -EFAULT; + uaddr = masked_user_access_begin(uaddr); __asm__ __volatile__ ( PPC_ATOMIC_ENTRY_BARRIER |
