Skip to contentSkip to conversation

Never panic when taking altivec exceptions from userspace

PATCH New Anton Blanchard 1 participant 1 message Oct 13, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Never panic when taking altivec exceptions from userspace

At the moment we rely on a cpu feature bit or a firmware property to detect altivec. If we dont have either of these and the cpu does in fact support altivec we can cause a panic from userspace.

It seems safer to always send a signal if we manage to get an 0xf20 exception from userspace.

---

arch/powerpc/kernel/traps.c +1 -2
index d9f10f2..5ed4c2c 100644
@@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(str
 
 void altivec_unavailable_exception(struct pt_regs *regs)
 {
-#if !defined(CONFIG_ALTIVEC)
 	if (user_mode(regs)) {
 		/* A user program has executed an altivec instruction,
 		   but this kernel doesn't support altivec. */
 		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
 		return;
 	}
-#endif
+
 	printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
 			"%lx at %lx\n", regs->trap, regs->nip);
 	die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);