Bug 1895 - valgrind : Unhanded instructions mfatbu and mfatbl
Summary: valgrind : Unhanded instructions mfatbu and mfatbl
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 ppc
: Medium normal
Target Milestone: 1.2 M3
Assignee: Dongxiao Xu
QA Contact:
URL:
Whiteboard: No update
Depends on:
Blocks:
 
Reported: 2012-01-11 23:19 UTC by Aneesh
Modified: 2012-03-08 18:42 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
Patch to add support for mfatbu and mfatbl in valgrind (5.14 KB, application/octet-stream)
2012-01-11 23:19 UTC, Aneesh
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aneesh 2012-01-11 23:19:10 UTC
Created attachment 313 [details]
Patch to add support for mfatbu and mfatbl in valgrind

PowerPC uses two alternate time base registers which are read from user space
by using PPC instructions mfatbu and mfatbl . However these instructions are
not not supported by Valgrind.
CPU : e500mc
Here are the logs when an application executing such instruction is executed
with Valgrind:

dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
disInstr(ppc): unhandled instruction: 0x7C0F82A6
                 primary 31(0x1F), secondary 678(0x2A6)
==2204== valgrind: Unrecognised instruction at address 0x10003dfc.
==2204==    at 0x10003DFC: ??? (in /usr/bin/simple_crypto)
==2204==    by 0x1000181B: ??? (in /usr/bin/simple_crypto)
==2204==    by 0xFE179E7: ??? (in /lib/libpthread-2.13.so)
==2204==    by 0x40EEA9B: ??? (in /lib/libc-2.13.so)
==2204== Your program just tried to execute an instruction that Valgrind
==2204== did not recognise.  There are two possible reasons for this.
==2204== 1. Your program has a bug and erroneously jumped to a non-code
==2204==    location.  If you are running Memcheck and you just saw a
==2204==    warning about a bad jump, it's probably your program's fault.
==2204== 2. The instruction is legitimate but Valgrind doesn't handle it,
==2204==    i.e. it's Valgrind's fault.  If you think this is the case or
==2204==    you are not sure, please let us know and we'll try to fix it.
==2204== Either way, Valgrind will now raise a SIGILL signal which will
==2204== probably kill your program.


We have developed a path to fix the issue.
Kindly find it attached.