background image

Vol. 3D 41-11

SGX INSTRUCTION REFERENCES

EADD—Add a Page to an Uninitialized Enclave  

Instruction Operand Encoding

Description

This leaf function copies a source page from non-enclave memory into the EPC, associates the EPC page with an 
SECS page residing in the EPC, and stores the linear address and security attributes in EPCM. As part of the asso-
ciation, the enclave offset and the security attributes are measured and extended into the SECS.MRENCLAVE. This 
instruction can only be executed when current privilege level is 0.
RBX contains the effective address of a PAGEINFO structure while RCX contains the effective address of an EPC 
page. The table below provides additional information on the memory parameter of EADD leaf function.

EADD Memory Parameter Semantics

The instruction faults if any of the following: 

EADD Faulting Conditions

Concurrency Restrictions

Opcode/

Instruction

Op/En

64/32 

bit Mode 

Support

CPUID 

Feature 

Flag

Description

 EAX = 01H

IR

V/V

SGX1

This leaf function adds a page to an uninitialized enclave.

ENCLS[EADD]

Op/En

EAX

RBX

RCX

IR

EADD (In)

Address of a PAGEINFO (In)

Address of the destination EPC page (In)

PAGEINFO

PAGEINFO.SECS

PAGEINFO.SRCPGE

PAGEINFO.SECINFO

EPCPAGE

Read access permitted 

by Non Enclave 

Read/Write access permit-

ted by Enclave 

Read access permitted 

by Non Enclave 

Read access permitted 

by Non Enclave 

Write access permitted 

by Enclave

The operands are not properly aligned.

Unsupported security attributes are set.

Refers to an invalid SECS.

Reference is made to an SECS that is locked by another thread.

The EPC page is locked by another thread.

RCX does not contain an effective address of an EPC page.

The EPC page is already valid.

If security attributes specifies a TCS and the source page specifies unsupported 

TCS values or fields.

The SECS has been initialized.

The specified enclave offset is outside of the enclave address space.

Table 41-5.  Concurrency Restrictions of EADD with Other Intel® SGX Operations 1 of 2

Operation

EEXIT

EADD

EBLOCK

ECRE

ATE

EDBGRD/

WR

EENTER/

ERESUME

EEXTEND

EGETKEY

EINIT

ELDB/ELDU

EPA

Param TCS SSA SECS Targ SECS Targ SECS SECS

Targ SECS TCS SSA SECS Targ SECS Param SECS SECS Targ VA SECS VA

EADD

Targ

N

N

N

N

N

N

N

N

N

N

N

SECS

N

N

Y

Y

N

Y

N

N

N

N

Y

N