]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
riscv: mm: Fixup no5lvl failure when vaddr is invalid
authorGuo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Sun, 25 Jan 2026 05:52:12 +0000 (00:52 -0500)
committerPaul Walmsley <pjw@kernel.org>
Sat, 2 May 2026 03:18:58 +0000 (21:18 -0600)
commitdb909bd7986c10da074917af3dae83a60fa65093
treea4b634888b436db11dcb840ecaf03f6dd7ddd371
parent6ebcbb53fc9bc30843054ed99fd60b8e542628f4
riscv: mm: Fixup no5lvl failure when vaddr is invalid

Unlike no4lvl, no5lvl still continues to detect satp, which
requires va=pa mapping. When pa=0x800000000000, no5lvl
would fail in Sv48 mode due to an illegal VA value of
0x800000000000.

So, prevent detecting the satp flow for no5lvl, when
vaddr is invalid. Add the is_vaddr_valid() function for
checking.

Fixes: 26e7aacb83df ("riscv: Allow to downgrade paging mode from the command line")
Cc: Alexandre Ghiti <alexghiti@rivosinc.com>
Cc: Björn Töpel <bjorn@rivosinc.com>
Signed-off-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Tested-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Link: https://patch.msgid.link/20260125055212.433163-1-guoren@kernel.org
[pjw@kernel.org: cleaned up commit message]
Signed-off-by: Paul Walmsley <pjw@kernel.org>
arch/riscv/mm/init.c