tree 0947c9f923f985319e81be3f9fe2018571e53d6b
parent 6460b4cceba0181308042c8d8794eb679bfa22e5
author Paul Mackerras <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:17 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Sun, 17 Apr 2005 05:24:17 -0700

[PATCH] ppc32: oops on kernel altivec assist exceptions

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 <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 ppc/kernel/traps.c |    7 +++++++
 1 files changed, 7 insertions(+)

Index: arch/ppc/kernel/traps.c
===================================================================
--- a0b9f388bf205b7f0fff9f5c7f8e31dacf12be7e/arch/ppc/kernel/traps.c  
(mode:100644 sha1:ed5c7acdca70a76780dfb4a378642fed9fe88f48)
+++ 0947c9f923f985319e81be3f9fe2018571e53d6b/arch/ppc/kernel/traps.c  
(mode:100644 sha1:aec225b402ae5f0558619908596bba3c2cf3943a)
@@ -805,6 +805,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 bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to