From 75907c9e27bf16b0db0c49ec508fc2267af9213b Mon Sep 17 00:00:00 2001 From: luohaiyang Date: Mon, 9 Jun 2025 09:14:19 +0800 Subject: [PATCH] anolis: riscv: Fix map all memory to linear space without fixed map size ANBZ: #21686 when map all memory to linear space with fixed PMD_SZIE, each memory rang start and end pa/va addr must aligend with PMD_SZIE. Unfortunately, this condition is rarely satisfied in most scenarios. The following link has the same issue. https://lore.kernel.org/linux-riscv/tencent_7C3B580B47C1B17C16488EC1@qq.com/ --- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 9eea7099c2f8..bdf8ac6c7e30 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -1294,7 +1294,7 @@ static void __init create_linear_mapping_page_table(void) __pa(PAGE_OFFSET) < end) start = __pa(PAGE_OFFSET); - create_linear_mapping_range(start, end, PMD_SIZE); + create_linear_mapping_range(start, end, 0); } #ifdef CONFIG_STRICT_KERNEL_RWX -- Gitee