Article ID: 000089550 Content Type: Product Information & Documentation Last Reviewed: 02/08/2022

Unable to Find the Size of Enclave Page Cache (EPC)

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Two methods to determine the EPC size.

Description
  • In Windows*, the maximum enclave size is limited by the EPC.
  • Cannot use the Intel® Software Guard Extensions (SGX) SDK to find the size of the EPC.
Resolution

Method 1:
Find
the Intel® Software Guard Extensions (SGX) Processor Reserved Memory (PRM) size, which is the amount of memory reserved for Intel SGX and contains the EPC, in BIOS. It will be listed differently depending on the BIOS but the SGX memory setting is usually next to the SGX Enable setting. If the PRM is 128 MB, 96 MB of that is allocated to the EPC.

Method 2:
Use test_sgx.c:

  1. Go to the SGX Hardware Github and download the file test_sgx.c or clone the repository
  2. Compile and run test_sgx.c according to these instructions:

    $ gcc test-sgx.c -o test-sgx

    $ ./test-sgx

  3. Look for output like:

    CPUID Leaf 12H, Sub-Leaf 2 of Intel SGX Capabilities (EAX=12H,ECX=2)

    eax: 70200001 ebx: 0 ecx: 5d80001 edx: 0

    size of EPC section in Processor Reserved Memory, 93 M

The ecx register contains the EPC size: ecx: 5d80000 = 93MB

Additional information

Most platforms have either 128 MB or 256 MB of PRM. The exception are 3rd Generation Intel® Xeon® Scalable processors, which each support 512GB of PRM size, adding up to 1TB on a two-socket platform.