Skip to content

Commit 2201f31

Browse files
committed
xtensa: use actual syscall number in do_syscall_trace_leave
Syscall may alter pt_regs structure passed to it, resulting in a mismatch between syscall entry end syscall exit entries in the ftrace. Temporary restore syscall field of the pt_regs for the duration of do_syscall_trace_leave. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 79a3aaa commit 2201f31

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/xtensa/kernel/entry.S

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,6 +1860,8 @@ ENTRY(system_call)
18601860
l32i a7, a2, PT_SYSCALL
18611861

18621862
1:
1863+
s32i a7, a1, 4
1864+
18631865
/* syscall = sys_call_table[syscall_nr] */
18641866

18651867
movi a4, sys_call_table
@@ -1893,8 +1895,12 @@ ENTRY(system_call)
18931895
retw
18941896

18951897
1:
1898+
l32i a4, a1, 4
1899+
l32i a3, a2, PT_SYSCALL
1900+
s32i a4, a2, PT_SYSCALL
18961901
mov a6, a2
18971902
call4 do_syscall_trace_leave
1903+
s32i a3, a2, PT_SYSCALL
18981904
retw
18991905

19001906
ENDPROC(system_call)

0 commit comments

Comments
 (0)