On 5/14/22 16:03, Huacai Chen wrote:
Add process management support for LoongArch, including: thread info definition, context switch and process tracing. Signed-off-by: Huacai Chen <chenhuacai@xxxxxxxxxxx> --- arch/loongarch/include/asm/fpu.h | 129 +++++++ arch/loongarch/include/asm/idle.h | 9 + arch/loongarch/include/asm/mmu.h | 16 + arch/loongarch/include/asm/mmu_context.h | 152 ++++++++ arch/loongarch/include/asm/processor.h | 209 +++++++++++ arch/loongarch/include/asm/ptrace.h | 152 ++++++++ arch/loongarch/include/asm/switch_to.h | 37 ++ arch/loongarch/include/asm/thread_info.h | 106 ++++++ arch/loongarch/include/uapi/asm/ptrace.h | 52 +++ arch/loongarch/kernel/fpu.S | 264 ++++++++++++++ arch/loongarch/kernel/idle.c | 16 + arch/loongarch/kernel/process.c | 260 ++++++++++++++ arch/loongarch/kernel/ptrace.c | 431 +++++++++++++++++++++++ arch/loongarch/kernel/switch.S | 35 ++ 14 files changed, 1868 insertions(+) create mode 100644 arch/loongarch/include/asm/fpu.h create mode 100644 arch/loongarch/include/asm/idle.h create mode 100644 arch/loongarch/include/asm/mmu.h create mode 100644 arch/loongarch/include/asm/mmu_context.h create mode 100644 arch/loongarch/include/asm/processor.h create mode 100644 arch/loongarch/include/asm/ptrace.h create mode 100644 arch/loongarch/include/asm/switch_to.h create mode 100644 arch/loongarch/include/asm/thread_info.h create mode 100644 arch/loongarch/include/uapi/asm/ptrace.h create mode 100644 arch/loongarch/kernel/fpu.S create mode 100644 arch/loongarch/kernel/idle.c create mode 100644 arch/loongarch/kernel/process.c create mode 100644 arch/loongarch/kernel/ptrace.c create mode 100644 arch/loongarch/kernel/switch.S
The context handling code already saw use in released version of strace [1] [2], so it appears appropriate to consider the user-space additions to be in a reasonably good shape already.
Reviewed-by: WANG Xuerui <git@xxxxxxxxxx> [1]: https://github.com/strace/strace/pull/205 [2]: https://github.com/strace/strace/pull/207