background image

Vol. 3D 41-31

SGX INSTRUCTION REFERENCES

EEXTEND—Extend Uninitialized Enclave Measurement by 256 Bytes 

Instruction Operand Encoding

Description

This leaf function updates the MRENCLAVE measurement register of an SECS with the measurement of an EXTEND 
string compromising of “EEXTEND” || ENCLAVEOFFSET || PADDING || 256 bytes of the enclave page. This instruc-
tion can only be executed when current privilege level is 0 and the enclave is uninitialized. 
RBX contains the effective address of the SECS of the region to be measured. The address must be the same as the 
one used to add the page into the enclave.
RCX contains the effective address of the 256 byte region of an EPC page to be measured. The DS segment is used 
to create linear addresses. Segment override is not supported.

EEXTEND Memory Parameter Semantics

The instruction faults if any of the following: 

EEXTEND Faulting Conditions

Concurrency Restrictions

Opcode/

Instruction

Op/En

64/32 

bit Mode 

Support

CPUID 

Feature 

Flag

Description

 EAX = 06H

IR

V/V

SGX1

This leaf function measures 256 bytes of an uninitialized enclave 

page.

ENCLS[EEXTEND]

Op/En

EAX

EBX

RCX

IR

EEXTEND (In)

Effective address of the SECS of the 

data chunk (In)

Effective address of a 256-byte chunk in the EPC (In)

EPC[RCX]

Read access by Enclave 

RBX points to an address not 4KBytes aligned.

RBX does not resolve to an SECS.

RBX does not point to an SECS page.

RBX does not point to the SECS page of the data chunk.

RCX points and address not 256B aligned.

RCX points to an unused page or a SECS.

RCX does not resolve in an EPC page.

If SECS is locked.

If the SECS is already initialized.

May page fault.

CPL > 0.

Table 41-20.  Concurrency Restrictions of EEXTEND 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

EEXTEND Targ

N

N

N

Y

N

Y

Y

N

N

N

SECS

Y

Y

Y

Y

N

Y

Y

Y

Y

Y

Y

Y

N

Y

N

Y

N

N

Y

Y

Y

Y