Vol. 3D 41-41
SGX INSTRUCTION REFERENCES
ELDB/ELDU—Load an EPC page and Marked its State
Instruction Operand Encoding
Description
This leaf function copies a page from regular main memory to the EPC. As part of the copying process, the page is
cryptographically authenticated and decrypted. This instruction can only be executed when current privilege level
is 0.
The ELDB leaf function sets the BLOCK bit in the EPCM entry for the destination page in the EPC after copying. The
ELDU leaf function clears the BLOCK bit in the EPCM entry for the destination page in the EPC after copying.
RBX contains the effective address of a PAGEINFO structure; RCX contains the effective address of the destination
EPC page; RDX holds the effective address of the version array slot that holds the version of the page.
The table below provides additional information on the memory parameter of ELDB/ELDU leaf functions.
EBLDB/ELDBU Memory Parameter Semantics
The error codes are:
Concurrency Restrictions
Opcode/
Instruction
Op/En
64/32
bit Mode
Support
CPUID
Feature
Flag
Description
EAX = 07H
IR
V/V
SGX1
This leaf function loads, verifies an EPC page and marks the page
as blocked.
ENCLS[ELDB]
EAX = 08H
IR
V/V
SGX1
This leaf function loads, verifies an EPC page and marks the page
as unblocked.
ENCLS[ELDU]
Op/En
EAX
RBX
RCX
RDX
IR
ELDB/ELDU
(In)
Return error
code (Out)
Address of the PAGEINFO
(In)
Address of the EPC page
(In)
Address of the version-
array slot (In)
PAGEINFO
PAGEINFO.SRCPGE
PAGEINFO.PCMD
PAGEINFO.SECS
EPCPAGE
Version-Array Slot
Non-enclave
read access
Non-enclave read
access
Non-enclave read
access
Enclave read/write
access
Read/Write access
permitted by Enclave
Read/Write access per-
mitted by Enclave
Table 41-25. ELDB/ELDU Return Value in RAX
Error Code (see Table 41-3)
Description
No Error
ELDB/ELDU successful
SGX_MAC_COMPARE_FAIL
If the MAC check fails
Table 41-26. Concurrency Restrictions of ELDB/ELDU with Intel® SGX Instructions - 1of 2
Operation
EEXIT
EADD
EBLOCK
ECRE
ATE
EDBGRD/
WR
EENTER/
ERESUME
EEXTEND
EGETKEY
EINIT
ELDB/ELDU
EPA
Param Targ VA
SECS Targ SECS Targ SECS SECS
Targ SECS TCS SSA SECS Targ SECS Param SECS SECS Targ VA
SECS VA
ELDB/E
LDU
Targ
N
N
N
N
N
N
N
N
N
N
N
VA
N
N
Y
N
Y
N
SECS
Y
N
Y
Y
N
Y
Y
Y
Y
Y
N
Y