aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Cowgill <James.Cowgill@imgtec.com>2017-04-11 08:51:07 -0400
committerRalf Baechle <ralf@linux-mips.org>2017-04-12 09:22:13 -0400
commitc46f59e90226fa5bfcc83650edebe84ae47d454b (patch)
tree4bdca9017be938ce43ffa7cb34305ce719468949
parente0211327f068901ce654ba78951c35bc69fdc1de (diff)
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>
-rw-r--r--arch/mips/kernel/elf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/elf.c b/arch/mips/kernel/elf.c
index 6430bff21fff..5c429d70e17f 100644
--- a/arch/mips/kernel/elf.c
+++ b/arch/mips/kernel/elf.c
@@ -257,7 +257,7 @@ int arch_check_elf(void *_ehdr, bool has_interpreter, void *_interp_ehdr,
257 else if ((prog_req.fr1 && prog_req.frdefault) || 257 else if ((prog_req.fr1 && prog_req.frdefault) ||
258 (prog_req.single && !prog_req.frdefault)) 258 (prog_req.single && !prog_req.frdefault))
259 /* Make sure 64-bit MIPS III/IV/64R1 will not pick FR1 */ 259 /* Make sure 64-bit MIPS III/IV/64R1 will not pick FR1 */
260 state->overall_fp_mode = ((current_cpu_data.fpu_id & MIPS_FPIR_F64) && 260 state->overall_fp_mode = ((raw_current_cpu_data.fpu_id & MIPS_FPIR_F64) &&
261 cpu_has_mips_r2_r6) ? 261 cpu_has_mips_r2_r6) ?
262 FP_FR1 : FP_FR0; 262 FP_FR1 : FP_FR0;
263 else if (prog_req.fr1) 263 else if (prog_req.fr1)