]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/3.16.3/mips-ptrace-avoid-smp_processor_id-when-retrieving-fpu-ir.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / mips-ptrace-avoid-smp_processor_id-when-retrieving-fpu-ir.patch
CommitLineData
c8fb49aa
GKH
1From 656ff9bef08c19a6471b49528dacb4cbbeb1e537 Mon Sep 17 00:00:00 2001
2From: Alex Smith <alex@alex-smith.me.uk>
3Date: Wed, 23 Jul 2014 14:40:06 +0100
4Subject: MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR
5
6From: Alex Smith <alex@alex-smith.me.uk>
7
8commit 656ff9bef08c19a6471b49528dacb4cbbeb1e537 upstream.
9
10Whenever ptrace attempts to retrieve the FPU implementation register it
11accesses it through current_cpu_data, which calls smp_processor_id().
12Since the code may execute with preemption enabled, this can trigger
13a warning. Fix this by using boot_cpu_data to get the IR instead.
14
15Signed-off-by: Alex Smith <alex@alex-smith.me.uk>
16Cc: linux-mips@linux-mips.org
17Patchwork: https://patchwork.linux-mips.org/patch/7449/
18Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20
21---
22 arch/mips/kernel/ptrace.c | 4 ++--
23 arch/mips/kernel/ptrace32.c | 2 +-
24 2 files changed, 3 insertions(+), 3 deletions(-)
25
26--- a/arch/mips/kernel/ptrace.c
27+++ b/arch/mips/kernel/ptrace.c
28@@ -129,7 +129,7 @@ int ptrace_getfpregs(struct task_struct
29 }
30
31 __put_user(child->thread.fpu.fcr31, data + 64);
32- __put_user(current_cpu_data.fpu_id, data + 65);
33+ __put_user(boot_cpu_data.fpu_id, data + 65);
34
35 return 0;
36 }
37@@ -611,7 +611,7 @@ long arch_ptrace(struct task_struct *chi
38 break;
39 case FPC_EIR:
40 /* implementation / version register */
41- tmp = current_cpu_data.fpu_id;
42+ tmp = boot_cpu_data.fpu_id;
43 break;
44 case DSP_BASE ... DSP_BASE + 5: {
45 dspreg_t *dregs;
46--- a/arch/mips/kernel/ptrace32.c
47+++ b/arch/mips/kernel/ptrace32.c
48@@ -129,7 +129,7 @@ long compat_arch_ptrace(struct task_stru
49 break;
50 case FPC_EIR:
51 /* implementation / version register */
52- tmp = current_cpu_data.fpu_id;
53+ tmp = boot_cpu_data.fpu_id;
54 break;
55 case DSP_BASE ... DSP_BASE + 5: {
56 dspreg_t *dregs;