Bug 1895

Summary: valgrind : Unhanded instructions mfatbu and mfatbl
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Aneesh <aneesh.bansal>
Component: coreAssignee: Dongxiao Xu <dongxiao.xu>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: unspecified   
Target Milestone: 1.2 M3   
Hardware: x86   
OS: ppc   
Whiteboard: No update
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
Patch to add support for mfatbu and mfatbl in valgrind none

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.