This is a note to let you know that I've just added the patch titled MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR to the 3.16-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mips-ptrace-avoid-smp_processor_id-when-retrieving-fpu-ir.patch and it can be found in the queue-3.16 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 656ff9bef08c19a6471b49528dacb4cbbeb1e537 Mon Sep 17 00:00:00 2001 From: Alex Smith <alex@xxxxxxxxxxxxxxxx> Date: Wed, 23 Jul 2014 14:40:06 +0100 Subject: MIPS: ptrace: Avoid smp_processor_id() when retrieving FPU IR From: Alex Smith <alex@xxxxxxxxxxxxxxxx> commit 656ff9bef08c19a6471b49528dacb4cbbeb1e537 upstream. 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@xxxxxxxxxxxxxxxx> Cc: linux-mips@xxxxxxxxxxxxxx Patchwork: https://patchwork.linux-mips.org/patch/7449/ Signed-off-by: Ralf Baechle <ralf@xxxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- arch/mips/kernel/ptrace.c | 4 ++-- arch/mips/kernel/ptrace32.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -129,7 +129,7 @@ int ptrace_getfpregs(struct task_struct } __put_user(child->thread.fpu.fcr31, data + 64); - __put_user(current_cpu_data.fpu_id, data + 65); + __put_user(boot_cpu_data.fpu_id, data + 65); return 0; } @@ -611,7 +611,7 @@ long arch_ptrace(struct task_struct *chi break; case FPC_EIR: /* implementation / version register */ - tmp = current_cpu_data.fpu_id; + tmp = boot_cpu_data.fpu_id; break; case DSP_BASE ... DSP_BASE + 5: { dspreg_t *dregs; --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c @@ -129,7 +129,7 @@ long compat_arch_ptrace(struct task_stru break; case FPC_EIR: /* implementation / version register */ - tmp = current_cpu_data.fpu_id; + tmp = boot_cpu_data.fpu_id; break; case DSP_BASE ... DSP_BASE + 5: { dspreg_t *dregs; Patches currently in stable-queue which might be from alex@xxxxxxxxxxxxxxxx are queue-3.16/mips-ptrace-test-correct-task-s-flags-in-task_user_regset_view.patch queue-3.16/mips-asm-reg.h-make-32-and-64-bit-definitions-available-at-the-same-time.patch queue-3.16/mips-ptrace-change-gp-regset-to-use-correct-core-dump-register-layout.patch queue-3.16/mips-ptrace-avoid-smp_processor_id-when-retrieving-fpu-ir.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html