[PATCH] ppc: oops on kernel altivec assist exceptions

From: Paul Mackerras
Date: Mon Apr 04 2005 - 00:42:39 EST


If we should happen to get an altivec assist exception while executing
in the kernel, we will currently try to handle it and fail, and end up
oopsing with (apparently) a segfault. (An altivec assist exception
occurs for floating-point altivec instructions with denormalized
inputs or outputs if the altivec unit is in java mode.)

This patch checks explicitly if we are in user mode and prints a
useful message if not.

Signed-off-by: Paul Mackerras <paulus@xxxxxxxxx>

diff -urN linux-2.5/arch/ppc/kernel/traps.c pmac-2.5/arch/ppc/kernel/traps.c
--- linux-2.5/arch/ppc/kernel/traps.c 2005-03-29 16:24:53.000000000 +1000
+++ pmac-2.5/arch/ppc/kernel/traps.c 2005-03-31 08:37:53.000000000 +1000
@@ -805,6 +828,13 @@
if (regs->msr & MSR_VEC)
giveup_altivec(current);
preempt_enable();
+ if (!user_mode(regs)) {
+ printk(KERN_ERR "altivec assist exception in kernel mode"
+ " at %lx\n", regs->nip);
+ debugger(regs);
+ die("altivec assist exception", regs, SIGFPE);
+ return;
+ }

err = emulate_altivec(regs);
if (err == 0) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/