]> git.infradead.org Git - users/hch/misc.git/commit
riscv: Extend sv39 linear mapping max size to 128G
authorStuart Menefy <stuart.menefy@codasip.com>
Sun, 30 Jun 2024 11:05:49 +0000 (12:05 +0100)
committerPalmer Dabbelt <palmer@rivosinc.com>
Fri, 26 Jul 2024 12:50:50 +0000 (05:50 -0700)
commit5c8405d763dc2b125b39166bc70be1b8dcc80582
tree95eb880448a9857ddc7a599428faa013e53caf1b
parent3aa1a7d013dd69d187a7b2daa1a0961b7d4edc71
riscv: Extend sv39 linear mapping max size to 128G

This harmonizes all virtual addressing modes which can now all map
(PGDIR_SIZE * PTRS_PER_PGD) / 4 of physical memory.

The RISCV implementation of KASAN requires that the boundary between
shallow mappings are aligned on an 8G boundary. In this case we need
VMALLOC_START to be 8G aligned. So although we only need to move the
start of the linear mapping down by 4GiB to allow 128GiB to be mapped,
we actually move it down by 8GiB (creating a 4GiB hole between the
linear mapping and KASAN shadow space) to maintain the alignment
requirement.

Signed-off-by: Stuart Menefy <stuart.menefy@codasip.com>
Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>
Link: https://lore.kernel.org/r/20240630110550.1731929-1-stuart.menefy@codasip.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Documentation/arch/riscv/vm-layout.rst
arch/riscv/include/asm/page.h