riscv: entry: Convert to generic entry
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 22 Feb 2023 03:30:18 +0000 (22:30 -0500)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 23 Mar 2023 15:47:00 +0000 (08:47 -0700)
commitf0bddf50586da81360627a772be0e355b62f071e
treec97587427a7a1c7d7c2a75d4e8f79b2210d19885
parentd0db02c628793e389538c0e5c3f6491141ea6200
riscv: entry: Convert to generic entry

This patch converts riscv to use the generic entry infrastructure from
kernel/entry/*. The generic entry makes maintainers' work easier and
codes more elegant. Here are the changes:

 - More clear entry.S with handle_exception and ret_from_exception
 - Get rid of complex custom signal implementation
 - Move syscall procedure from assembly to C, which is much more
   readable.
 - Connect ret_from_fork & ret_from_kernel_thread to generic entry.
 - Wrap with irqentry_enter/exit and syscall_enter/exit_from_user_mode
 - Use the standard preemption code instead of custom

Suggested-by: Huacai Chen <chenhuacai@kernel.org>
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
Tested-by: Yipeng Zou <zouyipeng@huawei.com>
Tested-by: Jisheng Zhang <jszhang@kernel.org>
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Cc: Ben Hutchings <ben@decadent.org.uk>
Link: https://lore.kernel.org/r/20230222033021.983168-5-guoren@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
14 files changed:
arch/riscv/Kconfig
arch/riscv/include/asm/asm-prototypes.h
arch/riscv/include/asm/csr.h
arch/riscv/include/asm/entry-common.h [new file with mode: 0644]
arch/riscv/include/asm/ptrace.h
arch/riscv/include/asm/stacktrace.h
arch/riscv/include/asm/syscall.h
arch/riscv/include/asm/thread_info.h
arch/riscv/kernel/entry.S
arch/riscv/kernel/head.h
arch/riscv/kernel/ptrace.c
arch/riscv/kernel/signal.c
arch/riscv/kernel/traps.c
arch/riscv/mm/fault.c