linux-kernelorg-stable/arch/riscv/include
Andreas Schwab 599c44cd21
riscv/futex: sign extend compare value in atomic cmpxchg
Make sure the compare value in the lr/sc loop is sign extended to match
what lr.w does.  Fortunately, due to the compiler keeping the register
contents sign extended anyway the lack of the explicit extension didn't
result in wrong code so far, but this cannot be relied upon.

Fixes: b90edb3301 ("RISC-V: Add futex support.")
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/mvmfrkv2vhz.fsf@suse.de
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2025-02-14 13:06:31 -08:00
..
asm riscv/futex: sign extend compare value in atomic cmpxchg 2025-02-14 13:06:31 -08:00
uapi/asm RISC-V Patches for the 6.14 Merge Window, Part 1 2025-01-31 15:13:25 -08:00