Bug 155528

Summary: valgrind cupinfo reports a CPU, which does not reflect valgrind's instruction set.
Product: [Developer tools] valgrind Reporter: Wolfgang Glas <wolfgang.glas>
Component: generalAssignee: Julian Seward <jseward>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.2.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: The output of cpuid on my core2, x86_64
Output of 'valgrind cpuid' on my core2, x86_64

Description Wolfgang Glas 2008-01-12 16:52:15 UTC
Version:           3.2.3 (using KDE KDE 4.0.0)
Installed from:    Ubuntu Packages
Compiler:          gcc-4.1 
OS:                Linux

We've ran into the issue

  http://bugs.kde.org/show_bug.cgi?id=113849

where the icc runtime library terminates, because the CPU reported by valgrind's emulation of the CPUID instruction return the description of an Athlon64 CPU. This CPU does not support SSE2 nor does is support SSE3.

However, according to e.g.

  https://bugs.kde.org/show_bug.cgi?id=129358

valgrind currently supports SSE3 and supposedly it does support SSE2, too.

  So, IMHO the CUPID emulation of valgrind should report a CPU, which is capable of all these features making the reported CPU type coherent with valgrind's supported instruction est.

  The easiest wayto check this is to install the 'cupid' tool and comparing the output of 'cupid' and 'valgrind cpuid'.

  Regards,

     Wolfgang
Comment 1 Julian Seward 2008-01-13 02:13:28 UTC
>   So, IMHO the CUPID emulation of valgrind should report a CPU, which is
> capable of all these features making the reported CPU type coherent with
> valgrind's supported instruction est.


Yes, I agree.  I'll maybe change it to report a Core 2 CPU.  BTW, did this
happen in 64-bit mode or 32-bit?
Comment 2 Wolfgang Glas 2008-01-13 10:00:07 UTC
Created attachment 22983 [details]
The output of cpuid on my core2, x86_64
Comment 3 Wolfgang Glas 2008-01-13 10:03:38 UTC
Created attachment 22984 [details]
Output of 'valgrind cpuid' on my core2, x86_64

I've attached the output of my cpuid and 'valgrind cpuid' output on my x86_64
core2 laptop.

Since I do not have further insight into valgrind's internal architecture I'm
unable to judge, whether the CPUID instruction has be dependent on the
underlying hardware or not. (I.e. can valgrind execute an executable with SSE3
instruction on a hardware, that does not support SSE3 ?)

  TIA for dealing with this issue,

    Wolfgang
Comment 4 Wolfgang Glas 2008-01-13 10:11:03 UTC
@julian: Now, I've groked your question. Yes, we do use a 64bit kernel and 64bit executables. The questionable progrm is a number crunching application, where we won't miss the 64bit advantages...
Comment 5 Julian Seward 2008-02-09 03:00:39 UTC
SSSE3 support has been added to the trunk, and the CPUID output
is updated accordingly, so now it reports I-am-an-Intel-Core2.
I believe this should solve the problem.  Can you try it out?
Comment 6 Julian Seward 2008-05-09 10:28:28 UTC
Fixed.  Fix will be in 3.3.1.