riscv: mm: Control p4d's folding by pgtable_l5_enabled
authorQinglin Pan <panqinglin2020@iscas.ac.cn>
Thu, 27 Jan 2022 02:48:41 +0000 (10:48 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 15 Feb 2022 00:32:39 +0000 (16:32 -0800)
commitd10efa21a9374829a662ec1377237e85f430c024
treed84406b277207ae9442e4785db251b2c20cdac98
parente783362eb54cd99b2cac8b3a9aeac942e6f6ac07
riscv: mm: Control p4d's folding by pgtable_l5_enabled

To determine pgtable level at boot time, we can not use helper functions
in include/asm-generic/pgtable-nop4d.h and must implement these
functions. This patch uses pgtable_l5_enabled variable instead of
including pgtable-nop4d.h to controle p4d's folding, and implements
corresponding helper functions.

Signed-off-by: Qinglin Pan <panqinglin2020@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/pgalloc.h
arch/riscv/include/asm/pgtable-64.h
arch/riscv/include/asm/pgtable.h
arch/riscv/mm/init.c