提交 e378cc16 编写于 作者: P Paul Mackerras 提交者: Linus Torvalds

[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: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6460b4cc
...@@ -805,6 +805,13 @@ void AltivecAssistException(struct pt_regs *regs) ...@@ -805,6 +805,13 @@ void AltivecAssistException(struct pt_regs *regs)
if (regs->msr & MSR_VEC) if (regs->msr & MSR_VEC)
giveup_altivec(current); giveup_altivec(current);
preempt_enable(); 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); err = emulate_altivec(regs);
if (err == 0) { if (err == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册