[patch 028/198] ppc32: oops on kernel altivec assist exceptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Paul Mackerras <[email protected]>

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]>
---

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

diff -puN arch/ppc/kernel/traps.c~ppc32-oops-on-kernel-altivec-assist-exceptions arch/ppc/kernel/traps.c
--- 25/arch/ppc/kernel/traps.c~ppc32-oops-on-kernel-altivec-assist-exceptions	2005-04-12 03:21:10.167591192 -0700
+++ 25-akpm/arch/ppc/kernel/traps.c	2005-04-12 03:21:10.171590584 -0700
@@ -805,6 +805,13 @@ void AltivecAssistException(struct pt_re
 	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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux