Valgrind, ppc:  Fix missing checks for 64-bit instructions operating in 32-bit mode, Bugzilla 308573

A number of the POWER instructions are only intended to run on 64-bit
hardware.  These instructions will give a SIGILL instruction on 32-bit
hardware.  The check for 32-bit mode on some of these instructions is
missing.  Although, the 64-bit hardware will execute these instructions
on 64-bit hardware without generating a SIGILL the use of these
instructions in 32-bit mode on 64-bit hardware is typically indicative of
a programming error. There are cases where these instructions are used
to determine if the code is running on 32-bit hardware or not.  In these
cases, the instruction needs to generate a SIGILL for the error handler
to properly determine the hardware is running in 32-bit mode.

This patch adds the 32-bit mode check for those 64-bit instructions that
do not have the check.  If the check fails, the instruction is flagged
as an unsupported instruction and a SIGILL message is generated.

This patch fixes the bug reported in:
Bug 308573 - Internal Valgrind error on 64-bit instruction executed in
32-bit mode

Note, there is an accompaning fix to memcheck/tests/ppc32/power_ISA2_05.c
to only execute the 64-bit instruction prtyd test in 64-bit mode.

Carl Love  cel@us.ibm.com

git-svn-id: svn://svn.valgrind.org/vex/trunk@2558 8f6e269a-dfd6-0310-a8e1-e2731360e62c
1 file changed