]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
riscv: Fix TASK_SIZE on 64-bit NOMMU
authorSamuel Holland <samuel.holland@sifive.com>
Tue, 27 Feb 2024 00:34:46 +0000 (16:34 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 9 Apr 2024 18:39:37 +0000 (11:39 -0700)
On NOMMU, userspace memory can come from anywhere in physical RAM. The
current definition of TASK_SIZE is wrong if any RAM exists above 4G,
causing spurious failures in the userspace access routines.

Fixes: 6bd33e1ece52 ("riscv: add nommu support")
Fixes: c3f896dcf1e4 ("mm: switch the test_vmalloc module to use __vmalloc_node")
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Bo Gan <ganboing@gmail.com>
Link: https://lore.kernel.org/r/20240227003630.3634533-2-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/pgtable.h

index 0c94260b5d0c126f6302f39a59507f19eed48dac..a564a39e5676fb1a9c5c87a0e335c9d01ef3c5f7 100644 (file)
@@ -882,7 +882,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
 #define PAGE_SHARED            __pgprot(0)
 #define PAGE_KERNEL            __pgprot(0)
 #define swapper_pg_dir         NULL
-#define TASK_SIZE              0xffffffffUL
+#define TASK_SIZE              _AC(-1, UL)
 #define VMALLOC_START          _AC(0, UL)
 #define VMALLOC_END            TASK_SIZE