]> git.karo-electronics.de Git - karo-tx-linux.git/commit
MIPS: Avoid BUG warning in arch_check_elf
authorJames Cowgill <James.Cowgill@imgtec.com>
Tue, 11 Apr 2017 12:51:07 +0000 (13:51 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Wed, 12 Apr 2017 13:22:13 +0000 (15:22 +0200)
commitc46f59e90226fa5bfcc83650edebe84ae47d454b
tree4bdca9017be938ce43ffa7cb34305ce719468949
parente0211327f068901ce654ba78951c35bc69fdc1de
MIPS: Avoid BUG warning in arch_check_elf

arch_check_elf contains a usage of current_cpu_data that will call
smp_processor_id() with preemption enabled and therefore triggers a
"BUG: using smp_processor_id() in preemptible" warning when an fpxx
executable is loaded.

As a follow-up to commit b244614a60ab ("MIPS: Avoid a BUG warning during
prctl(PR_SET_FP_MODE, ...)"), apply the same fix to arch_check_elf by
using raw_current_cpu_data instead. The rationale quoted from the previous
commit:

"It is assumed throughout the kernel that if any CPU has an FPU, then
all CPUs would have an FPU as well, so it is safe to perform the check
with preemption enabled - change the code to use raw_ variant of the
check to avoid the warning."

Fixes: 46490b572544 ("MIPS: kernel: elf: Improve the overall ABI and FPU mode checks")
Signed-off-by: James Cowgill <James.Cowgill@imgtec.com>
CC: <stable@vger.kernel.org> # 4.0+
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/15951/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/elf.c