linux/arch/parisc/kernel
Helge Deller a0f4b7879f parisc: Fix lightweight spinlock checks to not break futexes
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")
2023-08-10 17:32:09 +02:00
..
syscalls parisc: Add cacheflush() syscall 2023-06-30 17:14:13 +02:00
vdso32 parisc: Add missing FORCE prerequisites in Makefile 2022-12-18 22:18:49 +01:00
vdso64 parisc: Add missing FORCE prerequisites in Makefile 2022-12-18 22:18:49 +01:00
.gitignore
alternative.c parisc: Use num_present_cpus() in alternative patching code 2023-05-23 18:17:32 +02:00
asm-offsets.c
audit.c parisc: Fold 32-bit compat code into audit_classify_syscall() 2023-06-30 17:14:14 +02:00
cache.c parisc: Add cacheflush() syscall 2023-06-30 17:14:13 +02:00
compat_audit.c parisc: Fold 32-bit compat code into audit_classify_syscall() 2023-06-30 17:14:14 +02:00
drivers.c parisc: drivers: Fix kdoc warnings 2023-06-30 17:14:14 +02:00
entry.S parisc: Fix userspace graphics card breakage due to pgtable special bit 2022-10-14 10:45:12 +02:00
firmware.c parisc: firmware: Fix kdoc warnings 2023-06-30 17:14:14 +02:00
ftrace.c
hardware.c
head.S
hpmc.S
inventory.c
irq.c parisc: irq: Add irq-related function declarations 2023-06-30 17:14:15 +02:00
jump_label.c
kexec.c parisc: kexec: include reboot.h 2023-05-09 14:04:56 +02:00
kexec_file.c
kgdb.c parisc: Drop duplicate kgdb_pdc console 2022-12-18 22:18:49 +01:00
kprobes.c
Makefile parisc: syscalls: Avoid compiler warnings with W=1 2023-07-03 18:56:03 +02:00
module.c parisc: module: Mark symindex __maybe_unused 2023-06-30 17:14:14 +02:00
pa7300lc.c
pacache.S parisc: Ensure page alignment in flush functions 2023-05-03 17:43:26 +02:00
parisc_ksyms.c
patch.c
pci-dma.c parisc: pci-dma: remove unused and dead EISA code and comment 2023-08-03 14:40:37 +02:00
pci.c
pdc_chassis.c parisc: pdc_chassis: Fix kdoc warnings 2023-06-30 17:14:14 +02:00
pdc_cons.c parisc: Drop locking in pdc console code 2022-12-18 22:18:49 +01:00
pdt.c parisc: pdt: Get prototype for arch_report_meminfo() 2023-07-03 18:25:23 +02:00
perf.c parisc: Mark image_size __maybe_unused in perf_write() 2023-06-30 17:14:14 +02:00
perf_asm.S
perf_images.h
process.c A large update for SMP management: 2023-06-26 13:59:56 -07:00
processor.c parisc: processor: Fix kdoc for init_cpu_profiler() 2023-06-30 17:14:15 +02:00
ptrace.c parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case 2023-02-01 21:42:37 +01:00
real2.S parisc: Fix argument pointer in real64_call_asm() 2023-05-03 17:43:26 +02:00
relocate_kernel.S
setup.c parisc: Move init function declarations into header file 2023-06-30 17:14:15 +02:00
signal.c parisc: signal: Mark do_notify_resume() and sys_rt_sigreturn() asmlinkage 2023-06-30 17:14:15 +02:00
signal32.c
signal32.h
smp.c parisc: smp: Add declaration for start_cpu_itimer() 2023-07-03 18:25:23 +02:00
stacktrace.c
sys_parisc.c io_uring-6.5-2023-07-21 2023-07-22 10:46:30 -07:00
sys_parisc32.c
syscall.S parisc: Fix lightweight spinlock checks to not break futexes 2023-08-10 17:32:09 +02:00
time.c
toc.c
toc_asm.S
topology.c
traps.c parisc: traps: Mark functions static 2023-06-30 17:14:15 +02:00
unaligned.c parisc: unaligned: Add required spaces after ',' 2023-08-03 14:40:37 +02:00
unwind.c parisc: unwind: Avoid missing prototype warning for handle_interruption() 2023-07-03 18:56:03 +02:00
vdso.c treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
vmlinux.lds.S objtool/idle: Validate __cpuidle code as noinstr 2023-01-13 11:48:15 +01:00