41-54 Vol. 3D
SGX INSTRUCTION REFERENCES
EREMOVE—Remove a page from the EPC
Instruction Operand Encoding
Description
This leaf function causes an EPC page to be un-associated with its SECS and be marked as unused. This instruction
leaf can only be executed when the current privilege level is 0.
The content of RCX is an effective address of an EPC page. The DS segment is used to create linear address.
Segment override is not supported.
The instruction fails if the operand is not properly aligned or does not refer to an EPC page or the page is in use by
another thread, or other threads are running in the enclave to which the page belongs. In addition the instruction
fails if the operand refers to an SECS with associations.
EREMOVE Memory Parameter Semantics
The instruction faults if any of the following:
EREMOVE Faulting Conditions
The error codes are:
Opcode/
Instruction
Op/En
64/32
bit Mode
Support
CPUID
Feature
Flag
Description
EAX = 03H
IR
V/V
SGX1
This leaf function removes a page from the EPC.
ENCLS[EREMOVE]
Op/En
EAX
RCX
IR
EREMOVE (In)
Effective address of the EPC page (In)
EPCPAGE
Write access permitted by Enclave
The memory operand is not properly aligned.
The memory operand does not resolve in an EPC page.
Refers to an invalid SECS.
Refers to an EPC page that is locked by another thread.
Another Intel SGX instruction is accessing the EPC page.
RCX does not contain an effective address of an EPC page.
the EPC page refers to an SECS with associations.
Table 41-36. EREMOVE Return Value in RAX
Error Code (see Table 41-3)
Description
No Error
EREMOVE successful
SGX_CHILD_PRESENT
If the SECS still have enclave pages loaded into EPC
SGX_ENCLAVE_ACT
If there are still logical processors executing inside the enclave