提交 d3a5a68c 编写于 作者: J John David Anglin 提交者: Helge Deller

parisc: Fix mask used to select futex spinlock

The address bits used to select the futex spinlock need to match those used in
the LWS code in syscall.S. The mask 0x3f8 only selects 7 bits.  It should
select 8 bits.

This change fixes the glibc nptl/tst-cond24 and nptl/tst-cond25 tests.
Signed-off-by: NJohn David Anglin <dave.anglin@bell.net>
Fixes: 53a42b63 ("parisc: Switch to more fine grained lws locks")
Cc: stable@vger.kernel.org # 5.10+
Signed-off-by: NHelge Deller <deller@gmx.de>
上级 8f66fce0
...@@ -14,7 +14,7 @@ static inline void ...@@ -14,7 +14,7 @@ static inline void
_futex_spin_lock(u32 __user *uaddr) _futex_spin_lock(u32 __user *uaddr)
{ {
extern u32 lws_lock_start[]; extern u32 lws_lock_start[];
long index = ((long)uaddr & 0x3f8) >> 1; long index = ((long)uaddr & 0x7f8) >> 1;
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index]; arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
preempt_disable(); preempt_disable();
arch_spin_lock(s); arch_spin_lock(s);
...@@ -24,7 +24,7 @@ static inline void ...@@ -24,7 +24,7 @@ static inline void
_futex_spin_unlock(u32 __user *uaddr) _futex_spin_unlock(u32 __user *uaddr)
{ {
extern u32 lws_lock_start[]; extern u32 lws_lock_start[];
long index = ((long)uaddr & 0x3f8) >> 1; long index = ((long)uaddr & 0x7f8) >> 1;
arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index]; arch_spinlock_t *s = (arch_spinlock_t *)&lws_lock_start[index];
arch_spin_unlock(s); arch_spin_unlock(s);
preempt_enable(); preempt_enable();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册