[3/3] powerpc/8xx: Remove 8xx specific "minimal FPU emulation"

Message ID 1370761498.14883.5.camel@pasglop
State Accepted, archived
Commit 968219fa334ce8fed3421dd12ea12e9f562c95cb
Headers show

Commit Message

Benjamin Herrenschmidt June 9, 2013, 7:04 a.m.
This is duplicated code from math-emu and implements such a small
subset of the FPU (load/stores/fmr) that it's essentially pointless

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Note that arch/powerpc/math-emu/math.c seems to have code in there
to do exactly the same thing (subset emulation) if CONFIG_MATH_EMULATION
isn't set. However that code isn't used since we simply don't call
do_mathemu() not build any of the relevant files when this is not

I'm not removing this just yet. If somebody thinks there is value
in supporting that "minimal set emulation", then send me a patch
that provides a Kconfig/Makefile way of enabling that code, which
makes it work on all soft-fpu powerpc's and not just 8xx.

If nobody reacts, I'll probably just rip the code out by the next
kernel version.

 arch/powerpc/Kconfig        |   11 -----------
 arch/powerpc/kernel/traps.c |   22 +---------------------
 2 files changed, 1 insertion(+), 32 deletions(-)


diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index e3009ab..5374776 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -319,17 +319,6 @@  config PPC_TRANSACTIONAL_MEM
          Support user-mode Transactional Memory on POWERPC.
-	bool "Minimal math emulation for 8xx"
-	depends on 8xx && !MATH_EMULATION
-	help
-	  Older arch/ppc kernels still emulated a few floating point
-	  instructions such as load and store, even when full math
-	  emulation is disabled.  Say "Y" here if you want to preserve
-	  this behavior.
-	  It is recommended that you build a soft-float userspace instead.
 	def_bool PPC64
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index ff315a7..8093156 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1401,8 +1401,7 @@  void performance_monitor_exception(struct pt_regs *regs)
 void SoftwareEmulation(struct pt_regs *regs)
 	extern int do_mathemu(struct pt_regs *);
-	extern int Soft_emulate_8xx(struct pt_regs *);
 	int errcode;
@@ -1435,23 +1434,6 @@  void SoftwareEmulation(struct pt_regs *regs)
 		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
-	errcode = Soft_emulate_8xx(regs);
-	if (errcode >= 0)
-		PPC_WARN_EMULATED(8xx, regs);
-	switch (errcode) {
-	case 0:
-		emulate_single_step(regs);
-		return;
-	case 1:
-		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-		return;
-	case -EFAULT:
-		_exception(SIGSEGV, regs, SEGV_MAPERR, regs->nip);
-		return;
-	}
 	_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
@@ -1801,8 +1783,6 @@  struct ppc_emulated ppc_emulated = {
-#elif defined(CONFIG_8XX_MINIMAL_FPEMU)
 #ifdef CONFIG_VSX