diff options
| author | Alex Smith <alex@alex-smith.me.uk> | 2014-07-23 09:40:06 -0400 |
|---|---|---|
| committer | Ralf Baechle <ralf@linux-mips.org> | 2014-07-30 17:27:03 -0400 |
| commit | 656ff9bef08c19a6471b49528dacb4cbbeb1e537 (patch) | |
| tree | 0c2072970ccd0bbe36a7a80f135deae6ae6cd12a /arch/mips/kernel | |
| parent | 6ee1d93455384cef8a0426effe85da241b525b63 (diff) | |
MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR
Whenever ptrace attempts to retrieve the FPU implementation register it
accesses it through current_cpu_data, which calls smp_processor_id().
Since the code may execute with preemption enabled, this can trigger
a warning. Fix this by using boot_cpu_data to get the IR instead.
Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
Cc: <stable@vger.kernel.org> # v3.15+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/7449/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/ptrace.c | 4 | ||||
| -rw-r--r-- | arch/mips/kernel/ptrace32.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index f639ccd5060c..6063b112a6aa 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c | |||
| @@ -129,7 +129,7 @@ int ptrace_getfpregs(struct task_struct *child, __u32 __user *data) | |||
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | __put_user(child->thread.fpu.fcr31, data + 64); | 131 | __put_user(child->thread.fpu.fcr31, data + 64); |
| 132 | __put_user(current_cpu_data.fpu_id, data + 65); | 132 | __put_user(boot_cpu_data.fpu_id, data + 65); |
| 133 | 133 | ||
| 134 | return 0; | 134 | return 0; |
| 135 | } | 135 | } |
| @@ -480,7 +480,7 @@ long arch_ptrace(struct task_struct *child, long request, | |||
| 480 | break; | 480 | break; |
| 481 | case FPC_EIR: | 481 | case FPC_EIR: |
| 482 | /* implementation / version register */ | 482 | /* implementation / version register */ |
| 483 | tmp = current_cpu_data.fpu_id; | 483 | tmp = boot_cpu_data.fpu_id; |
| 484 | break; | 484 | break; |
| 485 | case DSP_BASE ... DSP_BASE + 5: { | 485 | case DSP_BASE ... DSP_BASE + 5: { |
| 486 | dspreg_t *dregs; | 486 | dspreg_t *dregs; |
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index b40c3ca60ee5..a83fb730b387 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
| @@ -129,7 +129,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, | |||
| 129 | break; | 129 | break; |
| 130 | case FPC_EIR: | 130 | case FPC_EIR: |
| 131 | /* implementation / version register */ | 131 | /* implementation / version register */ |
| 132 | tmp = current_cpu_data.fpu_id; | 132 | tmp = boot_cpu_data.fpu_id; |
| 133 | break; | 133 | break; |
| 134 | case DSP_BASE ... DSP_BASE + 5: { | 134 | case DSP_BASE ... DSP_BASE + 5: { |
| 135 | dspreg_t *dregs; | 135 | dspreg_t *dregs; |
