OpenCloudOS-Kernel/arch/riscv
Guo Ren eab6917e10 riscv: mm: Fixup compat mode boot failure
commit 5f449e245e5b0d9d63eef6c8968fbdc3a8594407 upstream.

In COMPAT mode, the STACK_TOP is DEFAULT_MAP_WINDOW (0x80000000), but
the TASK_SIZE is 0x7fff000. When the user stack is upon 0x7fff000, it
will cause a user segment fault. Sometimes, it would cause boot
failure when the whole rootfs is rv32.

Freeing unused kernel image (initmem) memory: 2236K
Run /sbin/init as init process
Starting init: /sbin/init exists but couldn't execute it (error -14)
Run /etc/init as init process
...

Increase the TASK_SIZE to cover STACK_TOP.

Cc: stable@vger.kernel.org
Fixes: add2cc6b65 ("RISC-V: mm: Restrict address space for sv39,sv48,sv57")
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Leonardo Bras <leobras@redhat.com>
Reviewed-by: Charlie Jenkins <charlie@rivosinc.com>
Link: https://lore.kernel.org/r/20231222115703.2404036-2-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-01-31 16:18:55 -08:00
..
boot riscv: boot: Fix creation of loader.bin 2023-11-20 11:59:35 +01:00
configs Kbuild updates for v6.6 2023-09-05 11:01:47 -07:00
errata riscv: errata: andes: Probe for IOCP only once in boot stage 2023-12-13 18:45:19 +01:00
include riscv: mm: Fixup compat mode boot failure 2024-01-31 16:18:55 -08:00
kernel riscv: Fix an off-by-one in get_early_cmdline() 2024-01-31 16:18:48 -08:00
kvm RISCV: KVM: update external interrupt atomically for IMSIC swfile 2024-01-10 17:16:59 +01:00
lib riscv: uaccess: Return the number of bytes effectively not copied 2023-08-16 07:30:06 -07:00
mm riscv: Fix wrong usage of lm_alias() when splitting a huge linear mapping 2024-01-25 15:36:01 -08:00
net riscv, bpf: Track both a0 (RISC-V ABI) and a5 (BPF) return values 2023-10-09 15:21:25 +02:00
purgatory riscv/purgatory: Disable CFI 2023-08-23 14:16:40 -07:00
tools riscv: Check relocations at compile time 2023-04-19 07:46:32 -07:00
Kbuild kexec: rename ARCH_HAS_KEXEC_PURGATORY 2023-08-18 10:18:54 -07:00
Kconfig kexec: fix KEXEC_FILE dependencies 2024-01-05 15:19:41 +01:00
Kconfig.debug RISC-V: Remove EARLY_PRINTK support 2018-12-17 10:23:46 -08:00
Kconfig.errata riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM and ERRATA_THEAD_PBMT 2023-10-26 09:42:38 +02:00
Kconfig.socs riscv: Kconfig: Add select ARM_AMBA to SOC_STARFIVE 2023-12-13 18:45:35 +01:00
Makefile riscv: Remove duplicate objcopy flag 2023-10-12 11:34:03 -07:00
Makefile.postlink riscv: Use --emit-relocs in order to move .rela.dyn in init 2023-04-19 07:46:33 -07:00