Linux PARISC architecture development
 help / color / mirror / Atom feed
* [PATCH] parisc: Fix mask used to select futex spinlock
@ 2021-12-21 18:33 John David Anglin
  2021-12-21 18:45 ` Rolf Eike Beer
  0 siblings, 1 reply; 4+ messages in thread
From: John David Anglin @ 2021-12-21 18:33 UTC (permalink / raw)
  To: linux-parisc; +Cc: Helge Deller, Deller, James Bottomley

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: John David Anglin <dave.anglin@bell.net>
---

diff --git a/arch/parisc/include/asm/futex.h b/arch/parisc/include/asm/futex.h
index 70cf8f0a7617..9cd4dd6e63ad 100644
--- a/arch/parisc/include/asm/futex.h
+++ b/arch/parisc/include/asm/futex.h
@@ -14,7 +14,7 @@ static inline void
  _futex_spin_lock(u32 __user *uaddr)
  {
  	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];
  	preempt_disable();
  	arch_spin_lock(s);
@@ -24,7 +24,7 @@ static inline void
  _futex_spin_unlock(u32 __user *uaddr)
  {
  	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_spin_unlock(s);
  	preempt_enable();

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-21 19:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-21 18:33 [PATCH] parisc: Fix mask used to select futex spinlock John David Anglin
2021-12-21 18:45 ` Rolf Eike Beer
2021-12-21 19:27   ` John David Anglin
2021-12-21 19:33     ` Helge Deller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox