Bug 386851

Summary: Please add support for CPUID override
Product: [Developer tools] valgrind Reporter: Daniel <bugzilla>
Component: generalAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: 3.13.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Daniel 2017-11-13 11:33:29 UTC
Please allow to override CPUID values. This would be helpful to test apps which has few versions of code, and selects one of them at runtime after checking data returned by CPUID. Second use case is to simulate code with instructions which are not supported natively by CPU, e.g. to test code which uses AVX512 on some non-AVX512 CPU.

Simulation of CPUs with less features should be pretty straightforward to implement. Adding new features may be more complex, if VG internally delegates instruction execution to real CPU - it would have to simulate them in software.

To make this feature easy to use, VG should provide predefined CPUID profiles for various CPUs, e.g. like Intel SDE does (link below). You can also add separate option(s) to fine-tune CPUID data, some users may find this useful too.
https://software.intel.com/en-us/articles/intel-software-development-emulator#BASIC