Skip to content

Commit b5176a7

Browse files
radimkrcmargregkh
authored andcommitted
riscv: use lw when reading int cpu in asm_per_cpu
commit f4ea67a upstream. REG_L is wrong, because thread_info.cpu is 32-bit, not xlen-bit wide. The struct currently has a hole after cpu, so little endian accesses seemed fine. Fixes: be97d0d ("riscv: VMAP_STACK overflow detection thread-safe") Cc: stable@vger.kernel.org Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com> Signed-off-by: Radim Krčmář <rkrcmar@ventanamicro.com> Link: https://lore.kernel.org/r/20250725165410.2896641-5-rkrcmar@ventanamicro.com Signed-off-by: Paul Walmsley <pjw@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent b363a9e commit b5176a7

File tree

1 file changed

+1
-1
lines changed
  • arch/riscv/include/asm

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/asm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
#endif
9292

9393
.macro asm_per_cpu dst sym tmp
94-
REG_L \tmp, TASK_TI_CPU_NUM(tp)
94+
lw \tmp, TASK_TI_CPU_NUM(tp)
9595
slli \tmp, \tmp, PER_CPU_OFFSET_SHIFT
9696
la \dst, __per_cpu_offset
9797
add \dst, \dst, \tmp

0 commit comments

Comments
 (0)