Skip to content

Commit f36e0aa

Browse files
committed
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 <[email protected]>
1 parent 20f6953 commit f36e0aa

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

arch/csky/kernel/entry.S

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,11 @@ tlbop_end 1
128128
ENTRY(csky_systemcall)
129129
SAVE_ALL TRAP0_SIZE
130130
zero_fp
131-
#ifdef CONFIG_RSEQ_DEBUG
132-
mov a0, sp
133-
jbsr rseq_syscall
134-
#endif
135131
psrset ee, ie
136132

137133
lrw r9, __NR_syscalls
138134
cmphs syscallid, r9 /* Check nr of syscall */
139-
bt ret_from_exception
135+
bt 1f
140136

141137
lrw r9, sys_call_table
142138
ixw r9, syscallid
@@ -162,6 +158,11 @@ ENTRY(csky_systemcall)
162158
jsr syscallid
163159
#endif
164160
stw a0, (sp, LSAVE_A0) /* Save return value */
161+
1:
162+
#ifdef CONFIG_DEBUG_RSEQ
163+
mov a0, sp
164+
jbsr rseq_syscall
165+
#endif
165166
jmpi ret_from_exception
166167

167168
csky_syscall_trace:
@@ -187,6 +188,10 @@ csky_syscall_trace:
187188
#endif
188189
stw a0, (sp, LSAVE_A0) /* Save return value */
189190

191+
#ifdef CONFIG_DEBUG_RSEQ
192+
mov a0, sp
193+
jbsr rseq_syscall
194+
#endif
190195
mov a0, sp /* right now, sp --> pt_regs */
191196
jbsr syscall_trace_exit
192197
br ret_from_exception

0 commit comments

Comments
 (0)