Skip to content

Commit 6065e73

Browse files
SiFiveHollandpalmer-dabbelt
authored andcommitted
riscv: Fix TASK_SIZE on 64-bit NOMMU
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: 6bd33e1 ("riscv: add nommu support") Fixes: c3f896d ("mm: switch the test_vmalloc module to use __vmalloc_node") Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Jisheng Zhang <[email protected]> Reviewed-by: Bo Gan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 6613476 commit 6065e73

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
882882
#define PAGE_SHARED __pgprot(0)
883883
#define PAGE_KERNEL __pgprot(0)
884884
#define swapper_pg_dir NULL
885-
#define TASK_SIZE 0xffffffffUL
885+
#define TASK_SIZE _AC(-1, UL)
886886
#define VMALLOC_START _AC(0, UL)
887887
#define VMALLOC_END TASK_SIZE
888888

0 commit comments

Comments
 (0)