Skip to content

Commit f19a2c6

Browse files
Christophe Leroy (CS GROUP)maddy-kerneldev
authored andcommitted
powerpc/futex: Use masked user access
Commit 861574d ("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
1 parent fd3def7 commit f19a2c6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

arch/powerpc/include/asm/futex.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval,
3333
{
3434
int oldval = 0, ret;
3535

36-
if (!user_access_begin(uaddr, sizeof(u32)))
37-
return -EFAULT;
36+
uaddr = masked_user_access_begin(uaddr);
3837

3938
switch (op) {
4039
case FUTEX_OP_SET:
@@ -69,8 +68,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
6968
int ret = 0;
7069
u32 prev;
7170

72-
if (!user_access_begin(uaddr, sizeof(u32)))
73-
return -EFAULT;
71+
uaddr = masked_user_access_begin(uaddr);
7472

7573
__asm__ __volatile__ (
7674
PPC_ATOMIC_ENTRY_BARRIER

0 commit comments

Comments
 (0)