aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-10-11 21:49:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-11 21:49:08 -0400
commit8213a2f3eeafdecf06dd718cb4130372263f6067 (patch)
tree0d02e3201dac64d1429f8552ee1163d4a1ef1646 /arch/alpha
parent40924754f2cabd5d9af4bcd4dcecc362b5e0baa1 (diff)
parent12f79be93d94698778ff2b3f921073fc5f6780d6 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal
Pull pile 2 of execve and kernel_thread unification work from Al Viro: "Stuff in there: kernel_thread/kernel_execve/sys_execve conversions for several more architectures plus assorted signal fixes and cleanups. There'll be more (in particular, real fixes for the alpha do_notify_resume() irq mess)..." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal: (43 commits) alpha: don't open-code trace_report_syscall_{enter,exit} Uninclude linux/freezer.h m32r: trim masks avr32: trim masks tile: don't bother with SIGTRAP in setup_frame microblaze: don't bother with SIGTRAP in setup_rt_frame() mn10300: don't bother with SIGTRAP in setup_frame() frv: no need to raise SIGTRAP in setup_frame() x86: get rid of duplicate code in case of CONFIG_VM86 unicore32: remove pointless test h8300: trim _TIF_WORK_MASK parisc: decide whether to go to slow path (tracesys) based on thread flags parisc: don't bother looping in do_signal() parisc: fix double restarts bury the rest of TIF_IRET sanitize tsk_is_polling() bury _TIF_RESTORE_SIGMASK unicore32: unobfuscate _TIF_WORK_MASK mips: NOTIFY_RESUME is not needed in TIF masks mips: merge the identical "return from syscall" per-ABI code ... Conflicts: arch/arm/include/asm/thread_info.h
Diffstat (limited to 'arch/alpha')
-rw-r--r--arch/alpha/include/asm/thread_info.h3
-rw-r--r--arch/alpha/kernel/entry.S13
-rw-r--r--arch/alpha/kernel/ptrace.c32
3 files changed, 21 insertions, 27 deletions
diff --git a/arch/alpha/include/asm/thread_info.h b/arch/alpha/include/asm/thread_info.h
index 28335bd40e40..4554ecbff7c6 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -84,7 +84,6 @@ register struct thread_info *__current_thread_info __asm__("$8");
84#define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 84#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
85#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 85#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
86#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 86#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
87#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
88#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) 87#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
89 88
90/* Work to do on interrupt/exception return. */ 89/* Work to do on interrupt/exception return. */
@@ -117,5 +116,7 @@ register struct thread_info *__current_thread_info __asm__("$8");
117 (int __user *)(value)); \ 116 (int __user *)(value)); \
118 }) 117 })
119 118
119#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG)
120
120#endif /* __KERNEL__ */ 121#endif /* __KERNEL__ */
121#endif /* _ALPHA_THREAD_INFO_H */ 122#endif /* _ALPHA_THREAD_INFO_H */
diff --git a/arch/alpha/kernel/entry.S b/arch/alpha/kernel/entry.S
index 7e43e1156d10..2a359c9ee3cd 100644
--- a/arch/alpha/kernel/entry.S
+++ b/arch/alpha/kernel/entry.S
@@ -418,11 +418,10 @@ $work_notifysig:
418strace: 418strace:
419 /* set up signal stack, call syscall_trace */ 419 /* set up signal stack, call syscall_trace */
420 bsr $1, do_switch_stack 420 bsr $1, do_switch_stack
421 jsr $26, syscall_trace 421 jsr $26, syscall_trace_enter /* returns the syscall number */
422 bsr $1, undo_switch_stack 422 bsr $1, undo_switch_stack
423 423
424 /* get the system call number and the arguments back.. */ 424 /* get the arguments back.. */
425 ldq $0, 0($sp)
426 ldq $16, SP_OFF+24($sp) 425 ldq $16, SP_OFF+24($sp)
427 ldq $17, SP_OFF+32($sp) 426 ldq $17, SP_OFF+32($sp)
428 ldq $18, SP_OFF+40($sp) 427 ldq $18, SP_OFF+40($sp)
@@ -449,7 +448,7 @@ $strace_success:
449 stq $0, 0($sp) /* save return value */ 448 stq $0, 0($sp) /* save return value */
450 449
451 bsr $1, do_switch_stack 450 bsr $1, do_switch_stack
452 jsr $26, syscall_trace 451 jsr $26, syscall_trace_leave
453 bsr $1, undo_switch_stack 452 bsr $1, undo_switch_stack
454 br $31, ret_from_sys_call 453 br $31, ret_from_sys_call
455 454
@@ -467,7 +466,7 @@ $strace_error:
467 bsr $1, do_switch_stack 466 bsr $1, do_switch_stack
468 mov $19, $9 /* save old syscall number */ 467 mov $19, $9 /* save old syscall number */
469 mov $20, $10 /* save old a3 */ 468 mov $20, $10 /* save old a3 */
470 jsr $26, syscall_trace 469 jsr $26, syscall_trace_leave
471 mov $9, $19 470 mov $9, $19
472 mov $10, $20 471 mov $10, $20
473 bsr $1, undo_switch_stack 472 bsr $1, undo_switch_stack
@@ -698,7 +697,7 @@ sys_sigreturn:
698 lda $sp, -SWITCH_STACK_SIZE($sp) 697 lda $sp, -SWITCH_STACK_SIZE($sp)
699 jsr $26, do_sigreturn 698 jsr $26, do_sigreturn
700 bne $9, 1f 699 bne $9, 1f
701 jsr $26, syscall_trace 700 jsr $26, syscall_trace_leave
7021: br $1, undo_switch_stack 7011: br $1, undo_switch_stack
703 br ret_from_sys_call 702 br ret_from_sys_call
704.end sys_sigreturn 703.end sys_sigreturn
@@ -715,7 +714,7 @@ sys_rt_sigreturn:
715 lda $sp, -SWITCH_STACK_SIZE($sp) 714 lda $sp, -SWITCH_STACK_SIZE($sp)
716 jsr $26, do_rt_sigreturn 715 jsr $26, do_rt_sigreturn
717 bne $9, 1f 716 bne $9, 1f
718 jsr $26, syscall_trace 717 jsr $26, syscall_trace_leave
7191: br $1, undo_switch_stack 7181: br $1, undo_switch_stack
720 br ret_from_sys_call 719 br ret_from_sys_call
721.end sys_rt_sigreturn 720.end sys_rt_sigreturn
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c
index 54616f496aed..2a4a80ff4a20 100644
--- a/arch/alpha/kernel/ptrace.c
+++ b/arch/alpha/kernel/ptrace.c
@@ -13,6 +13,7 @@
13#include <linux/user.h> 13#include <linux/user.h>
14#include <linux/security.h> 14#include <linux/security.h>
15#include <linux/signal.h> 15#include <linux/signal.h>
16#include <linux/tracehook.h>
16 17
17#include <asm/uaccess.h> 18#include <asm/uaccess.h>
18#include <asm/pgtable.h> 19#include <asm/pgtable.h>
@@ -312,25 +313,18 @@ long arch_ptrace(struct task_struct *child, long request,
312 return ret; 313 return ret;
313} 314}
314 315
316asmlinkage unsigned long syscall_trace_enter(void)
317{
318 unsigned long ret = 0;
319 if (test_thread_flag(TIF_SYSCALL_TRACE) &&
320 tracehook_report_syscall_entry(current_pt_regs()))
321 ret = -1UL;
322 return ret ?: current_pt_regs()->r0;
323}
324
315asmlinkage void 325asmlinkage void
316syscall_trace(void) 326syscall_trace_leave(void)
317{ 327{
318 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 328 if (test_thread_flag(TIF_SYSCALL_TRACE))
319 return; 329 tracehook_report_syscall_exit(current_pt_regs(), 0);
320 if (!(current->ptrace & PT_PTRACED))
321 return;
322 /* The 0x80 provides a way for the tracing parent to distinguish
323 between a syscall stop and SIGTRAP delivery */
324 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
325 ? 0x80 : 0));
326
327 /*
328 * This isn't the same as continuing with a signal, but it will do
329 * for normal use. strace only continues with a signal if the
330 * stopping signal is not SIGTRAP. -brl
331 */
332 if (current->exit_code) {
333 send_sig(current->exit_code, current, 1);
334 current->exit_code = 0;
335 }
336} 330}