mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: akpm@osdl.org
To: torvalds@osdl.org
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, paulus@samba.org
Subject: [patch 028/198] ppc32: oops on kernel altivec assist exceptions
Date: Tue, 12 Apr 2005 03:30:59 -0700	[thread overview]
Message-ID: <200504121031.j3CAV5ZI005233@shell0.pdx.osdl.net> (raw)


From: Paul Mackerras <paulus@samba.org>

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

 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) {
_

                 reply	other threads:[~2005-04-12 17:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200504121031.j3CAV5ZI005233@shell0.pdx.osdl.net \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®