diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-10-10 15:33:20 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-10-10 15:33:57 -0400 |
commit | 753c4dd6a2fa2af81f5d809d610d29f2d9dd9bc1 (patch) | |
tree | c6c1869a58357945e501b2eba3485ca154ee2f07 /arch/s390/kernel/entry.S | |
parent | d86730bb9597b02bff59a3a5a01c0094d71a265f (diff) |
[S390] ptrace changes
* System call parameter and result access functions
* Add tracehook calls
* Split syscall_trace into two functions do_syscall_trace_enter and
do_syscall_trace_exit
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/entry.S')
-rw-r--r-- | arch/s390/kernel/entry.S | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S index 708cf9cf9a35..ed500ef799b7 100644 --- a/arch/s390/kernel/entry.S +++ b/arch/s390/kernel/entry.S | |||
@@ -49,9 +49,9 @@ SP_ILC = STACK_FRAME_OVERHEAD + __PT_ILC | |||
49 | SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP | 49 | SP_TRAP = STACK_FRAME_OVERHEAD + __PT_TRAP |
50 | SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE | 50 | SP_SIZE = STACK_FRAME_OVERHEAD + __PT_SIZE |
51 | 51 | ||
52 | _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ | 52 | _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
53 | _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) | 53 | _TIF_MCCK_PENDING | _TIF_RESTART_SVC | _TIF_SINGLE_STEP ) |
54 | _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ | 54 | _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ |
55 | _TIF_MCCK_PENDING) | 55 | _TIF_MCCK_PENDING) |
56 | 56 | ||
57 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER | 57 | STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER |
@@ -318,6 +318,8 @@ sysc_work: | |||
318 | bo BASED(sysc_reschedule) | 318 | bo BASED(sysc_reschedule) |
319 | tm __TI_flags+3(%r9),_TIF_SIGPENDING | 319 | tm __TI_flags+3(%r9),_TIF_SIGPENDING |
320 | bnz BASED(sysc_sigpending) | 320 | bnz BASED(sysc_sigpending) |
321 | tm __TI_flags+3(%r9),_TIF_NOTIFY_RESUME | ||
322 | bnz BASED(sysc_notify_resume) | ||
321 | tm __TI_flags+3(%r9),_TIF_RESTART_SVC | 323 | tm __TI_flags+3(%r9),_TIF_RESTART_SVC |
322 | bo BASED(sysc_restart) | 324 | bo BASED(sysc_restart) |
323 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP | 325 | tm __TI_flags+3(%r9),_TIF_SINGLE_STEP |
@@ -356,6 +358,16 @@ sysc_sigpending: | |||
356 | b BASED(sysc_work_loop) | 358 | b BASED(sysc_work_loop) |
357 | 359 | ||
358 | # | 360 | # |
361 | # _TIF_NOTIFY_RESUME is set, call do_notify_resume | ||
362 | # | ||
363 | sysc_notify_resume: | ||
364 | la %r2,SP_PTREGS(%r15) # load pt_regs | ||
365 | l %r1,BASED(.Ldo_notify_resume) | ||
366 | la %r14,BASED(sysc_work_loop) | ||
367 | br %r1 # call do_notify_resume | ||
368 | |||
369 | |||
370 | # | ||
359 | # _TIF_RESTART_SVC is set, set up registers and restart svc | 371 | # _TIF_RESTART_SVC is set, set up registers and restart svc |
360 | # | 372 | # |
361 | sysc_restart: | 373 | sysc_restart: |
@@ -378,20 +390,21 @@ sysc_singlestep: | |||
378 | br %r1 # branch to do_single_step | 390 | br %r1 # branch to do_single_step |
379 | 391 | ||
380 | # | 392 | # |
381 | # call trace before and after sys_call | 393 | # call tracehook_report_syscall_entry/tracehook_report_syscall_exit before |
394 | # and after the system call | ||
382 | # | 395 | # |
383 | sysc_tracesys: | 396 | sysc_tracesys: |
384 | l %r1,BASED(.Ltrace) | 397 | l %r1,BASED(.Ltrace_entry) |
385 | la %r2,SP_PTREGS(%r15) # load pt_regs | 398 | la %r2,SP_PTREGS(%r15) # load pt_regs |
386 | la %r3,0 | 399 | la %r3,0 |
387 | srl %r7,2 | 400 | srl %r7,2 |
388 | st %r7,SP_R2(%r15) | 401 | st %r7,SP_R2(%r15) |
389 | basr %r14,%r1 | 402 | basr %r14,%r1 |
390 | clc SP_R2(4,%r15),BASED(.Lnr_syscalls) | 403 | cl %r2,BASED(.Lnr_syscalls) |
391 | bnl BASED(sysc_tracenogo) | 404 | bnl BASED(sysc_tracenogo) |
392 | l %r8,BASED(.Lsysc_table) | 405 | l %r8,BASED(.Lsysc_table) |
393 | l %r7,SP_R2(%r15) # strace might have changed the | 406 | lr %r7,%r2 |
394 | sll %r7,2 # system call | 407 | sll %r7,2 # *4 |
395 | l %r8,0(%r7,%r8) | 408 | l %r8,0(%r7,%r8) |
396 | sysc_tracego: | 409 | sysc_tracego: |
397 | lm %r3,%r6,SP_R3(%r15) | 410 | lm %r3,%r6,SP_R3(%r15) |
@@ -401,9 +414,8 @@ sysc_tracego: | |||
401 | sysc_tracenogo: | 414 | sysc_tracenogo: |
402 | tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) | 415 | tm __TI_flags+3(%r9),(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT) |
403 | bz BASED(sysc_return) | 416 | bz BASED(sysc_return) |
404 | l %r1,BASED(.Ltrace) | 417 | l %r1,BASED(.Ltrace_exit) |
405 | la %r2,SP_PTREGS(%r15) # load pt_regs | 418 | la %r2,SP_PTREGS(%r15) # load pt_regs |
406 | la %r3,1 | ||
407 | la %r14,BASED(sysc_return) | 419 | la %r14,BASED(sysc_return) |
408 | br %r1 | 420 | br %r1 |
409 | 421 | ||
@@ -666,6 +678,8 @@ io_work_loop: | |||
666 | bo BASED(io_reschedule) | 678 | bo BASED(io_reschedule) |
667 | tm __TI_flags+3(%r9),_TIF_SIGPENDING | 679 | tm __TI_flags+3(%r9),_TIF_SIGPENDING |
668 | bnz BASED(io_sigpending) | 680 | bnz BASED(io_sigpending) |
681 | tm __TI_flags+3(%r9),_TIF_NOTIFY_RESUME | ||
682 | bnz BASED(io_notify_resume) | ||
669 | b BASED(io_restore) | 683 | b BASED(io_restore) |
670 | io_work_done: | 684 | io_work_done: |
671 | 685 | ||
@@ -704,6 +718,19 @@ io_sigpending: | |||
704 | TRACE_IRQS_OFF | 718 | TRACE_IRQS_OFF |
705 | b BASED(io_work_loop) | 719 | b BASED(io_work_loop) |
706 | 720 | ||
721 | # | ||
722 | # _TIF_SIGPENDING is set, call do_signal | ||
723 | # | ||
724 | io_notify_resume: | ||
725 | TRACE_IRQS_ON | ||
726 | stosm __SF_EMPTY(%r15),0x03 # reenable interrupts | ||
727 | la %r2,SP_PTREGS(%r15) # load pt_regs | ||
728 | l %r1,BASED(.Ldo_notify_resume) | ||
729 | basr %r14,%r1 # call do_signal | ||
730 | stnsm __SF_EMPTY(%r15),0xfc # disable I/O and ext. interrupts | ||
731 | TRACE_IRQS_OFF | ||
732 | b BASED(io_work_loop) | ||
733 | |||
707 | /* | 734 | /* |
708 | * External interrupt handler routine | 735 | * External interrupt handler routine |
709 | */ | 736 | */ |
@@ -1070,6 +1097,8 @@ cleanup_io_leave_insn: | |||
1070 | .Ldo_IRQ: .long do_IRQ | 1097 | .Ldo_IRQ: .long do_IRQ |
1071 | .Ldo_extint: .long do_extint | 1098 | .Ldo_extint: .long do_extint |
1072 | .Ldo_signal: .long do_signal | 1099 | .Ldo_signal: .long do_signal |
1100 | .Ldo_notify_resume: | ||
1101 | .long do_notify_resume | ||
1073 | .Lhandle_per: .long do_single_step | 1102 | .Lhandle_per: .long do_single_step |
1074 | .Ldo_execve: .long do_execve | 1103 | .Ldo_execve: .long do_execve |
1075 | .Lexecve_tail: .long execve_tail | 1104 | .Lexecve_tail: .long execve_tail |
@@ -1079,7 +1108,8 @@ cleanup_io_leave_insn: | |||
1079 | .Lpreempt_schedule_irq: | 1108 | .Lpreempt_schedule_irq: |
1080 | .long preempt_schedule_irq | 1109 | .long preempt_schedule_irq |
1081 | #endif | 1110 | #endif |
1082 | .Ltrace: .long syscall_trace | 1111 | .Ltrace_entry: .long do_syscall_trace_enter |
1112 | .Ltrace_exit: .long do_syscall_trace_exit | ||
1083 | .Lschedtail: .long schedule_tail | 1113 | .Lschedtail: .long schedule_tail |
1084 | .Lsysc_table: .long sys_call_table | 1114 | .Lsysc_table: .long sys_call_table |
1085 | #ifdef CONFIG_TRACE_IRQFLAGS | 1115 | #ifdef CONFIG_TRACE_IRQFLAGS |