diff options
author | Guo Ren <guoren@linux.alibaba.com> | 2020-05-26 09:34:50 +0300 |
---|---|---|
committer | Guo Ren <guoren@linux.alibaba.com> | 2020-05-28 03:18:36 +0300 |
commit | f36e0aab6f1f78d770ce859df3f07a9c5763ce5f (patch) | |
tree | 9ec466f324249340f04d4123a024411c539fff4b /arch/csky | |
parent | 20f69538b9ab7175e1474a73e2793b8278846e1e (diff) | |
download | linux-f36e0aab6f1f78d770ce859df3f07a9c5763ce5f.tar.xz |
csky: Fixup CONFIG_DEBUG_RSEQ
Put the rseq_syscall check point at the prologue of the syscall
will break the a0 ... a7. This will casue system call bug when
DEBUG_RSEQ is enabled.
So move it to the epilogue of syscall, but before syscall_trace.
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Diffstat (limited to 'arch/csky')
-rw-r--r-- | arch/csky/kernel/entry.S | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/csky/kernel/entry.S b/arch/csky/kernel/entry.S index 9595e86ce304..f13800383a19 100644 --- a/arch/csky/kernel/entry.S +++ b/arch/csky/kernel/entry.S @@ -128,15 +128,11 @@ tlbop_end 1 ENTRY(csky_systemcall) SAVE_ALL TRAP0_SIZE zero_fp -#ifdef CONFIG_RSEQ_DEBUG - mov a0, sp - jbsr rseq_syscall -#endif psrset ee, ie lrw r9, __NR_syscalls cmphs syscallid, r9 /* Check nr of syscall */ - bt ret_from_exception + bt 1f lrw r9, sys_call_table ixw r9, syscallid @@ -162,6 +158,11 @@ ENTRY(csky_systemcall) jsr syscallid #endif stw a0, (sp, LSAVE_A0) /* Save return value */ +1: +#ifdef CONFIG_DEBUG_RSEQ + mov a0, sp + jbsr rseq_syscall +#endif jmpi ret_from_exception csky_syscall_trace: @@ -187,6 +188,10 @@ csky_syscall_trace: #endif stw a0, (sp, LSAVE_A0) /* Save return value */ +#ifdef CONFIG_DEBUG_RSEQ + mov a0, sp + jbsr rseq_syscall +#endif mov a0, sp /* right now, sp --> pt_regs */ jbsr syscall_trace_exit br ret_from_exception |