Skip to content

Commit d4abde5

Browse files
Merge patch series "riscv: mm: Fixup & Optimize COMPAT code"
guoren@kernel.org <guoren@kernel.org> says: From: Guo Ren <guoren@linux.alibaba.com> When the task is in COMPAT mode, the TASK_SIZE should be 2GB, so STACK_TOP_MAX and arch_get_mmap_end must be limited to 2 GB. This series fixes the problem made by commit: add2cc6 ("RISC-V: mm: Restrict address space for sv39,sv48,sv57") and optimizes the related coding convention of TASK_SIZE. * b4-shazam-merge: riscv: mm: Fixup compat arch_get_mmap_end riscv: mm: Fixup compat mode boot failure Link: https://lore.kernel.org/r/20231222115703.2404036-1-guoren@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
2 parents adb1f95 + 97b7ac6 commit d4abde5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
864864
#define TASK_SIZE_MIN (PGDIR_SIZE_L3 * PTRS_PER_PGD / 2)
865865

866866
#ifdef CONFIG_COMPAT
867-
#define TASK_SIZE_32 (_AC(0x80000000, UL) - PAGE_SIZE)
867+
#define TASK_SIZE_32 (_AC(0x80000000, UL))
868868
#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
869869
TASK_SIZE_32 : TASK_SIZE_64)
870870
#else

arch/riscv/include/asm/processor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#ifdef CONFIG_64BIT
1818
#define DEFAULT_MAP_WINDOW (UL(1) << (MMAP_VA_BITS - 1))
19-
#define STACK_TOP_MAX TASK_SIZE_64
19+
#define STACK_TOP_MAX TASK_SIZE
2020

2121
#define arch_get_mmap_end(addr, len, flags) \
2222
({ \

0 commit comments

Comments
 (0)