diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-04 16:52:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-04 17:13:29 -0400 |
commit | 40138249c3b7a0762155216b963ec7fd4d09b5b4 (patch) | |
tree | be0a2441aa7f7b3245e6de70cc4a8055031742f8 /arch/sparc/kernel | |
parent | ecefbd94b834fa32559d854646d777c56749ef1c (diff) |
sparc64: Rearrange thread info to cheaply clear syscall noerror state.
After fixing a couple of brainos, it even seems to work. What's done here
is move of ->syscall_noerror right before FPDEPTH byte in ->flags and
using sth to [%g6 + TI_SYS_NOERROR] instead of stb to [%g6 + TI_FPDEPTH] in
both branches of etrap_save. AFAICS, that ought to be solid. Again,
deciding what to do with now unused delay slot of branch on ->syscall_noerror
and dealing with the order of tests in ret_from_sys is a separate question,
but at least that way we don't have to clean ->syscall_noerror in there at
all. AFAICS, it ought to be a clear win - sth is not going to cost more than
stb on etrap_64.S side of things, and we are losing write on syscalls.S one.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/etrap_64.S | 8 | ||||
-rw-r--r-- | arch/sparc/kernel/syscalls.S | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/traps_64.c | 2 |
3 files changed, 8 insertions, 6 deletions
diff --git a/arch/sparc/kernel/etrap_64.S b/arch/sparc/kernel/etrap_64.S index 786b185e6e3..1276ca2567b 100644 --- a/arch/sparc/kernel/etrap_64.S +++ b/arch/sparc/kernel/etrap_64.S | |||
@@ -92,8 +92,10 @@ 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. */ | ||
95 | mov 1, %l5 | 97 | mov 1, %l5 |
96 | stb %l5, [%l6 + TI_FPDEPTH] | 98 | sth %l5, [%l6 + TI_SYS_NOERROR] |
97 | 99 | ||
98 | wrpr %g3, 0, %otherwin | 100 | wrpr %g3, 0, %otherwin |
99 | wrpr %g2, 0, %wstate | 101 | wrpr %g2, 0, %wstate |
@@ -152,7 +154,9 @@ etrap_save: save %g2, -STACK_BIAS, %sp | |||
152 | add %l6, TI_FPSAVED + 1, %l4 | 154 | add %l6, TI_FPSAVED + 1, %l4 |
153 | srl %l5, 1, %l3 | 155 | srl %l5, 1, %l3 |
154 | add %l5, 2, %l5 | 156 | add %l5, 2, %l5 |
155 | stb %l5, [%l6 + TI_FPDEPTH] | 157 | |
158 | /* Set TI_SYS_FPDEPTH to %l5 and clear TI_SYS_NOERROR. */ | ||
159 | sth %l5, [%l6 + TI_SYS_NOERROR] | ||
156 | ba,pt %xcc, 2b | 160 | ba,pt %xcc, 2b |
157 | stb %g0, [%l4 + %l3] | 161 | stb %g0, [%l4 + %l3] |
158 | nop | 162 | nop |
diff --git a/arch/sparc/kernel/syscalls.S b/arch/sparc/kernel/syscalls.S index 1d7e274f3f2..ed277e2fdfc 100644 --- a/arch/sparc/kernel/syscalls.S +++ b/arch/sparc/kernel/syscalls.S | |||
@@ -221,8 +221,8 @@ ret_sys_call: | |||
221 | * was invoked. | 221 | * was invoked. |
222 | */ | 222 | */ |
223 | ldub [%g6 + TI_SYS_NOERROR], %l2 | 223 | ldub [%g6 + TI_SYS_NOERROR], %l2 |
224 | brnz,a,pn %l2, 80f | 224 | brnz,pn %l2, 80f |
225 | stb %g0, [%g6 + TI_SYS_NOERROR] | 225 | nop |
226 | 226 | ||
227 | cmp %o0, -ERESTART_RESTARTBLOCK | 227 | cmp %o0, -ERESTART_RESTARTBLOCK |
228 | bgeu,pn %xcc, 1f | 228 | bgeu,pn %xcc, 1f |
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c index fa1f1d375ff..82af591fe43 100644 --- a/arch/sparc/kernel/traps_64.c +++ b/arch/sparc/kernel/traps_64.c | |||
@@ -2547,8 +2547,6 @@ 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) || | ||
2552 | TI_RESTART_BLOCK != offsetof(struct thread_info, | 2550 | TI_RESTART_BLOCK != offsetof(struct thread_info, |
2553 | restart_block) || | 2551 | restart_block) || |
2554 | TI_KUNA_REGS != offsetof(struct thread_info, | 2552 | TI_KUNA_REGS != offsetof(struct thread_info, |