background image

38-10 Vol. 3D

ENCLAVE ACCESS CONTROL AND DATA STRUCTURES

information of currently defined MISC components are listed in Table 38-11. For example, if the highest bit set 
in SECS.MISCSELECT is bit 0, the MISC region offset is OFFSET(GPRSGX)-16 and size is 16 bytes.

The processor saves a MISC component i in the MISC region if and only if SECS.MISCSELECT[i] is 1.

38.9.2.1   EXINFO Structure

Table 38-12 contains the layout of the EXINFO structure that provides additional information. 

38.9.2.2   Page Fault Error Codes

Table 38-13 contains page fault error code that may be reported in EXINFO.ERRCD. 

38.10 PAGE 

INFORMATION 

(PAGEINFO)

PAGEINFO is an architectural data structure that is used as a parameter to the EPC-management instructions. It 
requires 32-Byte alignment.

Table 38-11.  Layout of MISC region of the State Save Area

MISC Components

OFFSET (Bytes)

Size (Bytes)

Description

EXINFO

Offset(GPRSGX) –16 16

if CPUID.(EAX=12H, ECX=0):EBX[0] = 1, exception information on #GP or 

#PF that occurred inside an enclave can be written to the EXINFO structure 

if specified by SECS.MISCSELECT[0] = 1.

Future Extension

Below EXINFO

TBD

Reserved. (Zero size if CPUID.(EAX=12H, ECX=0):EBX[31:1] =0).

Table 38-12.  Layout of EXINFO Structure

Field

OFFSET (Bytes) Size (Bytes)

Description

MADDR

0

8

If #PF: contains the page fault linear address that caused a page fault.

If #GP: the field is cleared.

ERRCD

8

4

Exception error code for either #GP or #PF.

RESERVED

12

4

Table 38-13.  Page Fault Error Codes

Name

Bit Position

Description

P

0

Same as non-SGX page fault exception P flag.

W/R

1

Same as non-SGX page fault exception W/R flag.

U/S

1

NOTES:

1. Page faults incident to enclave mode that report U/S=0 are not reported in EXINFO

2

Always set to 1 (user mode reference).

RSVD

3

Same as non-SGX page fault exception RSVD flag.

I/D

4

Same as non-SGX page fault exception I/D flag.

PK

5

Protection Key induced fault.

RSVD

14:6

Reserved.

SGX

15

EPCM induced fault.

RSVD

31:5

Reserved.