From: Palmer Dabbelt Date: Tue, 22 Feb 2022 17:40:52 +0000 (-0800) Subject: RISC-V: Add Sv57 page table support X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9195c294bc58f284f5bf7bc7e6d94cce078b206f;p=linux.git RISC-V: Add Sv57 page table support This implements Sv57 support at runtime. The kernel will try to boot with 5-level page table firstly , and will fallback to 4-level if the HW does not support it. And it will finally fallback to 3-level if the HW alse does not support sv48. * riscv-sv57: riscv: mm: Support kasan for sv57 riscv: mm: Set sv57 on defaultly riscv: mm: Prepare pt_ops helper functions for sv57 riscv: mm: Control p4d's folding by pgtable_l5_enabled --- 9195c294bc58f284f5bf7bc7e6d94cce078b206f diff --cc arch/riscv/mm/init.c index 332a319783817,df8ddde2e7502..6ddc7c6e161ab --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@@ -38,9 -38,9 +38,9 @@@ EXPORT_SYMBOL(kernel_map) #endif #ifdef CONFIG_64BIT - u64 satp_mode __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL) ? SATP_MODE_48 : SATP_MODE_39; -u64 satp_mode = !IS_ENABLED(CONFIG_XIP_KERNEL) ? SATP_MODE_57 : SATP_MODE_39; ++u64 satp_mode __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL) ? SATP_MODE_57 : SATP_MODE_39; #else -u64 satp_mode = SATP_MODE_32; +u64 satp_mode __ro_after_init = SATP_MODE_32; #endif EXPORT_SYMBOL(satp_mode);