]> git.ipfire.org Git - thirdparty/valgrind.git/commit
Valgrind, ppc: Fix missing checks for 64-bit instructions operating in 32-bit mode...
authorCarl Love <cel@us.ibm.com>
Mon, 29 Oct 2012 20:23:41 +0000 (20:23 +0000)
committerCarl Love <cel@us.ibm.com>
Mon, 29 Oct 2012 20:23:41 +0000 (20:23 +0000)
commit49c11b171d06ffc3fde83466b5bbddd73e69e9dd
treec68c89c1f07d713fd14b7590b2b95cba2709f114
parentf53d406c967bee97f5576f577f40fae546f1ba56
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
VEX/priv/guest_ppc_toIR.c