Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

SGX Reserved Memory

PYuhala
Beginner
441 Views

Hello, 

I will like to know what exactly "Reserved Memory" is as indicated in the SGX dev reference for linux* OS. Does this represent memory in the enclave heap ? Or is it real/physical EPC memory. How large can the value in ReservedMemMinSize (in the enclave config file) be ? What are the effects of increasing/reducing this size ? 

I found it a bit difficult to get specific information about Reserved Memory; the dev reference does not explicitly answer the above questions.

 

Best regards,

Peterson Yuhala

0 Kudos
1 Solution
JesusG_Intel
Moderator
427 Views

Hello Pyuhala,


You are right, the developer reference guide does not explain those parameters very well. The section on Reserved Memory Functions explains how to use them. You can use this memory to allocate extra space at the end of the heap for the enclave during runtime. use the functions below to allocate and free that memory as needed. As explained in the section below, you will need this only under special circumstances.


Reserved Memory Functions

Intel(R) SGX SDK allows users to configure a reserved memory area for special usage, such as JIT support. The memory is allowed to be configured or changed to executable. See Enclave Configuration File for details. To manage the reserved memory the sgx_tstdc library provides the following functions to query the memory information, allocate and deallocate the memory, change the memory protection.

  • sgx_get_rsrv_mem_info
  • sgx_alloc_rsrv_mem
  • sgx_alloc_rsrv_mem_ex
  • sgx_free_rsrv_mem
  • sgx_tprotect_rsrv_mem


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

3 Replies
JesusG_Intel
Moderator
428 Views

Hello Pyuhala,


You are right, the developer reference guide does not explain those parameters very well. The section on Reserved Memory Functions explains how to use them. You can use this memory to allocate extra space at the end of the heap for the enclave during runtime. use the functions below to allocate and free that memory as needed. As explained in the section below, you will need this only under special circumstances.


Reserved Memory Functions

Intel(R) SGX SDK allows users to configure a reserved memory area for special usage, such as JIT support. The memory is allowed to be configured or changed to executable. See Enclave Configuration File for details. To manage the reserved memory the sgx_tstdc library provides the following functions to query the memory information, allocate and deallocate the memory, change the memory protection.

  • sgx_get_rsrv_mem_info
  • sgx_alloc_rsrv_mem
  • sgx_alloc_rsrv_mem_ex
  • sgx_free_rsrv_mem
  • sgx_tprotect_rsrv_mem


Sincerely,

Jesus G.

Intel Customer Support


PYuhala
Beginner
412 Views

Hello, 

Thanks for your response; I think it is much clearer now.

Best regards,

Peterson Yuhala

JesusG_Intel
Moderator
401 Views

Hello Pyuhala,


Thanks for the feedback.


This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.


Reply