Skip to content

Commit f4ea67a

Browse files
radimkrcmarPaul Walmsley
authored andcommitted
riscv: use lw when reading int cpu in asm_per_cpu
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: [email protected] Reviewed-by: Alexandre Ghiti <[email protected]> Signed-off-by: Radim Krčmář <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paul Walmsley <[email protected]>
1 parent 8a16586 commit f4ea67a

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)