linux/arch/riscv/mm
Guo Ren (Alibaba DAMO Academy) db909bd798 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: 26e7aacb83 ("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>
History 2026-05-01 21:18:58 -06:00
..
cache-ops.c riscv: split cache ops out of dma-noncoherent.c 2023-11-07 09:37:42 -08:00
cacheflush.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
context.c riscv: Fix a comment typo in set_mm_asid() 2025-03-18 13:02:47 +00:00
dma-noncoherent.c dma-mapping: Simplify arch_setup_dma_ops() 2024-04-26 12:07:28 +02:00
extable.c riscv: select DCACHE_WORD_ACCESS for efficient unaligned access HW 2024-01-09 20:18:20 -08:00
fault.c riscv: mm: Add page fault trace points 2025-07-09 15:27:01 -04:00
hugetlbpage.c mm, arch: consolidate hugetlb CMA reservation 2026-01-26 20:02:19 -08:00
init.c riscv: mm: Fixup no5lvl failure when vaddr is invalid 2026-05-01 21:18:58 -06:00
kasan_init.c kasan: call kasan_init_generic in kasan_init 2025-09-21 14:21:58 -07:00
Makefile mm: rename GENERIC_PTDUMP and PTDUMP_CORE 2025-03-17 00:05:32 -07:00
pageattr.c mm/pagewalk: split walk_page_range_novma() into kernel/user parts 2025-07-09 22:42:05 -07:00
pgtable.c mm: change to return bool for ptep_test_and_clear_young() 2026-04-05 13:53:35 -07:00
physaddr.c riscv: fix various typos in comments and code 2026-04-04 18:42:39 -06:00
pmem.c RISC-V: capitalise CMO op macros 2023-11-05 09:11:23 -08:00
ptdump.c riscv: ptdump: use seq_puts() in pt_dump_seq_puts() macro 2025-10-27 11:40:43 -06:00
tlbflush.c mm: remove arch_flush_tlb_batched_pending() arch helper 2025-07-24 19:12:32 -07:00