diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-04 14:52:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-04 14:52:29 -0400 |
commit | 5f82e71a001d14824a7728ad9e49f6aea420f161 (patch) | |
tree | bf5dfa7cf0840ec834899ae925913973bd1e65d1 /arch/alpha | |
parent | 6c51e67b64d169419fb13318035bb442f9176612 (diff) | |
parent | edc2988c548db05e33b921fed15821010bc74895 (diff) |
Merge branch 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking updates from Ingo Molnar:
- Add 'cross-release' support to lockdep, which allows APIs like
completions, where it's not the 'owner' who releases the lock, to be
tracked. It's all activated automatically under
CONFIG_PROVE_LOCKING=y.
- Clean up (restructure) the x86 atomics op implementation to be more
readable, in preparation of KASAN annotations. (Dmitry Vyukov)
- Fix static keys (Paolo Bonzini)
- Add killable versions of down_read() et al (Kirill Tkhai)
- Rework and fix jump_label locking (Marc Zyngier, Paolo Bonzini)
- Rework (and fix) tlb_flush_pending() barriers (Peter Zijlstra)
- Remove smp_mb__before_spinlock() and convert its usages, introduce
smp_mb__after_spinlock() (Peter Zijlstra)
* 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (56 commits)
locking/lockdep/selftests: Fix mixed read-write ABBA tests
sched/completion: Avoid unnecessary stack allocation for COMPLETION_INITIALIZER_ONSTACK()
acpi/nfit: Fix COMPLETION_INITIALIZER_ONSTACK() abuse
locking/pvqspinlock: Relax cmpxchg's to improve performance on some architectures
smp: Avoid using two cache lines for struct call_single_data
locking/lockdep: Untangle xhlock history save/restore from task independence
locking/refcounts, x86/asm: Disable CONFIG_ARCH_HAS_REFCOUNT for the time being
futex: Remove duplicated code and fix undefined behaviour
Documentation/locking/atomic: Finish the document...
locking/lockdep: Fix workqueue crossrelease annotation
workqueue/lockdep: 'Fix' flush_work() annotation
locking/lockdep/selftests: Add mixed read-write ABBA tests
mm, locking/barriers: Clarify tlb_flush_pending() barriers
locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS truly non-interactive
locking/lockdep: Explicitly initialize wq_barrier::done::map
locking/lockdep: Rename CONFIG_LOCKDEP_COMPLETE to CONFIG_LOCKDEP_COMPLETIONS
locking/lockdep: Reword title of LOCKDEP_CROSSRELEASE config
locking/lockdep: Make CONFIG_LOCKDEP_CROSSRELEASE part of CONFIG_PROVE_LOCKING
locking/refcounts, x86/asm: Implement fast refcount overflow protection
locking/lockdep: Fix the rollback and overwrite detection logic in crossrelease
...
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/include/asm/futex.h | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/arch/alpha/include/asm/futex.h b/arch/alpha/include/asm/futex.h index fb01dfb760c2..05a70edd57b6 100644 --- a/arch/alpha/include/asm/futex.h +++ b/arch/alpha/include/asm/futex.h | |||
@@ -25,18 +25,10 @@ | |||
25 | : "r" (uaddr), "r"(oparg) \ | 25 | : "r" (uaddr), "r"(oparg) \ |
26 | : "memory") | 26 | : "memory") |
27 | 27 | ||
28 | static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | 28 | static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, |
29 | u32 __user *uaddr) | ||
29 | { | 30 | { |
30 | int op = (encoded_op >> 28) & 7; | ||
31 | int cmp = (encoded_op >> 24) & 15; | ||
32 | int oparg = (encoded_op << 8) >> 20; | ||
33 | int cmparg = (encoded_op << 20) >> 20; | ||
34 | int oldval = 0, ret; | 31 | int oldval = 0, ret; |
35 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
36 | oparg = 1 << oparg; | ||
37 | |||
38 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) | ||
39 | return -EFAULT; | ||
40 | 32 | ||
41 | pagefault_disable(); | 33 | pagefault_disable(); |
42 | 34 | ||
@@ -62,17 +54,9 @@ static inline int futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) | |||
62 | 54 | ||
63 | pagefault_enable(); | 55 | pagefault_enable(); |
64 | 56 | ||
65 | if (!ret) { | 57 | if (!ret) |
66 | switch (cmp) { | 58 | *oval = oldval; |
67 | case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; | 59 | |
68 | case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; | ||
69 | case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; | ||
70 | case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; | ||
71 | case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; | ||
72 | case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; | ||
73 | default: ret = -ENOSYS; | ||
74 | } | ||
75 | } | ||
76 | return ret; | 60 | return ret; |
77 | } | 61 | } |
78 | 62 | ||