Skip to content

Commit b363a9e

Browse files
radimkrcmargregkh
authored andcommitted
riscv: use lw when reading int cpu in new_vmalloc_check
commit e108c8a 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: 503638e ("riscv: Stop emitting preventive sfence.vma for new vmalloc mappings") 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-4-rkrcmar@ventanamicro.com Signed-off-by: Paul Walmsley <pjw@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f4bf477 commit b363a9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/entry.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* a0 = &new_vmalloc[BIT_WORD(cpu)]
4747
* a1 = BIT_MASK(cpu)
4848
*/
49-
REG_L a2, TASK_TI_CPU(tp)
49+
lw a2, TASK_TI_CPU(tp)
5050
/*
5151
* Compute the new_vmalloc element position:
5252
* (cpu / 64) * 8 = (cpu >> 6) << 3

0 commit comments

Comments
 (0)