Commit 8d8a6479 authored by David S. Miller's avatar David S. Miller

[SPARC64]: Pass regs and entry/exit boolean to syscall_trace()

Also fix a bug in 32-bit syscall tracing.  We forgot to update
this code when we moved over to the convention that all 32-bit
syscall arguments are zero extended by default.
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bb49bcda
...@@ -1555,8 +1555,9 @@ sys_ptrace: add %sp, PTREGS_OFF, %o0 ...@@ -1555,8 +1555,9 @@ sys_ptrace: add %sp, PTREGS_OFF, %o0
andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP), %g0 andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP), %g0
be,pt %icc, rtrap be,pt %icc, rtrap
clr %l6 clr %l6
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
nop mov 1, %o1
ba,pt %xcc, rtrap ba,pt %xcc, rtrap
clr %l6 clr %l6
...@@ -1640,18 +1641,20 @@ linux_sparc_ni_syscall: ...@@ -1640,18 +1641,20 @@ linux_sparc_ni_syscall:
or %l7, %lo(sys_ni_syscall), %l7 or %l7, %lo(sys_ni_syscall), %l7
linux_syscall_trace32: linux_syscall_trace32:
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
nop clr %o1
srl %i0, 0, %o0 srl %i0, 0, %o0
mov %i4, %o4 srl %i4, 0, %o4
srl %i1, 0, %o1 srl %i1, 0, %o1
srl %i2, 0, %o2 srl %i2, 0, %o2
b,pt %xcc, 2f b,pt %xcc, 2f
srl %i3, 0, %o3 srl %i3, 0, %o3
linux_syscall_trace: linux_syscall_trace:
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
nop clr %o1
mov %i0, %o0 mov %i0, %o0
mov %i1, %o1 mov %i1, %o1
mov %i2, %o2 mov %i2, %o2
...@@ -1755,8 +1758,9 @@ ret_sys_call: ...@@ -1755,8 +1758,9 @@ ret_sys_call:
b,pt %xcc, rtrap b,pt %xcc, rtrap
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
linux_syscall_trace2: linux_syscall_trace2:
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
nop mov 1, %o1
stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
ba,pt %xcc, rtrap ba,pt %xcc, rtrap
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
......
...@@ -628,10 +628,10 @@ asmlinkage void do_ptrace(struct pt_regs *regs) ...@@ -628,10 +628,10 @@ asmlinkage void do_ptrace(struct pt_regs *regs)
unlock_kernel(); unlock_kernel();
} }
asmlinkage void syscall_trace(void) asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p)
{ {
/* do the secure computing check first */ /* do the secure computing check first */
secure_computing(current_thread_info()->kregs->u_regs[UREG_G1]); secure_computing(regs->u_regs[UREG_G1]);
if (!test_thread_flag(TIF_SYSCALL_TRACE)) if (!test_thread_flag(TIF_SYSCALL_TRACE))
return; return;
......
...@@ -79,7 +79,7 @@ extern void linux_sparc_syscall(void); ...@@ -79,7 +79,7 @@ extern void linux_sparc_syscall(void);
extern void rtrap(void); extern void rtrap(void);
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
extern void solaris_syscall(void); extern void solaris_syscall(void);
extern void syscall_trace(void); extern void syscall_trace(struct pt_regs *, int);
extern u32 sunos_sys_table[], sys_call_table32[]; extern u32 sunos_sys_table[], sys_call_table32[];
extern void tl0_solaris(void); extern void tl0_solaris(void);
extern void sys_sigsuspend(void); extern void sys_sigsuspend(void);
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
.text .text
solaris_syscall_trace: solaris_syscall_trace:
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
nop mov 0, %o1
srl %i0, 0, %o0 srl %i0, 0, %o0
mov %i4, %o4 mov %i4, %o4
srl %i1, 0, %o1 srl %i1, 0, %o1
...@@ -159,8 +160,10 @@ ret_from_solaris: ...@@ -159,8 +160,10 @@ ret_from_solaris:
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4
solaris_syscall_trace2: solaris_syscall_trace2:
add %sp, PTREGS_OFF, %o0
call syscall_trace call syscall_trace
add %l1, 0x4, %l2 /* npc = npc+4 */ mov 1, %o1
add %l1, 0x4, %l2 /* npc = npc+4 */
andcc %l1, 1, %g0 andcc %l1, 1, %g0
bne,pn %icc, 2b bne,pn %icc, 2b
nop nop
......
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