diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-07-28 17:32:00 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-28 17:32:00 -0400 |
commit | 9e3ee1c39c0cc71222f9980ccbf87fe072897eef (patch) | |
tree | 99462000e6f0d4f907cb2fc690f19d4d441ba0f3 /arch/sparc64/kernel | |
parent | e56b3bc7942982ac2589c942fb345e38bc7a341a (diff) | |
parent | f934fb19ef34730263e6afc01e8ec27a8a71470f (diff) |
Merge branch 'linus' into cpus4096
Conflicts:
kernel/stop_machine.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r-- | arch/sparc64/kernel/compat_audit.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/entry.h | 3 | ||||
-rw-r--r-- | arch/sparc64/kernel/ptrace.c | 32 | ||||
-rw-r--r-- | arch/sparc64/kernel/rtrap.S | 6 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal.c | 8 | ||||
-rw-r--r-- | arch/sparc64/kernel/signal32.c | 3 | ||||
-rw-r--r-- | arch/sparc64/kernel/syscalls.S | 4 |
7 files changed, 32 insertions, 26 deletions
diff --git a/arch/sparc64/kernel/compat_audit.c b/arch/sparc64/kernel/compat_audit.c index c1979482aa92..c831b0a4e660 100644 --- a/arch/sparc64/kernel/compat_audit.c +++ b/arch/sparc64/kernel/compat_audit.c | |||
@@ -1,4 +1,4 @@ | |||
1 | #include <asm-sparc/unistd.h> | 1 | #include <asm/unistd_32.h> |
2 | 2 | ||
3 | unsigned sparc32_dir_class[] = { | 3 | unsigned sparc32_dir_class[] = { |
4 | #include <asm-generic/audit_dir_write.h> | 4 | #include <asm-generic/audit_dir_write.h> |
diff --git a/arch/sparc64/kernel/entry.h b/arch/sparc64/kernel/entry.h index 32fbab620852..fc294a292899 100644 --- a/arch/sparc64/kernel/entry.h +++ b/arch/sparc64/kernel/entry.h | |||
@@ -22,8 +22,7 @@ extern void do_notify_resume(struct pt_regs *regs, | |||
22 | unsigned long orig_i0, | 22 | unsigned long orig_i0, |
23 | unsigned long thread_info_flags); | 23 | unsigned long thread_info_flags); |
24 | 24 | ||
25 | extern asmlinkage void syscall_trace(struct pt_regs *regs, | 25 | extern asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p); |
26 | int syscall_exit_p); | ||
27 | 26 | ||
28 | extern void bad_trap_tl1(struct pt_regs *regs, long lvl); | 27 | extern void bad_trap_tl1(struct pt_regs *regs, long lvl); |
29 | 28 | ||
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index f6c9fc92921d..bd578cc4856d 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/audit.h> | 23 | #include <linux/audit.h> |
24 | #include <linux/signal.h> | 24 | #include <linux/signal.h> |
25 | #include <linux/regset.h> | 25 | #include <linux/regset.h> |
26 | #include <linux/tracehook.h> | ||
26 | #include <linux/compat.h> | 27 | #include <linux/compat.h> |
27 | #include <linux/elf.h> | 28 | #include <linux/elf.h> |
28 | 29 | ||
@@ -1049,8 +1050,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
1049 | return ret; | 1050 | return ret; |
1050 | } | 1051 | } |
1051 | 1052 | ||
1052 | asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p) | 1053 | asmlinkage int syscall_trace(struct pt_regs *regs, int syscall_exit_p) |
1053 | { | 1054 | { |
1055 | int ret = 0; | ||
1056 | |||
1054 | /* do the secure computing check first */ | 1057 | /* do the secure computing check first */ |
1055 | secure_computing(regs->u_regs[UREG_G1]); | 1058 | secure_computing(regs->u_regs[UREG_G1]); |
1056 | 1059 | ||
@@ -1064,27 +1067,14 @@ asmlinkage void syscall_trace(struct pt_regs *regs, int syscall_exit_p) | |||
1064 | audit_syscall_exit(result, regs->u_regs[UREG_I0]); | 1067 | audit_syscall_exit(result, regs->u_regs[UREG_I0]); |
1065 | } | 1068 | } |
1066 | 1069 | ||
1067 | if (!(current->ptrace & PT_PTRACED)) | 1070 | if (test_thread_flag(TIF_SYSCALL_TRACE)) { |
1068 | goto out; | 1071 | if (syscall_exit_p) |
1069 | 1072 | tracehook_report_syscall_exit(regs, 0); | |
1070 | if (!test_thread_flag(TIF_SYSCALL_TRACE)) | 1073 | else |
1071 | goto out; | 1074 | ret = tracehook_report_syscall_entry(regs); |
1072 | |||
1073 | ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) | ||
1074 | ? 0x80 : 0)); | ||
1075 | |||
1076 | /* | ||
1077 | * this isn't the same as continuing with a signal, but it will do | ||
1078 | * for normal use. strace only continues with a signal if the | ||
1079 | * stopping signal is not SIGTRAP. -brl | ||
1080 | */ | ||
1081 | if (current->exit_code) { | ||
1082 | send_sig(current->exit_code, current, 1); | ||
1083 | current->exit_code = 0; | ||
1084 | } | 1075 | } |
1085 | 1076 | ||
1086 | out: | 1077 | if (unlikely(current->audit_context) && !syscall_exit_p && !ret) |
1087 | if (unlikely(current->audit_context) && !syscall_exit_p) | ||
1088 | audit_syscall_entry((test_thread_flag(TIF_32BIT) ? | 1078 | audit_syscall_entry((test_thread_flag(TIF_32BIT) ? |
1089 | AUDIT_ARCH_SPARC : | 1079 | AUDIT_ARCH_SPARC : |
1090 | AUDIT_ARCH_SPARC64), | 1080 | AUDIT_ARCH_SPARC64), |
@@ -1093,4 +1083,6 @@ out: | |||
1093 | regs->u_regs[UREG_I1], | 1083 | regs->u_regs[UREG_I1], |
1094 | regs->u_regs[UREG_I2], | 1084 | regs->u_regs[UREG_I2], |
1095 | regs->u_regs[UREG_I3]); | 1085 | regs->u_regs[UREG_I3]); |
1086 | |||
1087 | return ret; | ||
1096 | } | 1088 | } |
diff --git a/arch/sparc64/kernel/rtrap.S b/arch/sparc64/kernel/rtrap.S index c6fc695fe1fe..97a993c1f7f3 100644 --- a/arch/sparc64/kernel/rtrap.S +++ b/arch/sparc64/kernel/rtrap.S | |||
@@ -46,7 +46,7 @@ __handle_user_windows: | |||
46 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | 46 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate |
47 | ldx [%g6 + TI_FLAGS], %l0 | 47 | ldx [%g6 + TI_FLAGS], %l0 |
48 | 48 | ||
49 | 1: andcc %l0, _TIF_SIGPENDING, %g0 | 49 | 1: andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 |
50 | be,pt %xcc, __handle_user_windows_continue | 50 | be,pt %xcc, __handle_user_windows_continue |
51 | nop | 51 | nop |
52 | mov %l5, %o1 | 52 | mov %l5, %o1 |
@@ -86,7 +86,7 @@ __handle_perfctrs: | |||
86 | wrpr %g0, RTRAP_PSTATE, %pstate | 86 | wrpr %g0, RTRAP_PSTATE, %pstate |
87 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate | 87 | wrpr %g0, RTRAP_PSTATE_IRQOFF, %pstate |
88 | ldx [%g6 + TI_FLAGS], %l0 | 88 | ldx [%g6 + TI_FLAGS], %l0 |
89 | 1: andcc %l0, _TIF_SIGPENDING, %g0 | 89 | 1: andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 |
90 | 90 | ||
91 | be,pt %xcc, __handle_perfctrs_continue | 91 | be,pt %xcc, __handle_perfctrs_continue |
92 | sethi %hi(TSTATE_PEF), %o0 | 92 | sethi %hi(TSTATE_PEF), %o0 |
@@ -195,7 +195,7 @@ __handle_preemption_continue: | |||
195 | andcc %l1, %o0, %g0 | 195 | andcc %l1, %o0, %g0 |
196 | andcc %l0, _TIF_NEED_RESCHED, %g0 | 196 | andcc %l0, _TIF_NEED_RESCHED, %g0 |
197 | bne,pn %xcc, __handle_preemption | 197 | bne,pn %xcc, __handle_preemption |
198 | andcc %l0, _TIF_SIGPENDING, %g0 | 198 | andcc %l0, _TIF_DO_NOTIFY_RESUME_MASK, %g0 |
199 | bne,pn %xcc, __handle_signal | 199 | bne,pn %xcc, __handle_signal |
200 | __handle_signal_continue: | 200 | __handle_signal_continue: |
201 | ldub [%g6 + TI_WSAVED], %o2 | 201 | ldub [%g6 + TI_WSAVED], %o2 |
diff --git a/arch/sparc64/kernel/signal.c b/arch/sparc64/kernel/signal.c index 9667e96fd513..d1b84456a9ee 100644 --- a/arch/sparc64/kernel/signal.c +++ b/arch/sparc64/kernel/signal.c | |||
@@ -17,11 +17,13 @@ | |||
17 | #include <linux/errno.h> | 17 | #include <linux/errno.h> |
18 | #include <linux/wait.h> | 18 | #include <linux/wait.h> |
19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
20 | #include <linux/tracehook.h> | ||
20 | #include <linux/unistd.h> | 21 | #include <linux/unistd.h> |
21 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
22 | #include <linux/tty.h> | 23 | #include <linux/tty.h> |
23 | #include <linux/binfmts.h> | 24 | #include <linux/binfmts.h> |
24 | #include <linux/bitops.h> | 25 | #include <linux/bitops.h> |
26 | #include <linux/tracehook.h> | ||
25 | 27 | ||
26 | #include <asm/uaccess.h> | 28 | #include <asm/uaccess.h> |
27 | #include <asm/ptrace.h> | 29 | #include <asm/ptrace.h> |
@@ -574,6 +576,8 @@ static void do_signal(struct pt_regs *regs, unsigned long orig_i0) | |||
574 | * clear the TS_RESTORE_SIGMASK flag. | 576 | * clear the TS_RESTORE_SIGMASK flag. |
575 | */ | 577 | */ |
576 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 578 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
579 | |||
580 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
577 | return; | 581 | return; |
578 | } | 582 | } |
579 | if (restart_syscall && | 583 | if (restart_syscall && |
@@ -605,4 +609,8 @@ void do_notify_resume(struct pt_regs *regs, unsigned long orig_i0, unsigned long | |||
605 | { | 609 | { |
606 | if (thread_info_flags & _TIF_SIGPENDING) | 610 | if (thread_info_flags & _TIF_SIGPENDING) |
607 | do_signal(regs, orig_i0); | 611 | do_signal(regs, orig_i0); |
612 | if (thread_info_flags & _TIF_NOTIFY_RESUME) { | ||
613 | clear_thread_flag(TIF_NOTIFY_RESUME); | ||
614 | tracehook_notify_resume(regs); | ||
615 | } | ||
608 | } | 616 | } |
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c index 97cdd1bf4a10..ba5b09ad6666 100644 --- a/arch/sparc64/kernel/signal32.c +++ b/arch/sparc64/kernel/signal32.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/binfmts.h> | 19 | #include <linux/binfmts.h> |
20 | #include <linux/compat.h> | 20 | #include <linux/compat.h> |
21 | #include <linux/bitops.h> | 21 | #include <linux/bitops.h> |
22 | #include <linux/tracehook.h> | ||
22 | 23 | ||
23 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
24 | #include <asm/ptrace.h> | 25 | #include <asm/ptrace.h> |
@@ -794,6 +795,8 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs, | |||
794 | * clear the TS_RESTORE_SIGMASK flag. | 795 | * clear the TS_RESTORE_SIGMASK flag. |
795 | */ | 796 | */ |
796 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | 797 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; |
798 | |||
799 | tracehook_signal_handler(signr, &info, &ka, regs, 0); | ||
797 | return; | 800 | return; |
798 | } | 801 | } |
799 | if (restart_syscall && | 802 | if (restart_syscall && |
diff --git a/arch/sparc64/kernel/syscalls.S b/arch/sparc64/kernel/syscalls.S index db19ed67acf6..a2f24270ed8a 100644 --- a/arch/sparc64/kernel/syscalls.S +++ b/arch/sparc64/kernel/syscalls.S | |||
@@ -162,6 +162,8 @@ linux_syscall_trace32: | |||
162 | add %sp, PTREGS_OFF, %o0 | 162 | add %sp, PTREGS_OFF, %o0 |
163 | call syscall_trace | 163 | call syscall_trace |
164 | clr %o1 | 164 | clr %o1 |
165 | brnz,pn %o0, 3f | ||
166 | mov -ENOSYS, %o0 | ||
165 | srl %i0, 0, %o0 | 167 | srl %i0, 0, %o0 |
166 | srl %i4, 0, %o4 | 168 | srl %i4, 0, %o4 |
167 | srl %i1, 0, %o1 | 169 | srl %i1, 0, %o1 |
@@ -173,6 +175,8 @@ linux_syscall_trace: | |||
173 | add %sp, PTREGS_OFF, %o0 | 175 | add %sp, PTREGS_OFF, %o0 |
174 | call syscall_trace | 176 | call syscall_trace |
175 | clr %o1 | 177 | clr %o1 |
178 | brnz,pn %o0, 3f | ||
179 | mov -ENOSYS, %o0 | ||
176 | mov %i0, %o0 | 180 | mov %i0, %o0 |
177 | mov %i1, %o1 | 181 | mov %i1, %o1 |
178 | mov %i2, %o2 | 182 | mov %i2, %o2 |