This PR adds support for the encls, enclu and enclv instructions as described by chapter 41 "SGX Instruction References" in volume 3D of the Intel 64 and IA-32 Architectures Software Developer's Manual. These are used in supervisor mode, user mode and VMM mode respectively.
These instructions are somewhat similar to cpuid, in that they accept all have a leaf function that can be specified through the eax register. However, unlike cpuid, the ebx, ecx and edx can both be used as inputs and outputs depending on the specific leaf function.
While Intel SGX is usable on a select set of Intel CPUs, it is usable both in 32-bit and 64-bit mode on those CPUs.
This PR is as follows:
- Implement
encls,encluandenclvin the decoder for x86. - Add
INSTR_CREATEmacros forencls,encluandenclv. - Add test cases for
encls,encluandenclv.