diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-03-29 16:11:09 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-04-02 12:13:36 -0400 |
commit | 2858f856021340f3730fa8639dd520a2e4331f7f (patch) | |
tree | 5dec3cf9478a9507adf8cae7834eca1da3da6778 /arch/tile | |
parent | cb210ee3a81afab7c64777635cc18899a2bdd9a5 (diff) |
arch/tile: fix single-stepping over swint1 instructions on tilegx
If we are single-stepping and make a syscall, we call ptrace_notify()
explicitly on the return path back to user space, since we are returning
to a pc value set artificially to the next instruction, and otherwise
we won't register that we stepped over the syscall instruction (swint1).
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'arch/tile')
-rw-r--r-- | arch/tile/kernel/intvec_64.S | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index 005535d108c1..fdff17c70cc8 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/irqflags.h> | 22 | #include <asm/irqflags.h> |
23 | #include <asm/asm-offsets.h> | 23 | #include <asm/asm-offsets.h> |
24 | #include <asm/types.h> | 24 | #include <asm/types.h> |
25 | #include <asm/signal.h> | ||
25 | #include <hv/hypervisor.h> | 26 | #include <hv/hypervisor.h> |
26 | #include <arch/abi.h> | 27 | #include <arch/abi.h> |
27 | #include <arch/interrupts.h> | 28 | #include <arch/interrupts.h> |
@@ -1039,11 +1040,25 @@ handle_syscall: | |||
1039 | 1040 | ||
1040 | /* Do syscall trace again, if requested. */ | 1041 | /* Do syscall trace again, if requested. */ |
1041 | ld r30, r31 | 1042 | ld r30, r31 |
1042 | andi r30, r30, _TIF_SYSCALL_TRACE | 1043 | andi r0, r30, _TIF_SYSCALL_TRACE |
1043 | beqzt r30, 1f | 1044 | { |
1045 | andi r0, r30, _TIF_SINGLESTEP | ||
1046 | beqzt r0, 1f | ||
1047 | } | ||
1044 | jal do_syscall_trace | 1048 | jal do_syscall_trace |
1045 | FEEDBACK_REENTER(handle_syscall) | 1049 | FEEDBACK_REENTER(handle_syscall) |
1046 | 1: j .Lresume_userspace /* jump into middle of interrupt_return */ | 1050 | andi r0, r30, _TIF_SINGLESTEP |
1051 | |||
1052 | 1: beqzt r0, 2f | ||
1053 | |||
1054 | /* Single stepping -- notify ptrace. */ | ||
1055 | { | ||
1056 | movei r0, SIGTRAP | ||
1057 | jal ptrace_notify | ||
1058 | } | ||
1059 | FEEDBACK_REENTER(handle_syscall) | ||
1060 | |||
1061 | 2: j .Lresume_userspace /* jump into middle of interrupt_return */ | ||
1047 | 1062 | ||
1048 | .Lcompat_syscall: | 1063 | .Lcompat_syscall: |
1049 | /* | 1064 | /* |