diff options
author | David S. Miller <davem@davemloft.net> | 2005-07-10 19:55:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-10 19:55:48 -0400 |
commit | 8d8a64796fdee4e20355c6c12c9cc630a2e7494d (patch) | |
tree | dc0d548a520bdad1e2aa7752153bf7c787fc04bd /arch | |
parent | bb49bcda15f1bc1a52c7f887db278447f332eaa7 (diff) |
[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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc64/kernel/entry.S | 14 | ||||
-rw-r--r-- | arch/sparc64/kernel/ptrace.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/sparc64_ksyms.c | 2 | ||||
-rw-r--r-- | arch/sparc64/solaris/entry64.S | 7 |
4 files changed, 17 insertions, 10 deletions
diff --git a/arch/sparc64/kernel/entry.S b/arch/sparc64/kernel/entry.S index acc323eef535..8b7ed760c50e 100644 --- a/arch/sparc64/kernel/entry.S +++ b/arch/sparc64/kernel/entry.S | |||
@@ -1555,8 +1555,9 @@ sys_ptrace: add %sp, PTREGS_OFF, %o0 | |||
1555 | andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP), %g0 | 1555 | andcc %l5, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP), %g0 |
1556 | be,pt %icc, rtrap | 1556 | be,pt %icc, rtrap |
1557 | clr %l6 | 1557 | clr %l6 |
1558 | add %sp, PTREGS_OFF, %o0 | ||
1558 | call syscall_trace | 1559 | call syscall_trace |
1559 | nop | 1560 | mov 1, %o1 |
1560 | 1561 | ||
1561 | ba,pt %xcc, rtrap | 1562 | ba,pt %xcc, rtrap |
1562 | clr %l6 | 1563 | clr %l6 |
@@ -1640,18 +1641,20 @@ linux_sparc_ni_syscall: | |||
1640 | or %l7, %lo(sys_ni_syscall), %l7 | 1641 | or %l7, %lo(sys_ni_syscall), %l7 |
1641 | 1642 | ||
1642 | linux_syscall_trace32: | 1643 | linux_syscall_trace32: |
1644 | add %sp, PTREGS_OFF, %o0 | ||
1643 | call syscall_trace | 1645 | call syscall_trace |
1644 | nop | 1646 | clr %o1 |
1645 | srl %i0, 0, %o0 | 1647 | srl %i0, 0, %o0 |
1646 | mov %i4, %o4 | 1648 | srl %i4, 0, %o4 |
1647 | srl %i1, 0, %o1 | 1649 | srl %i1, 0, %o1 |
1648 | srl %i2, 0, %o2 | 1650 | srl %i2, 0, %o2 |
1649 | b,pt %xcc, 2f | 1651 | b,pt %xcc, 2f |
1650 | srl %i3, 0, %o3 | 1652 | srl %i3, 0, %o3 |
1651 | 1653 | ||
1652 | linux_syscall_trace: | 1654 | linux_syscall_trace: |
1655 | add %sp, PTREGS_OFF, %o0 | ||
1653 | call syscall_trace | 1656 | call syscall_trace |
1654 | nop | 1657 | clr %o1 |
1655 | mov %i0, %o0 | 1658 | mov %i0, %o0 |
1656 | mov %i1, %o1 | 1659 | mov %i1, %o1 |
1657 | mov %i2, %o2 | 1660 | mov %i2, %o2 |
@@ -1755,8 +1758,9 @@ ret_sys_call: | |||
1755 | b,pt %xcc, rtrap | 1758 | b,pt %xcc, rtrap |
1756 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] | 1759 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] |
1757 | linux_syscall_trace2: | 1760 | linux_syscall_trace2: |
1761 | add %sp, PTREGS_OFF, %o0 | ||
1758 | call syscall_trace | 1762 | call syscall_trace |
1759 | nop | 1763 | mov 1, %o1 |
1760 | stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] | 1764 | stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC] |
1761 | ba,pt %xcc, rtrap | 1765 | ba,pt %xcc, rtrap |
1762 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] | 1766 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] |
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index 5abf596f5964..c57dc9ea731b 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -628,10 +628,10 @@ out: | |||
628 | unlock_kernel(); | 628 | unlock_kernel(); |
629 | } | 629 | } |
630 | 630 | ||
631 | asmlinkage void syscall_trace(void) | 631 | asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p) |
632 | { | 632 | { |
633 | /* do the secure computing check first */ | 633 | /* do the secure computing check first */ |
634 | secure_computing(current_thread_info()->kregs->u_regs[UREG_G1]); | 634 | secure_computing(regs->u_regs[UREG_G1]); |
635 | 635 | ||
636 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 636 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) |
637 | return; | 637 | return; |
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index 56cd96f4a5cd..9202d925a9ce 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c | |||
@@ -79,7 +79,7 @@ extern void linux_sparc_syscall(void); | |||
79 | extern void rtrap(void); | 79 | extern void rtrap(void); |
80 | extern void show_regs(struct pt_regs *); | 80 | extern void show_regs(struct pt_regs *); |
81 | extern void solaris_syscall(void); | 81 | extern void solaris_syscall(void); |
82 | extern void syscall_trace(void); | 82 | extern void syscall_trace(struct pt_regs *, int); |
83 | extern u32 sunos_sys_table[], sys_call_table32[]; | 83 | extern u32 sunos_sys_table[], sys_call_table32[]; |
84 | extern void tl0_solaris(void); | 84 | extern void tl0_solaris(void); |
85 | extern void sys_sigsuspend(void); | 85 | extern void sys_sigsuspend(void); |
diff --git a/arch/sparc64/solaris/entry64.S b/arch/sparc64/solaris/entry64.S index 0cc9dad75c5e..4b6ae583c0a3 100644 --- a/arch/sparc64/solaris/entry64.S +++ b/arch/sparc64/solaris/entry64.S | |||
@@ -24,8 +24,9 @@ | |||
24 | 24 | ||
25 | .text | 25 | .text |
26 | solaris_syscall_trace: | 26 | solaris_syscall_trace: |
27 | add %sp, PTREGS_OFF, %o0 | ||
27 | call syscall_trace | 28 | call syscall_trace |
28 | nop | 29 | mov 0, %o1 |
29 | srl %i0, 0, %o0 | 30 | srl %i0, 0, %o0 |
30 | mov %i4, %o4 | 31 | mov %i4, %o4 |
31 | srl %i1, 0, %o1 | 32 | srl %i1, 0, %o1 |
@@ -159,8 +160,10 @@ ret_from_solaris: | |||
159 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4 | 160 | stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] !npc = npc+4 |
160 | 161 | ||
161 | solaris_syscall_trace2: | 162 | solaris_syscall_trace2: |
163 | add %sp, PTREGS_OFF, %o0 | ||
162 | call syscall_trace | 164 | call syscall_trace |
163 | add %l1, 0x4, %l2 /* npc = npc+4 */ | 165 | mov 1, %o1 |
166 | add %l1, 0x4, %l2 /* npc = npc+4 */ | ||
164 | andcc %l1, 1, %g0 | 167 | andcc %l1, 1, %g0 |
165 | bne,pn %icc, 2b | 168 | bne,pn %icc, 2b |
166 | nop | 169 | nop |