Commit f36e0aab authored by Guo Ren's avatar Guo Ren

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: default avatarGuo Ren <guoren@linux.alibaba.com>
parent 20f69538
...@@ -128,15 +128,11 @@ tlbop_end 1 ...@@ -128,15 +128,11 @@ tlbop_end 1
ENTRY(csky_systemcall) ENTRY(csky_systemcall)
SAVE_ALL TRAP0_SIZE SAVE_ALL TRAP0_SIZE
zero_fp zero_fp
#ifdef CONFIG_RSEQ_DEBUG
mov a0, sp
jbsr rseq_syscall
#endif
psrset ee, ie psrset ee, ie
lrw r9, __NR_syscalls lrw r9, __NR_syscalls
cmphs syscallid, r9 /* Check nr of syscall */ cmphs syscallid, r9 /* Check nr of syscall */
bt ret_from_exception bt 1f
lrw r9, sys_call_table lrw r9, sys_call_table
ixw r9, syscallid ixw r9, syscallid
...@@ -162,6 +158,11 @@ ENTRY(csky_systemcall) ...@@ -162,6 +158,11 @@ ENTRY(csky_systemcall)
jsr syscallid jsr syscallid
#endif #endif
stw a0, (sp, LSAVE_A0) /* Save return value */ stw a0, (sp, LSAVE_A0) /* Save return value */
1:
#ifdef CONFIG_DEBUG_RSEQ
mov a0, sp
jbsr rseq_syscall
#endif
jmpi ret_from_exception jmpi ret_from_exception
csky_syscall_trace: csky_syscall_trace:
...@@ -187,6 +188,10 @@ csky_syscall_trace: ...@@ -187,6 +188,10 @@ csky_syscall_trace:
#endif #endif
stw a0, (sp, LSAVE_A0) /* Save return value */ 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 */ mov a0, sp /* right now, sp --> pt_regs */
jbsr syscall_trace_exit jbsr syscall_trace_exit
br ret_from_exception br ret_from_exception
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment