riscv: mm: modify pte format for Svnapot
authorQinglin Pan <panqinglin2020@iscas.ac.cn>
Thu, 9 Feb 2023 13:16:45 +0000 (21:16 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 8 Mar 2023 03:39:15 +0000 (19:39 -0800)
commit23ad288aaf153a78b042e10062be1a6284909f95
treef766a7727e62f263baad2b478a56a6e4a8a92fcf
parent9daca9a5b9ac35361ce2d8d5ec10b19b7048d6cd
riscv: mm: modify pte format for Svnapot

Add one alternative to enable/disable svnapot support, enable this static
key when "svnapot" is in the "riscv,isa" field of fdt and SVNAPOT compile
option is set. It will influence the behavior of has_svnapot. All code
dependent on svnapot should make sure that has_svnapot return true firstly.

Modify PTE definition for Svnapot, and creates some functions in pgtable.h
to mark a PTE as napot and check if it is a Svnapot PTE. Until now, only
64KB napot size is supported in spec, so some macros has only 64KB version.

Signed-off-by: Qinglin Pan <panqinglin00@gmail.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230209131647.17245-2-panqinglin00@gmail.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig
arch/riscv/include/asm/hwcap.h
arch/riscv/include/asm/page.h
arch/riscv/include/asm/pgtable-64.h
arch/riscv/include/asm/pgtable.h
arch/riscv/kernel/cpu.c
arch/riscv/kernel/cpufeature.c