powerpc: Fix emulation of illegal instructions on PowerNV platform
authorPaul Mackerras <paulus@samba.org>
Fri, 14 Jun 2013 10:07:41 +0000 (20:07 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sat, 15 Jun 2013 02:24:11 +0000 (12:24 +1000)
commitbf593907f7236e95698a76b7c7a2bbf8b1165327
treeec0f1c5adc9fdb5c81cf51724d2e36601b854d5a
parent0e37739b1c96d65e6433998454985de994383019
powerpc: Fix emulation of illegal instructions on PowerNV platform

Normally, the kernel emulates a few instructions that are unimplemented
on some processors (e.g. the old dcba instruction), or privileged (e.g.
mfpvr).  The emulation of unimplemented instructions is currently not
working on the PowerNV platform.  The reason is that on these machines,
unimplemented and illegal instructions cause a hypervisor emulation
assist interrupt, rather than a program interrupt as on older CPUs.
Our vector for the emulation assist interrupt just calls
program_check_exception() directly, without setting the bit in SRR1
that indicates an illegal instruction interrupt.  This fixes it by
making the emulation assist interrupt set that bit before calling
program_check_interrupt().  With this, old programs that use no-longer
implemented instructions such as dcba now work again.

CC: <stable@vger.kernel.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/exceptions-64s.S
arch/powerpc/kernel/traps.c