linux/arch/riscv
Song Shuai e59e5e2754
riscv: correct pt_level name via pgtable_l5/4_enabled
The pt_level uses CONFIG_PGTABLE_LEVELS to display page table names.
But if page mode is downgraded from kernel cmdline or restricted by
the hardware in 64BIT, it will give a wrong name.

Like, using no4lvl for sv39, ptdump named the 1G-mapping as "PUD"
that should be "PGD":

0xffffffd840000000-0xffffffd900000000    0x00000000c0000000         3G PUD     D A G . . W R V

So select "P4D/PUD" or "PGD" via pgtable_l5/4_enabled to correct it.

Fixes: e8a62cc26d ("riscv: Implement sv48 support")
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Signed-off-by: Song Shuai <suagrfillet@gmail.com>
Link: https://lore.kernel.org/r/20230712115740.943324-1-suagrfillet@gmail.com
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20230830044129.11481-3-palmer@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2023-10-31 19:15:51 -07:00
..
boot RISC-V Devicetrees for v6.6 Part 2 2023-08-21 21:47:55 -04:00
configs Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
errata Merge patch series "Add non-coherent DMA support for AX45MP" 2023-09-08 11:24:34 -07:00
include RISC-V: Provide pgtable_l5_enabled on rv32 2023-10-31 19:15:50 -07:00
kernel Merge patch series "RISC-V: Enable cbo.zero in usermode" 2023-10-31 19:15:47 -07:00
kvm KVM/riscv changes for 6.6 2023-08-31 13:25:55 -04:00
lib riscv: uaccess: Return the number of bytes effectively not copied 2023-08-16 07:30:06 -07:00
mm riscv: correct pt_level name via pgtable_l5/4_enabled 2023-10-31 19:15:51 -07:00
net bpf, riscv: use prog pack allocator in the BPF JIT 2023-09-06 06:26:07 -07:00
purgatory Merge patch series "riscv: kexec: cleanup and fixups" 2023-10-31 19:15:41 -07:00
tools riscv: Check relocations at compile time 2023-04-19 07:46:32 -07:00
Kbuild kexec: rename ARCH_HAS_KEXEC_PURGATORY 2023-08-18 10:18:54 -07:00
Kconfig riscv: Kconfig: Select DMA_DIRECT_REMAP only if MMU is enabled 2023-09-08 11:25:26 -07:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.errata riscv: Kconfig.errata: Add dependency for RISCV_SBI in ERRATA_ANDES config 2023-09-08 11:25:28 -07:00
Kconfig.socs RISC-V: make ARCH_THEAD preclude XIP_KERNEL 2023-07-05 22:21:23 +02:00
Makefile riscv: Require FRAME_POINTER for some configurations 2023-08-23 09:07:26 -07:00
Makefile.postlink riscv: Use --emit-relocs in order to move .rela.dyn in init 2023-04-19 07:46:33 -07:00