Skip to content

Commit 6c4841c

Browse files
antonblanchardpaulusmack
authored andcommitted
[POWERPC] 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. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 60b2a46 commit 6c4841c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/powerpc/kernel/traps.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)
900900

901901
void altivec_unavailable_exception(struct pt_regs *regs)
902902
{
903-
#if !defined(CONFIG_ALTIVEC)
904903
if (user_mode(regs)) {
905904
/* A user program has executed an altivec instruction,
906905
but this kernel doesn't support altivec. */
907906
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
908907
return;
909908
}
910-
#endif
909+
911910
printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
912911
"%lx at %lx\n", regs->trap, regs->nip);
913912
die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);

0 commit comments

Comments
 (0)