Chip Check Feature
One of the main emulation services that Intel® SDE provides is the chip-check feature. This service checks that every dynamically executed instruction is legal for the input chip. When detecting an illegal instruction, the process will exit with an error message of the form:
% sde -skl -- myapp
TID 0 SDE-ERROR: Executed instruction not valid for specified chip (SKYLAKE): 0x40118c rdpid rax
Image: myapp+0x118c
Function: test1
Instruction bytes are: f3 48 0f c7 f8
Optionally, Intel® SDE can also emit a call-stack of the execution path that leads to the invalid instruction, or to only report the illegal instructions to an output file (and continue).
Intel® SDE allows the user to define the chip from a long list of old and new CPUs. In certain cases this check is too strict, for example when the defined chip is older than the host CPU, and the system libraries execute instructions which are not legal for the input chip.
Another usage model is to define which instructions are legal for this run based on an input CPUID definition. This means that the user defines its own CPUID behavior and chip-check will allow execution of only the instructions which are available (and legal) as defined for this CPU. More information is available in the CPUID Emulation section.
There is an option to suppress errors for instructions of specific ISA sets (see the -chip-check-ignore-isaset control).
The chip-check module can also dump the list of available chips, or to dump all the XED IFORMs legal for the input chip.
Note
When specifying the chip knob in Intel® SDE command line, you actually define the CPUID behavior and the corresponding chip for the chip-check feature.
Chip-check controls
- -chip_check
Restrict to a specific XED chip [no default value]
- -chip_check_call_stack
Emit the call stack on error [default 0]
- -chip_check_call_stack_depth
Specify chip-check call-stack max depth [default 10]
- -chip_check_cpuid
Check against features in the active CPUID definition [default 0]
- -chip_check_die
Die on errors. 0=warn, 1=die [default 1]
- -chip_check_disable
Disable the chip checking mechanism [default 0]
- -chip_check_emit_file
Emit messages to a file. 0=no file, 1=file [default 0]
- -chip_check_exe_only
Check only the main executable [default 0]
- -chip_check_file
Output file chip-check errors [default sde-chip-check.txt]
- -chip_check_image
Repeatable knob to specify which images to check [no default value]
- -chip_check_list
List valid chip names and exit [default 0]
- -chip_check_list_iforms
List valid XED IFORMs for a specific chip and exit [default 0]
- -chip_check_stderr
Try to emit messages to stderr. 0=no stderr, 1=stderr [default 1]
- -chip_check_vsyscall
Enable the chip checking checking in the VSYSCALL area (Linux only) [default 0]
- -chip_check_win_sys_ignore
Disable the chip checking in Windows NTDLL library (Windows only) [default 1]
- -chip_check_zcnt
The TSCNT/LZCNT has backward compatibility, check it explicitly anyway [default 0]
- -chip-check-jit
Check during JIT’ing only. Checked code might not be executed due to speculative JIT’ing, but this mode is a little faster [default 0]
- -chip-check-ignore-isaset
Repeatable knob to specify specific ISA set to ignore in chip check.
Note
The -chip-check-ignore-isaset control accepts a a case sensitive ISA set name as defined in XED, for example AVX512F_128. The Intel® SDE kit has a text file called idata.txt that lists all the instructions supported by the kit. The ISA set is specified for each instruction.