diff options
author | Qinglin Pan <panqinglin2020@iscas.ac.cn> | 2022-01-27 10:48:41 +0800 |
---|---|---|
committer | Palmer Dabbelt <palmer@rivosinc.com> | 2022-02-14 16:32:39 -0800 |
commit | d10efa21a9374829a662ec1377237e85f430c024 (patch) | |
tree | d84406b277207ae9442e4785db251b2c20cdac98 /arch/riscv/include/asm/pgtable.h | |
parent | Linux 5.17-rc1 (diff) | |
download | linux-dev-d10efa21a9374829a662ec1377237e85f430c024.tar.xz linux-dev-d10efa21a9374829a662ec1377237e85f430c024.zip |
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>
Diffstat (limited to 'arch/riscv/include/asm/pgtable.h')
-rw-r--r-- | arch/riscv/include/asm/pgtable.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index 7e949f25c933..58fece3133e9 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -62,7 +62,8 @@ * position vmemmap directly below the VMALLOC region. */ #ifdef CONFIG_64BIT -#define VA_BITS (pgtable_l4_enabled ? 48 : 39) +#define VA_BITS (pgtable_l5_enabled ? \ + 57 : (pgtable_l4_enabled ? 48 : 39)) #else #define VA_BITS 32 #endif @@ -102,7 +103,6 @@ #ifndef __ASSEMBLY__ -#include <asm-generic/pgtable-nop4d.h> #include <asm/page.h> #include <asm/tlbflush.h> #include <linux/mm_types.h> |