From: Paul Mackerras Date: Sat, 16 Apr 2005 22:24:17 +0000 (-0700) Subject: [PATCH] ppc32: oops on kernel altivec assist exceptions X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e378cc16b0d3c1610857c4444345907020e03ece;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c index ed5c7acdca7..aec225b402a 100644 --- a/arch/ppc/kernel/traps.c +++ b/arch/ppc/kernel/traps.c @@ -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) {