background image

41-18 Vol. 3D

SGX INSTRUCTION REFERENCES

EBLOCK—Mark a page in EPC as Blocked  

Instruction Operand Encoding

Description

This leaf function causes an EPC page to be marked as BLOCKED. This instruction can only be executed when 
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.
An error code is returned in RAX.
The table below provides additional information on the memory parameter of EBLOCK leaf function.

EBLOCK Memory Parameter Semantics

The error codes are: 

Concurrency Restrictions

Opcode/

Instruction

Op/En

64/32 

bit Mode 

Support

CPUID 

Feature 

Flag

Description

 EAX = 09H

IR

V/V

SGX1

This leaf function marks a page in the EPC as blocked.

ENCLS[EBLOCK]

Op/En

EAX

RCX

IR

EBLOCK (In)

Return error code (Out)

Effective address of the EPC page (In)

EPCPAGE

Read/Write access permitted by Enclave

Table 41-9.  EBLOCK Return Value in RAX

 Error Code (see Table 41-3)

Description

No Error

EBLOCK successful

SGX_BLKSTATE

Page already blocked. This value is used to indicate to a VMM that the page was already in 

BLOCKED state as a result of EBLOCK and thus will need to be restored to this state when it is 

eventually reloaded (using ELDB). 

SGX_ENTRYEPOCH_LOCKED

SECS locked for Entry Epoch update. This value indicates that an ETRACK is 
currently executing on the SECS. The EBLOCK should be reattempted.

SGX_NOTBLOCKABLE

Page type is not one which can be blocked

SGX_PG_INVLD

Page is not valid and cannot be blocked

SGX_LOCKFAIL

Page is being written by EADD, EAUG, ECREATE, ELDU/B, EMODT, or EWB

Table 41-10.  Concurrency Restrictions of EBLOCK 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

EBLOCK

Targ

Y

Y

Y

N

C

C

C

N

Y

C

Y

Y

C

Y

C

Y

C

Y

N

C

C

N

SECS

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y

Y