Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.

SGX Reserved Memory

PYuhala
Beginner
1,182 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
1,168 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

0 Kudos
3 Replies
JesusG_Intel
Moderator
1,169 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


0 Kudos
PYuhala
Beginner
1,153 Views

Hello, 

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

Best regards,

Peterson Yuhala

0 Kudos
JesusG_Intel
Moderator
1,142 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.


0 Kudos
Reply