diff options
Diffstat (limited to 'arch/mips/kernel/ptrace.c')
-rw-r--r-- | arch/mips/kernel/ptrace.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index f838b36cc765..9b4733c12395 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
@@ -248,10 +248,20 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
248 | break; | 248 | break; |
249 | case FPC_EIR: { /* implementation / version register */ | 249 | case FPC_EIR: { /* implementation / version register */ |
250 | unsigned int flags; | 250 | unsigned int flags; |
251 | #ifdef CONFIG_MIPS_MT_SMTC | ||
252 | unsigned int irqflags; | ||
253 | unsigned int mtflags; | ||
254 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
251 | 255 | ||
252 | if (!cpu_has_fpu) | 256 | if (!cpu_has_fpu) |
253 | break; | 257 | break; |
254 | 258 | ||
259 | #ifdef CONFIG_MIPS_MT_SMTC | ||
260 | /* Read-modify-write of Status must be atomic */ | ||
261 | local_irq_save(irqflags); | ||
262 | mtflags = dmt(); | ||
263 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
264 | |||
255 | preempt_disable(); | 265 | preempt_disable(); |
256 | if (cpu_has_mipsmt) { | 266 | if (cpu_has_mipsmt) { |
257 | unsigned int vpflags = dvpe(); | 267 | unsigned int vpflags = dvpe(); |
@@ -266,6 +276,10 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
266 | __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); | 276 | __asm__ __volatile__("cfc1\t%0,$0": "=r" (tmp)); |
267 | write_c0_status(flags); | 277 | write_c0_status(flags); |
268 | } | 278 | } |
279 | #ifdef CONFIG_MIPS_MT_SMTC | ||
280 | emt(mtflags); | ||
281 | local_irq_restore(irqflags); | ||
282 | #endif /* CONFIG_MIPS_MT_SMTC */ | ||
269 | preempt_enable(); | 283 | preempt_enable(); |
270 | break; | 284 | break; |
271 | } | 285 | } |
@@ -469,7 +483,7 @@ static inline int audit_arch(void) | |||
469 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | 483 | asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) |
470 | { | 484 | { |
471 | if (unlikely(current->audit_context) && entryexit) | 485 | if (unlikely(current->audit_context) && entryexit) |
472 | audit_syscall_exit(current, AUDITSC_RESULT(regs->regs[2]), | 486 | audit_syscall_exit(AUDITSC_RESULT(regs->regs[2]), |
473 | regs->regs[2]); | 487 | regs->regs[2]); |
474 | 488 | ||
475 | if (!(current->ptrace & PT_PTRACED)) | 489 | if (!(current->ptrace & PT_PTRACED)) |
@@ -493,7 +507,7 @@ asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) | |||
493 | } | 507 | } |
494 | out: | 508 | out: |
495 | if (unlikely(current->audit_context) && !entryexit) | 509 | if (unlikely(current->audit_context) && !entryexit) |
496 | audit_syscall_entry(current, audit_arch(), regs->regs[2], | 510 | audit_syscall_entry(audit_arch(), regs->regs[2], |
497 | regs->regs[4], regs->regs[5], | 511 | regs->regs[4], regs->regs[5], |
498 | regs->regs[6], regs->regs[7]); | 512 | regs->regs[6], regs->regs[7]); |
499 | } | 513 | } |