Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6c4841c2 authored by Anton Blanchard's avatar Anton Blanchard Committed by Paul Mackerras
Browse files

[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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 60b2a46c
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -900,14 +900,13 @@ void kernel_fp_unavailable_exception(struct pt_regs *regs)


void altivec_unavailable_exception(struct pt_regs *regs)
void altivec_unavailable_exception(struct pt_regs *regs)
{
{
#if !defined(CONFIG_ALTIVEC)
	if (user_mode(regs)) {
	if (user_mode(regs)) {
		/* A user program has executed an altivec instruction,
		/* A user program has executed an altivec instruction,
		   but this kernel doesn't support altivec. */
		   but this kernel doesn't support altivec. */
		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
		return;
		return;
	}
	}
#endif

	printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
	printk(KERN_EMERG "Unrecoverable VMX/Altivec Unavailable Exception "
			"%lx at %lx\n", regs->trap, regs->nip);
			"%lx at %lx\n", regs->trap, regs->nip);
	die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);
	die("Unrecoverable VMX/Altivec Unavailable Exception", regs, SIGABRT);