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>
This commit is contained in:
Qinglin Pan 2022-01-27 10:48:41 +08:00 • committed by Palmer Dabbelt
commit d10efa21a9
No known key found for this signature in database
GPG key ID: 2E1319F35FBB1889
4 changed files with 158 additions and 3 deletions