background image

41-22 Vol. 3D

SGX INSTRUCTION REFERENCES

Operation

Temp Variables in ECREATE Operational Flow

IF (DS:RBX is not 32Byte Aligned)

THEN #GP(0); FI;

IF (DS:RCX is not 4KByte Aligned)

THEN #GP(0); FI;

IF (DS:RCX does not resolve within an EPC)

THEN #PF(DS:RCX); FI;

TMP_SRCPGE  DS:RBX.SRCPGE;
TMP_SECINFO  DS:RBX.SECINFO;

IF (DS:TMP_SRCPGE is not 4KByte aligned or DS:TMP_SECINFO is not 64Byte aligned)

THEN #GP(0); FI;

IF (DS:RBX.LINADDR ! = 0 or DS:RBX.SECS ≠ 0)

THEN #GP(0); FI;

(* Check for misconfigured SECINFO flags*)
IF (DS:TMP_SECINFO reserved fields are not zero or DS:TMP_SECINFO.FLAGS.PT ≠ PT_SECS) ) 

THEN #GP(0); FI;

TMP_SECS  RCX;

IF (EPC entry in use) 

THEN #GP(0); FI;

IF (EPCM(DS:RCX).VALID = 1) 

THEN #PF(DS:RCX); FI;

(* Copy 4KBytes from source page to EPC page*)
DS:RCX[32767:0]  DS:TMP_SRCPGE[32767:0];

(* Check lower 2 bits of XFRM are set *)
IF ( ( DS:TMP_SECS.ATTRIBUTES.XFRM BitwiseAND 03H) ≠ 03H) 

THEN #GP(0); FI;

IF (XFRM is illegal) 

Name

Type

Size (Bits)

Description

TMP_SRCPGE

Effective Address

32/64

Effective address of the SECS source page.

TMP_SECS

Effective Address

32/64

Effective address of the SECS destination page.

TMP_SECINFO

Effective Address

32/64

Effective address of an SECINFO structure which contains security 

attributes of the SECS page to be added.

TMP_XSIZE

SSA Size

64

The size calculation of SSA frame.

TMP_MISC_SIZE

MISC Field Size

64

Size of the selected MISC field components.

TMPUPDATEFIELD

SHA256 Buffer

512

Buffer used to hold data being added to TMP_SECS.MRENCLAVE.