]>
Commit | Line | Data |
---|---|---|
c8fb49aa GKH |
1 | From 656ff9bef08c19a6471b49528dacb4cbbeb1e537 Mon Sep 17 00:00:00 2001 |
2 | From: Alex Smith <alex@alex-smith.me.uk> | |
3 | Date: Wed, 23 Jul 2014 14:40:06 +0100 | |
4 | Subject: MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR | |
5 | ||
6 | From: Alex Smith <alex@alex-smith.me.uk> | |
7 | ||
8 | commit 656ff9bef08c19a6471b49528dacb4cbbeb1e537 upstream. | |
9 | ||
10 | Whenever ptrace attempts to retrieve the FPU implementation register it | |
11 | accesses it through current_cpu_data, which calls smp_processor_id(). | |
12 | Since the code may execute with preemption enabled, this can trigger | |
13 | a warning. Fix this by using boot_cpu_data to get the IR instead. | |
14 | ||
15 | Signed-off-by: Alex Smith <alex@alex-smith.me.uk> | |
16 | Cc: linux-mips@linux-mips.org | |
17 | Patchwork: https://patchwork.linux-mips.org/patch/7449/ | |
18 | Signed-off-by: Ralf Baechle <ralf@linux-mips.org> | |
19 | Signed-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; |