Revert strace hiccups fix.
This reverts commit40138249c3
andffa9009c98
. 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>
This commit is contained in:
@@ -92,10 +92,8 @@ etrap_save: save %g2, -STACK_BIAS, %sp
|
||||
rdpr %wstate, %g2
|
||||
wrpr %g0, 0, %canrestore
|
||||
sll %g2, 3, %g2
|
||||
|
||||
/* Set TI_SYS_FPDEPTH to 1 and clear TI_SYS_NOERROR. */
|
||||
mov 1, %l5
|
||||
sth %l5, [%l6 + TI_SYS_NOERROR]
|
||||
stb %l5, [%l6 + TI_FPDEPTH]
|
||||
|
||||
wrpr %g3, 0, %otherwin
|
||||
wrpr %g2, 0, %wstate
|
||||
@@ -154,9 +152,7 @@ etrap_save: save %g2, -STACK_BIAS, %sp
|
||||
add %l6, TI_FPSAVED + 1, %l4
|
||||
srl %l5, 1, %l3
|
||||
add %l5, 2, %l5
|
||||
|
||||
/* Set TI_SYS_FPDEPTH to %l5 and clear TI_SYS_NOERROR. */
|
||||
sth %l5, [%l6 + TI_SYS_NOERROR]
|
||||
stb %l5, [%l6 + TI_FPDEPTH]
|
||||
ba,pt %xcc, 2b
|
||||
stb %g0, [%l4 + %l3]
|
||||
nop
|
||||
|
@@ -212,19 +212,24 @@ linux_sparc_syscall:
|
||||
3: stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
|
||||
ret_sys_call:
|
||||
ldx [%sp + PTREGS_OFF + PT_V9_TSTATE], %g3
|
||||
ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
|
||||
sra %o0, 0, %o0
|
||||
mov %ulo(TSTATE_XCARRY | TSTATE_ICARRY), %g2
|
||||
sllx %g2, 32, %g2
|
||||
|
||||
/* Check if force_successful_syscall_return()
|
||||
* was invoked.
|
||||
*/
|
||||
ldub [%g6 + TI_SYS_NOERROR], %l2
|
||||
brnz,a,pn %l2, 80f
|
||||
stb %g0, [%g6 + TI_SYS_NOERROR]
|
||||
|
||||
cmp %o0, -ERESTART_RESTARTBLOCK
|
||||
bgeu,pn %xcc, 1f
|
||||
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %g0
|
||||
ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
|
||||
|
||||
2:
|
||||
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
|
||||
80:
|
||||
/* System call success, clear Carry condition code. */
|
||||
andn %g3, %g2, %g3
|
||||
3:
|
||||
stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
|
||||
bne,pn %icc, linux_syscall_trace2
|
||||
add %l1, 0x4, %l2 ! npc = npc+4
|
||||
@@ -233,20 +238,20 @@ ret_sys_call:
|
||||
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
|
||||
|
||||
1:
|
||||
/* Check if force_successful_syscall_return()
|
||||
* was invoked.
|
||||
*/
|
||||
ldub [%g6 + TI_SYS_NOERROR], %l2
|
||||
brnz,pn %l2, 2b
|
||||
ldx [%sp + PTREGS_OFF + PT_V9_TNPC], %l1 ! pc = npc
|
||||
/* System call failure, set Carry condition code.
|
||||
* Also, get abs(errno) to return to the process.
|
||||
*/
|
||||
andcc %l0, (_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT|_TIF_SYSCALL_TRACEPOINT), %l6
|
||||
sub %g0, %o0, %o0
|
||||
or %g3, %g2, %g3
|
||||
stx %o0, [%sp + PTREGS_OFF + PT_V9_I0]
|
||||
ba,pt %xcc, 3b
|
||||
or %g3, %g2, %g3
|
||||
stx %g3, [%sp + PTREGS_OFF + PT_V9_TSTATE]
|
||||
bne,pn %icc, linux_syscall_trace2
|
||||
add %l1, 0x4, %l2 ! npc = npc+4
|
||||
stx %l1, [%sp + PTREGS_OFF + PT_V9_TPC]
|
||||
|
||||
b,pt %xcc, rtrap
|
||||
stx %l2, [%sp + PTREGS_OFF + PT_V9_TNPC]
|
||||
linux_syscall_trace2:
|
||||
call syscall_trace_leave
|
||||
add %sp, PTREGS_OFF, %o0
|
||||
|
@@ -2547,6 +2547,8 @@ void __init trap_init(void)
|
||||
TI_PRE_COUNT != offsetof(struct thread_info,
|
||||
preempt_count) ||
|
||||
TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
|
||||
TI_SYS_NOERROR != offsetof(struct thread_info,
|
||||
syscall_noerror) ||
|
||||
TI_RESTART_BLOCK != offsetof(struct thread_info,
|
||||
restart_block) ||
|
||||
TI_KUNA_REGS != offsetof(struct thread_info,
|
||||
|
Reference in New Issue
Block a user