]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Fix a preemption issue with thread's FPU defaults
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 12 May 2015 14:20:57 +0000 (15:20 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 12 May 2015 21:15:49 +0000 (23:15 +0200)
commit6f961621ee5de0c49594b5ab2125e93646f2257f
tree68e8ae5e92d6dda9b32be45d72025b095913671d
parent901b15d821c94aad843a03af4c19839cc50b8eae
MIPS: Fix a preemption issue with thread's FPU defaults

Fix "BUG: using smp_processor_id() in preemptible" reported in accesses
to thread's FPU defaults: the value to initialise FSCR to at program
startup, the FCSR r/w mask and the contents of FIR in full FPU
emulation, removing a regression introduced with 36341133 [MIPS: Respect
the ISA level in FCSR handling] and 2fc7b127 [MIPS: math-emu: Set FIR
feature flags for full emulation].

Use `boot_cpu_data' to obtain the data from, following the approach that
`cpu_has_*' macros take and avoiding the call to `smp_processor_id' made
in the reference to `current_cpu_data'.  The contents of FSCR have to be
consistent across processors in an SMP system, the settings there must
not change as a thread is migrated across processors.  And the contents
of FIR are guaranteed to be consistent in FPU emulation, by definition.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
Tested-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Tested-by: Paul Martin <paul.martin@codethink.co.uk>
Cc: Markos Chandras <Markos.Chandras@imgtec.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/10030/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/elf.h
arch/mips/kernel/ptrace.c
arch/mips/math-emu/cp1emu.c