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/tile | |
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/tile')
-rw-r--r-- | arch/tile/include/asm/atomic_32.h | 2 | ||||
-rw-r--r-- | arch/tile/include/asm/futex.h | 40 |
2 files changed, 7 insertions, 35 deletions
diff --git a/arch/tile/include/asm/atomic_32.h b/arch/tile/include/asm/atomic_32.h index a93774255136..53a423e7cb92 100644 --- a/arch/tile/include/asm/atomic_32.h +++ b/arch/tile/include/asm/atomic_32.h | |||
@@ -101,6 +101,8 @@ static inline void atomic_set(atomic_t *v, int n) | |||
101 | _atomic_xchg(&v->counter, n); | 101 | _atomic_xchg(&v->counter, n); |
102 | } | 102 | } |
103 | 103 | ||
104 | #define atomic_set_release(v, i) atomic_set((v), (i)) | ||
105 | |||
104 | /* A 64bit atomic type */ | 106 | /* A 64bit atomic type */ |
105 | 107 | ||
106 | typedef struct { | 108 | typedef struct { |
diff --git a/arch/tile/include/asm/futex.h b/arch/tile/include/asm/futex.h index e64a1b75fc38..83c1e639b411 100644 --- a/arch/tile/include/asm/futex.h +++ b/arch/tile/include/asm/futex.h | |||
@@ -106,12 +106,9 @@ | |||
106 | lock = __atomic_hashed_lock((int __force *)uaddr) | 106 | lock = __atomic_hashed_lock((int __force *)uaddr) |
107 | #endif | 107 | #endif |
108 | 108 | ||
109 | static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | 109 | static inline int arch_futex_atomic_op_inuser(int op, u32 oparg, int *oval, |
110 | u32 __user *uaddr) | ||
110 | { | 111 | { |
111 | int op = (encoded_op >> 28) & 7; | ||
112 | int cmp = (encoded_op >> 24) & 15; | ||
113 | int oparg = (encoded_op << 8) >> 20; | ||
114 | int cmparg = (encoded_op << 20) >> 20; | ||
115 | int uninitialized_var(val), ret; | 112 | int uninitialized_var(val), ret; |
116 | 113 | ||
117 | __futex_prolog(); | 114 | __futex_prolog(); |
@@ -119,12 +116,6 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | |||
119 | /* The 32-bit futex code makes this assumption, so validate it here. */ | 116 | /* The 32-bit futex code makes this assumption, so validate it here. */ |
120 | BUILD_BUG_ON(sizeof(atomic_t) != sizeof(int)); | 117 | BUILD_BUG_ON(sizeof(atomic_t) != sizeof(int)); |
121 | 118 | ||
122 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | ||
123 | oparg = 1 << oparg; | ||
124 | |||
125 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) | ||
126 | return -EFAULT; | ||
127 | |||
128 | pagefault_disable(); | 119 | pagefault_disable(); |
129 | switch (op) { | 120 | switch (op) { |
130 | case FUTEX_OP_SET: | 121 | case FUTEX_OP_SET: |
@@ -148,30 +139,9 @@ static inline int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) | |||
148 | } | 139 | } |
149 | pagefault_enable(); | 140 | pagefault_enable(); |
150 | 141 | ||
151 | if (!ret) { | 142 | if (!ret) |
152 | switch (cmp) { | 143 | *oval = val; |
153 | case FUTEX_OP_CMP_EQ: | 144 | |
154 | ret = (val == cmparg); | ||
155 | break; | ||
156 | case FUTEX_OP_CMP_NE: | ||
157 | ret = (val != cmparg); | ||
158 | break; | ||
159 | case FUTEX_OP_CMP_LT: | ||
160 | ret = (val < cmparg); | ||
161 | break; | ||
162 | case FUTEX_OP_CMP_GE: | ||
163 | ret = (val >= cmparg); | ||
164 | break; | ||
165 | case FUTEX_OP_CMP_LE: | ||
166 | ret = (val <= cmparg); | ||
167 | break; | ||
168 | case FUTEX_OP_CMP_GT: | ||
169 | ret = (val > cmparg); | ||
170 | break; | ||
171 | default: | ||
172 | ret = -ENOSYS; | ||
173 | } | ||
174 | } | ||
175 | return ret; | 145 | return ret; |
176 | } | 146 | } |
177 | 147 | ||