linux-stable/arch/parisc
Helge Deller 24555c3794 parisc: Fix lightweight spinlock checks to not break futexes
commit a0f4b7879f upstream.

The lightweight spinlock checks verify that a spinlock has either value
0 (spinlock locked) and that not any other bits than in
__ARCH_SPIN_LOCK_UNLOCKED_VAL is set.

This breaks the current LWS code, which writes the address of the lock
into the lock word to unlock it, which was an optimization to save one
assembler instruction.

Fix it by making spinlock_types.h accessible for asm code, change the
LWS spinlock-unlocking code to write __ARCH_SPIN_LOCK_UNLOCKED_VAL into
the lock word, and add some missing lightweight spinlock checks to the
LWS path. Finally, make the spinlock checks dependend on DEBUG_KERNEL.

Noticed-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Tested-by: John David Anglin <dave.anglin@bell.net>
Cc: stable@vger.kernel.org # v6.4+
Fixes: 15e64ef652 ("parisc: Add lightweight spinlock checks")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-08-16 18:32:18 +02:00
..
boot
configs parisc: Update 32- and 64-bit defconfigs 2022-05-08 20:01:11 +02:00
include parisc: Fix lightweight spinlock checks to not break futexes 2023-08-16 18:32:18 +02:00
kernel parisc: Fix lightweight spinlock checks to not break futexes 2023-08-16 18:32:18 +02:00
lib parisc: Drop homebrewn io[read|write]64_[lo_hi|hi_lo] 2022-09-23 21:52:27 +02:00
math-emu parisc: align '*' in comment in math-emu code 2022-06-26 00:19:27 +02:00
mm parisc/mm: preallocate fixmap page tables at init 2023-08-11 12:14:22 +02:00
defpalo.conf
install.sh kbuild: factor out the common installation code into scripts/install.sh 2022-05-11 21:45:53 +09:00
Kbuild
Kconfig parisc: Enable LOCKDEP support 2023-05-24 14:27:28 +02:00
Kconfig.debug parisc: Fix lightweight spinlock checks to not break futexes 2023-08-16 18:32:18 +02:00
Makefile kbuild: remove head-y syntax 2022-10-02 18:06:03 +09:00