Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6761ee3d authored by Kevin Hao's avatar Kevin Hao Committed by Benjamin Herrenschmidt
Browse files

powerpc/math-emu: Move the flush FPU state function into do_mathemu



By doing this we can make sure that the FPU state is only flushed to
the thread struct when it is really needed.

Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 195c4940
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -1134,15 +1134,6 @@ void __kprobes program_check_exception(struct pt_regs *regs)
	 * instruction or only on FP instructions, whether there is a
	 * pattern to occurrences etc. -dgibson 31/Mar/2003
	 */

	/*
	 * If we support a HW FPU, we need to ensure the FP state
	 * if flushed into the thread_struct before attempting
	 * emulation
	 */
#ifdef CONFIG_PPC_FPU
	flush_fp_to_thread(current);
#endif
	switch (do_mathemu(regs)) {
	case 0:
		emulate_single_step(regs);
+9 −0
Original line number Diff line number Diff line
@@ -420,6 +420,15 @@ do_mathemu(struct pt_regs *regs)
		goto illegal;
	}

	/*
	 * If we support a HW FPU, we need to ensure the FP state
	 * is flushed into the thread_struct before attempting
	 * emulation
	 */
#ifdef CONFIG_PPC_FPU
	flush_fp_to_thread(current);
#endif

	eflag = func(op0, op1, op2, op3);

	if (insn & 1) {