Virtualize CPUID.  Rather than just using the host CPU's CPUID,
we now completely virtualize it.  The feature flags returned are the
intersection of the set the CPU supports, and the set of flags Valgrind
supports.  This turns out to be a small number of features, like FPU,
TSC, MMX, SSE, SSE2, FXSR.  All mention of things which are only useful
to kernel-mode code are also suppressed.  This CPUID doesn't support
any extended feature flags, or extended CPUID operations.  It returns a
vendor string of "ValgrindVCPU".

If the host CPU doesn't support CPUID, then we make sure we treat it as
an illegal instruction (I'm not sure if we handle the eflags bit toggle
test right).  This is because the CPUID helper doesn't actually use the
cpuid instruction in all cases, so it may succeed where the host CPU
wouldn't (other instructions which depend on feature flags will end up
generating those instructions, so they'll endup generating a SIGILL if
client code uses them on a CPU which doesn't support them).


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2225 a5019735-40e9-0310-863c-91ae7b9d1cf9
4 files changed