Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1093 Discussions

Is it possible to combine CPUID and Instruction set emulation arguments in Intel SDE?

Petrov__Petar
Beginner
1,477 Views

Running `sde.exe -nhm -bmi1 1 -- TestConsole.exe` command don't take into account the `-bmi1 1` option.
It emulates `nhm` instruction set correctly but doesn't emulate the `bmi1` instruction set.
Is it possible to combine them some other way?

 

Best regards,

ptp

0 Kudos
1 Solution
AdyT_Intel
Moderator
1,477 Views

To control the emulation of the CPUID instruction use the -cpuid_in <file> knob.
The CPUID definition file is written in a certain format.
For you purposes you should take the closest file from the kit in <kit>/misc/cpuid/<chip>/cpuid.def and copy it to a new location.
This file is like a dictionary mapping values of EAX/ECX to their expected results.
Then you can edit the certain bits you need, and specify this file to SDE.

This will become something like:
> sde -hsw -cpuid_in <mycpuid.def> -- app

You still need the HSW knob to allow executing the BMI instructions.

View solution in original post

0 Kudos
3 Replies
AdyT_Intel
Moderator
1,477 Views

No exactly, the -nhm knob instructs SDE to ensure that the application use NHM ISA and that the CPUID instruction behaves as in NHM CPU.
Since the instruction compliance checks for NHM does not include BMI, you will need to either use a CPU that supports BMI (like HSW) or disable chip-check.

It you need to update emulation of the CPUID instruction to include BMI, then we have a way to do it.

0 Kudos
Petrov__Petar
Beginner
1,477 Views

Hello,

Thank you for the quick reply. I am developing a C# wrapper around SDE executable for testing purposes. My main goal is to be able to run some code with specific instruction sets.

It you need to update emulation of the CPUID instruction to include BMI, then we have a way to do it.

How can i update emulation of the CPUID or can i define my CPUID with custom instruction sets? 

0 Kudos
AdyT_Intel
Moderator
1,478 Views

To control the emulation of the CPUID instruction use the -cpuid_in <file> knob.
The CPUID definition file is written in a certain format.
For you purposes you should take the closest file from the kit in <kit>/misc/cpuid/<chip>/cpuid.def and copy it to a new location.
This file is like a dictionary mapping values of EAX/ECX to their expected results.
Then you can edit the certain bits you need, and specify this file to SDE.

This will become something like:
> sde -hsw -cpuid_in <mycpuid.def> -- app

You still need the HSW knob to allow executing the BMI instructions.

0 Kudos
Reply