]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
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)
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

index e476b4386bd9dba3c3f59b501369e169fecc003a..077b968dcc81057af43147598f8b10d5488d9398 100644 (file)
@@ -47,11 +47,12 @@ RISC-V Linux Kernel SV39
                                                               | Kernel-space virtual memory, shared between all processes:
   ____________________________________________________________|___________________________________________________________
                     |            |                  |         |
-   ffffffc6fea00000 | -228    GB | ffffffc6feffffff |    6 MB | fixmap
-   ffffffc6ff000000 | -228    GB | ffffffc6ffffffff |   16 MB | PCI io
-   ffffffc700000000 | -228    GB | ffffffc7ffffffff |    4 GB | vmemmap
-   ffffffc800000000 | -224    GB | ffffffd7ffffffff |   64 GB | vmalloc/ioremap space
-   ffffffd800000000 | -160    GB | fffffff6ffffffff |  124 GB | direct mapping of all physical memory
+   ffffffc4fea00000 | -236    GB | ffffffc4feffffff |    6 MB | fixmap
+   ffffffc4ff000000 | -236    GB | ffffffc4ffffffff |   16 MB | PCI io
+   ffffffc500000000 | -236    GB | ffffffc5ffffffff |    4 GB | vmemmap
+   ffffffc600000000 | -232    GB | ffffffd5ffffffff |   64 GB | vmalloc/ioremap space
+   ffffffd600000000 | -168    GB | fffffff5ffffffff |  128 GB | direct mapping of all physical memory
+                    |            |                  |         |
    fffffff700000000 |  -36    GB | fffffffeffffffff |   32 GB | kasan
   __________________|____________|__________________|_________|____________________________________________________________
                                                               |
index 235fd45d998d97b7815c203c9e9a6109796fe3c6..7ede2111c5917a31d7265a457a173be2dc339afa 100644 (file)
@@ -37,7 +37,7 @@
  * define the PAGE_OFFSET value for SV48 and SV39.
  */
 #define PAGE_OFFSET_L4         _AC(0xffffaf8000000000, UL)
-#define PAGE_OFFSET_L3         _AC(0xffffffd800000000, UL)
+#define PAGE_OFFSET_L3         _AC(0xffffffd600000000, UL)
 #else
 #define PAGE_OFFSET            _AC(CONFIG_PAGE_OFFSET, UL)
 #endif /* CONFIG_64BIT */