Julian Seward wrote:
>>  Trying to avoid doing real work, I searched for "unsupported CPU" and
>> found it in coregrind/m_main.c.  I then found VG_(machine_get_hwcaps)() in
>> m_machine.c.  Putting a few VG_(printf)() calls into this routine, I found
>> that it fails this test:
>>
>>       /* cmpxchg8b is a minimum requirement now; if we don't have it we
>>          must simply give up.  But all CPUs since Pentium-I have it, so
>>          that doesn't seem like much of a restriction. */
>>       have_cx8 = (edx & (1<<8)) != 0; /* True => have cmpxchg8b */
>>       if (!have_cx8)
>>          return False;
>>
>>  Interestingly, /proc/cpuinfo does not show "cx8" on my machines, while it
>> does on yours.  I didn't think my CPU was that old, since it runs at 1.2
>> GHz (I bought the machines in late 2006).  Looks like I am out of luck on
>> these two machines.  Given the comment in the source code here, I doubt
>> very much that provisions would be made to support this CPU.  :-)
>>     
>
> It may be that the CPU does support cmpxchg8b but doesn't say it does.
> Try compiling and running the program none/tests/x86/cmpxchg8b.c in the
> 3.5.0 tree, and see if it runs natively OK (without SIGILL).  If yes
> then comment out the relevant test in VG_(machine_get_hwcaps)().
>
> J
>
>   
I got the following output from the program, which looks correct if my 
understanding of CMPXCHG8B is correct (last time I wrote ASM, the 386 
was still very new!):

0x22222222 0x44444444 0x33333333 0x11111111 0x246 0x3333333344444444
0x22222223 0x44444444 0x33333333 0x11111111 0x206 0x1111111122222223
0x22222222 0x44444444 0x33333333 0x11111112 0x206 0x1111111222222222
0x77777777 0x44444444 0x33333333 0x66666666 0x206 0x6666666677777777

It didn't core dump, anyway, and "./vg-in-place date" runs to completion 
after I comment out those lines in VG_(machine_get_hwcaps)().  So I 
guess that's a good thing.  But it's nearly 3 A.M. here in California 
and I could be wrong.  ;-)

It is a little surprising that the C7 Esther core doesn't report that 
instruction, but the Linux kernel has special compilation flags for this 
CPU because it claims to be a 686 compatible processor yet doesn't 
implement all of the instructions of a real Pentium II.  Maybe this is a 
similar issue (though harmless for most software packages because they 
work around it).

Thanks for your help.

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to