Skip to content

Commit

Permalink
[PATCH] ppc32: oops on kernel altivec assist exceptions
Browse files Browse the repository at this point in the history
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@samba.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Paul Mackerras authored and Linus Torvalds committed Apr 16, 2005
1 parent 6460b4c commit e378cc1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions arch/ppc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,13 @@ void AltivecAssistException(struct pt_regs *regs)
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) {
Expand Down

0 comments on commit e378cc1

Please sign in to comment.