aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-10-05 23:39:04 -0400
committerDavid S. Miller <davem@davemloft.net>2012-10-05 23:39:04 -0400
commit2863bc54ec03df7a6e2c48cff0477d7e2384efc9 (patch)
treedbb958102c32b9a48146c73f7b74685775920335 /arch/sparc/kernel
parent9f825962efdee5c2b22ac1f6cda50056336c06e1 (diff)
Revert strace hiccups fix.
This reverts commit 40138249c3b7a0762155216b963ec7fd4d09b5b4 and ffa9009c9828db3f74178e459cfbca6e77ff5dd9. There are problems with how the flag bytes were rearranged, in particular we really can't move values down into the lowest 16 bits since those are used for individual state bits. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/etrap_64.S8
-rw-r--r--arch/sparc/kernel/syscalls.S31
-rw-r--r--arch/sparc/kernel/traps_64.c2
3 files changed, 22 insertions, 19 deletions
diff --git a/arch/sparc/kernel/etrap_64.S b/arch/sparc/kernel/etrap_64.S
index 1276ca2567ba..786b185e6e3f 100644
--- a/arch/sparc/kernel/etrap_64.S
+++ b/arch/sparc/kernel/etrap_64.S
@@ -92,10 +92,8 @@ etrap_save: save %g2, -STACK_BIAS, %sp
92 rdpr %wstate, %g2 92 rdpr %wstate, %g2
93 wrpr %g0, 0, %canrestore 93 wrpr %g0, 0, %canrestore
94 sll %g2, 3, %g2 94 sll %g2, 3, %g2
95
96 /* Set TI_SYS_FPDEPTH to 1 and clear TI_SYS_NOERROR. */
97 mov 1, %l5 95 mov 1, %l5
98 sth %l5, [%l6 + TI_SYS_NOERROR] 96 stb %l5, [%l6 + TI_FPDEPTH]
99 97
100 wrpr %g3, 0, %otherwin 98 wrpr %g3, 0, %otherwin
101 wrpr %g2, 0, %wstate 99 wrpr %g2, 0, %wstate
@@ -154,9 +152,7 @@ etrap_save: save %g2, -STACK_BIAS, %sp
154 add %l6, TI_FPSAVED + 1, %l4 152 add %l6, TI_FPSAVED + 1, %l4
155 srl %l5, 1, %l3 153 srl %l5, 1, %l3
156 add %l5, 2, %l5 154 add %l5, 2, %l5
157 155 stb %l5, [%l6 + TI_FPDEPTH]
158 /* Set TI_SYS_FPDEPTH to %l5 and clear TI_SYS_NOERROR. */
159 sth %l5, [%l6 + TI_SYS_NOERROR]
160 ba,pt %xcc, 2b 156 ba,pt %xcc, 2b
161 stb %g0, [%l4 + %l3] 157 stb %g0, [%l4 + %l3]
162 nop 158 nop
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S
index b0ac10306425..1d7e274f3f2b 100644
--- a/arch/sparc/kernel/syscalls.S
+++ b/arch/sparc/kernel/syscalls.S
@@ -212,19 +212,24 @@ linux_sparc_syscall:
2123: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 2123: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
213ret_sys_call: 213ret_sys_call:
214 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3 214 ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
215 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
215 sra %o0, 0, %o0 216 sra %o0, 0, %o0
216 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2 217 mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
217 sllx %g2, 32, %g2 218 sllx %g2, 32, %g2
218 219
220 /* Check if force_successful_syscall_return()
221 * was invoked.
222 */
223 ldub [%g6 + TI_SYS_NOERROR], %l2
224 brnz,a,pn %l2, 80f
225 stb %g0, [%g6 + TI_SYS_NOERROR]
226
219 cmp %o0, -ERESTART_RESTARTBLOCK 227 cmp %o0, -ERESTART_RESTARTBLOCK
220 bgeu,pn %xcc, 1f 228 bgeu,pn %xcc, 1f
221 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0 229 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
222 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc 23080:
223
2242:
225 /* System call success, clear Carry condition code. */ 231 /* System call success, clear Carry condition code. */
226 andn %g3, %g2, %g3 232 andn %g3, %g2, %g3
2273:
228 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE] 233 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
229 bne,pn %icc, linux_syscall_trace2 234 bne,pn %icc, linux_syscall_trace2
230 add %l1, 0x4, %l2 ! npc = npc+4 235 add %l1, 0x4, %l2 ! npc = npc+4
@@ -233,20 +238,20 @@ ret_sys_call:
233 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC] 238 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
234 239
2351: 2401:
236 /* Check if force_successful_syscall_return()
237 * was invoked.
238 */
239 ldub [%g6 + TI_SYS_NOERROR], %l2
240 brnz,pn %l2, 2b
241 ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
242 /* System call failure, set Carry condition code. 241 /* System call failure, set Carry condition code.
243 * Also, get abs(errno) to return to the process. 242 * Also, get abs(errno) to return to the process.
244 */ 243 */
244 andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
245 sub %g0, %o0, %o0 245 sub %g0, %o0, %o0
246 or %g3, %g2, %g3
246 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0] 247 stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
247 ba,pt %xcc, 3b 248 stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
248 or %g3, %g2, %g3 249 bne,pn %icc, linux_syscall_trace2
250 add %l1, 0x4, %l2 ! npc = npc+4
251 stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
249 252
253 b,pt %xcc, rtrap
254 stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
250linux_syscall_trace2: 255linux_syscall_trace2:
251 call syscall_trace_leave 256 call syscall_trace_leave
252 add %sp, PTREGS_OFF, %o0 257 add %sp, PTREGS_OFF, %o0
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 82af591fe43f..fa1f1d375ffc 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -2547,6 +2547,8 @@ void __init trap_init(void)
2547 TI_PRE_COUNT != offsetof(struct thread_info, 2547 TI_PRE_COUNT != offsetof(struct thread_info,
2548 preempt_count) || 2548 preempt_count) ||
2549 TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2549 TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
2550 TI_SYS_NOERROR != offsetof(struct thread_info,
2551 syscall_noerror) ||
2550 TI_RESTART_BLOCK != offsetof(struct thread_info, 2552 TI_RESTART_BLOCK != offsetof(struct thread_info,
2551 restart_block) || 2553 restart_block) ||
2552 TI_KUNA_REGS != offsetof(struct thread_info, 2554 TI_KUNA_REGS != offsetof(struct thread_info,