diff options
Diffstat (limited to 'arch/mips/kernel')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/irixsig.c | 4 | ||||
-rw-r--r-- | arch/mips/kernel/scall32-o32.S | 18 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-64.S | 18 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 4 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 4 | ||||
-rw-r--r-- | arch/mips/kernel/signal.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/signal32.c | 2 | ||||
-rw-r--r-- | arch/mips/kernel/traps.c | 5 |
9 files changed, 19 insertions, 42 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index a263fb7a3971..5e1b08b00a33 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -417,7 +417,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) | |||
417 | case PRID_IMP_R10000: | 417 | case PRID_IMP_R10000: |
418 | c->cputype = CPU_R10000; | 418 | c->cputype = CPU_R10000; |
419 | c->isa_level = MIPS_CPU_ISA_IV; | 419 | c->isa_level = MIPS_CPU_ISA_IV; |
420 | c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | | 420 | c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | |
421 | MIPS_CPU_FPU | MIPS_CPU_32FPR | | 421 | MIPS_CPU_FPU | MIPS_CPU_32FPR | |
422 | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | | 422 | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | |
423 | MIPS_CPU_LLSC; | 423 | MIPS_CPU_LLSC; |
@@ -426,7 +426,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c) | |||
426 | case PRID_IMP_R12000: | 426 | case PRID_IMP_R12000: |
427 | c->cputype = CPU_R12000; | 427 | c->cputype = CPU_R12000; |
428 | c->isa_level = MIPS_CPU_ISA_IV; | 428 | c->isa_level = MIPS_CPU_ISA_IV; |
429 | c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX | | 429 | c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | |
430 | MIPS_CPU_FPU | MIPS_CPU_32FPR | | 430 | MIPS_CPU_FPU | MIPS_CPU_32FPR | |
431 | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | | 431 | MIPS_CPU_COUNTER | MIPS_CPU_WATCH | |
432 | MIPS_CPU_LLSC; | 432 | MIPS_CPU_LLSC; |
diff --git a/arch/mips/kernel/irixsig.c b/arch/mips/kernel/irixsig.c index dd118c60bcd0..08273a2a501d 100644 --- a/arch/mips/kernel/irixsig.c +++ b/arch/mips/kernel/irixsig.c | |||
@@ -279,8 +279,6 @@ irix_sigreturn(struct pt_regs *regs) | |||
279 | /* | 279 | /* |
280 | * Don't let your children do this ... | 280 | * Don't let your children do this ... |
281 | */ | 281 | */ |
282 | if (current_thread_info()->flags & TIF_SYSCALL_TRACE) | ||
283 | do_syscall_trace(regs, 1); | ||
284 | __asm__ __volatile__( | 282 | __asm__ __volatile__( |
285 | "move\t$29,%0\n\t" | 283 | "move\t$29,%0\n\t" |
286 | "j\tsyscall_exit" | 284 | "j\tsyscall_exit" |
@@ -783,8 +781,6 @@ asmlinkage void irix_setcontext(struct pt_regs *regs) | |||
783 | /* | 781 | /* |
784 | * Don't let your children do this ... | 782 | * Don't let your children do this ... |
785 | */ | 783 | */ |
786 | if (current_thread_info()->flags & TIF_SYSCALL_TRACE) | ||
787 | do_syscall_trace(regs, 1); | ||
788 | __asm__ __volatile__( | 784 | __asm__ __volatile__( |
789 | "move\t$29,%0\n\t" | 785 | "move\t$29,%0\n\t" |
790 | "j\tsyscall_exit" | 786 | "j\tsyscall_exit" |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 4dd8e8b4fbc2..a42e0e8caa7b 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -94,11 +94,13 @@ syscall_trace_entry: | |||
94 | li a1, 0 | 94 | li a1, 0 |
95 | jal do_syscall_trace | 95 | jal do_syscall_trace |
96 | 96 | ||
97 | move t0, s0 | ||
98 | RESTORE_STATIC | ||
97 | lw a0, PT_R4(sp) # Restore argument registers | 99 | lw a0, PT_R4(sp) # Restore argument registers |
98 | lw a1, PT_R5(sp) | 100 | lw a1, PT_R5(sp) |
99 | lw a2, PT_R6(sp) | 101 | lw a2, PT_R6(sp) |
100 | lw a3, PT_R7(sp) | 102 | lw a3, PT_R7(sp) |
101 | jalr s0 | 103 | jalr t0 |
102 | 104 | ||
103 | li t0, -EMAXERRNO - 1 # error? | 105 | li t0, -EMAXERRNO - 1 # error? |
104 | sltu t0, t0, v0 | 106 | sltu t0, t0, v0 |
@@ -241,19 +243,7 @@ illegal_syscall: | |||
241 | sw zero, PT_R7(sp) # success | 243 | sw zero, PT_R7(sp) # success |
242 | sw v0, PT_R2(sp) # result | 244 | sw v0, PT_R2(sp) # result |
243 | 245 | ||
244 | /* Success, so skip usual error handling garbage. */ | 246 | j o32_syscall_exit # continue like a normal syscall |
245 | lw a2, TI_FLAGS($28) # syscall tracing enabled? | ||
246 | li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | ||
247 | and t0, a2, t0 | ||
248 | bnez t0, 1f | ||
249 | |||
250 | j o32_syscall_exit | ||
251 | |||
252 | 1: SAVE_STATIC | ||
253 | move a0, sp | ||
254 | li a1, 1 | ||
255 | jal do_syscall_trace | ||
256 | j syscall_exit | ||
257 | 247 | ||
258 | no_mem: li v0, -ENOMEM | 248 | no_mem: li v0, -ENOMEM |
259 | jr ra | 249 | jr ra |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 9085838d6ce3..47bfbd416709 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -93,13 +93,15 @@ syscall_trace_entry: | |||
93 | li a1, 0 | 93 | li a1, 0 |
94 | jal do_syscall_trace | 94 | jal do_syscall_trace |
95 | 95 | ||
96 | move t0, s0 | ||
97 | RESTORE_STATIC | ||
96 | ld a0, PT_R4(sp) # Restore argument registers | 98 | ld a0, PT_R4(sp) # Restore argument registers |
97 | ld a1, PT_R5(sp) | 99 | ld a1, PT_R5(sp) |
98 | ld a2, PT_R6(sp) | 100 | ld a2, PT_R6(sp) |
99 | ld a3, PT_R7(sp) | 101 | ld a3, PT_R7(sp) |
100 | ld a4, PT_R8(sp) | 102 | ld a4, PT_R8(sp) |
101 | ld a5, PT_R9(sp) | 103 | ld a5, PT_R9(sp) |
102 | jalr s0 | 104 | jalr t0 |
103 | 105 | ||
104 | li t0, -EMAXERRNO - 1 # error? | 106 | li t0, -EMAXERRNO - 1 # error? |
105 | sltu t0, t0, v0 | 107 | sltu t0, t0, v0 |
@@ -174,19 +176,7 @@ illegal_syscall: | |||
174 | sd zero, PT_R7(sp) # success | 176 | sd zero, PT_R7(sp) # success |
175 | sd v0, PT_R2(sp) # result | 177 | sd v0, PT_R2(sp) # result |
176 | 178 | ||
177 | /* Success, so skip usual error handling garbage. */ | 179 | j n64_syscall_exit # continue like a normal syscall |
178 | li t0, _TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | ||
179 | LONG_L a2, TI_FLAGS($28) # syscall tracing enabled? | ||
180 | and t0, a2, t0 | ||
181 | bnez t0, 1f | ||
182 | |||
183 | j n64_syscall_exit | ||
184 | |||
185 | 1: SAVE_STATIC | ||
186 | move a0, sp | ||
187 | li a1, 1 | ||
188 | jal do_syscall_trace | ||
189 | j syscall_exit | ||
190 | 180 | ||
191 | no_mem: li v0, -ENOMEM | 181 | no_mem: li v0, -ENOMEM |
192 | jr ra | 182 | jr ra |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 7e66eb823bf6..b465ced1758f 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -90,13 +90,15 @@ n32_syscall_trace_entry: | |||
90 | li a1, 0 | 90 | li a1, 0 |
91 | jal do_syscall_trace | 91 | jal do_syscall_trace |
92 | 92 | ||
93 | move t0, s0 | ||
94 | RESTORE_STATIC | ||
93 | ld a0, PT_R4(sp) # Restore argument registers | 95 | ld a0, PT_R4(sp) # Restore argument registers |
94 | ld a1, PT_R5(sp) | 96 | ld a1, PT_R5(sp) |
95 | ld a2, PT_R6(sp) | 97 | ld a2, PT_R6(sp) |
96 | ld a3, PT_R7(sp) | 98 | ld a3, PT_R7(sp) |
97 | ld a4, PT_R8(sp) | 99 | ld a4, PT_R8(sp) |
98 | ld a5, PT_R9(sp) | 100 | ld a5, PT_R9(sp) |
99 | jalr s0 | 101 | jalr t0 |
100 | 102 | ||
101 | li t0, -EMAXERRNO - 1 # error? | 103 | li t0, -EMAXERRNO - 1 # error? |
102 | sltu t0, t0, v0 | 104 | sltu t0, t0, v0 |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 5a16401e443a..3d338ca7eeeb 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -124,6 +124,8 @@ trace_a_syscall: | |||
124 | li a1, 0 | 124 | li a1, 0 |
125 | jal do_syscall_trace | 125 | jal do_syscall_trace |
126 | 126 | ||
127 | move t0, s0 | ||
128 | RESTORE_STATIC | ||
127 | ld a0, PT_R4(sp) # Restore argument registers | 129 | ld a0, PT_R4(sp) # Restore argument registers |
128 | ld a1, PT_R5(sp) | 130 | ld a1, PT_R5(sp) |
129 | ld a2, PT_R6(sp) | 131 | ld a2, PT_R6(sp) |
@@ -132,7 +134,7 @@ trace_a_syscall: | |||
132 | ld a5, PT_R9(sp) | 134 | ld a5, PT_R9(sp) |
133 | ld a6, PT_R10(sp) | 135 | ld a6, PT_R10(sp) |
134 | ld a7, PT_R11(sp) # For indirect syscalls | 136 | ld a7, PT_R11(sp) # For indirect syscalls |
135 | jalr s0 | 137 | jalr t0 |
136 | 138 | ||
137 | li t0, -EMAXERRNO - 1 # error? | 139 | li t0, -EMAXERRNO - 1 # error? |
138 | sltu t0, t0, v0 | 140 | sltu t0, t0, v0 |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 05e09eedabff..7d1800fe7038 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -220,8 +220,6 @@ _sys_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
220 | /* | 220 | /* |
221 | * Don't let your children do this ... | 221 | * Don't let your children do this ... |
222 | */ | 222 | */ |
223 | if (current_thread_info()->flags & TIF_SYSCALL_TRACE) | ||
224 | do_syscall_trace(®s, 1); | ||
225 | __asm__ __volatile__( | 223 | __asm__ __volatile__( |
226 | "move\t$29, %0\n\t" | 224 | "move\t$29, %0\n\t" |
227 | "j\tsyscall_exit" | 225 | "j\tsyscall_exit" |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index e315d3f6aa6e..c856dbc52abb 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -497,8 +497,6 @@ _sys32_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
497 | /* | 497 | /* |
498 | * Don't let your children do this ... | 498 | * Don't let your children do this ... |
499 | */ | 499 | */ |
500 | if (current_thread_info()->flags & TIF_SYSCALL_TRACE) | ||
501 | do_syscall_trace(®s, 1); | ||
502 | __asm__ __volatile__( | 500 | __asm__ __volatile__( |
503 | "move\t$29, %0\n\t" | 501 | "move\t$29, %0\n\t" |
504 | "j\tsyscall_exit" | 502 | "j\tsyscall_exit" |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 6f3ff9690686..7058893d5ad2 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -534,13 +534,14 @@ static inline int simulate_rdhwr(struct pt_regs *regs) | |||
534 | switch (rd) { | 534 | switch (rd) { |
535 | case 29: | 535 | case 29: |
536 | regs->regs[rt] = ti->tp_value; | 536 | regs->regs[rt] = ti->tp_value; |
537 | break; | 537 | return 0; |
538 | default: | 538 | default: |
539 | return -EFAULT; | 539 | return -EFAULT; |
540 | } | 540 | } |
541 | } | 541 | } |
542 | 542 | ||
543 | return 0; | 543 | /* Not ours. */ |
544 | return -EFAULT; | ||
544 | } | 545 | } |
545 | 546 | ||
546 | asmlinkage void do_ov(struct pt_regs *regs) | 547 | asmlinkage void do_ov(struct pt_regs *regs) |