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

How to get SGX memory size of the hardware in linux

Rajendra_K_
Beginner
1,168 Views

Hi,

I can find if SGX is enabled or not from CPUID instruction.

I want to get SGX memory size in Linux. 

Please let me know how to find it.

Thanks,

Rajendra

0 Kudos
3 Replies
Shivananda_H_Intel
1,168 Views

I assume, you are referring to the SGX Memory available for use after the device bootup and SGX is enabled in BIOS.

You can check/print it in isgx_page_cache_init(.. ) the size param, which will be the  EPC Size available  for SGX Use.

Regards

Shivananda

0 Kudos
Rajendra_K_
Beginner
1,168 Views

To get it though sgx_page_cache_init() , we should have SDK installed.

What if SDK is not installed and we need to check SGX memory?

Is there a way that, I can get it from CPUID instruction? , The way we are getting SGX enabled or not from CPUID instruction by passing 07H in EAX register.

0 Kudos
Shivananda_H_Intel
1,168 Views

CPUID leaf 12H sub-leaves 2 and higher report physical memory resources available for use with Intel SGX. These physical memory sections are typically configured by BIOS as Processor Reserved Memory, and available to the OS to manage as EPC. 

Pls refer to below programming guide for more info . Page 17

https://software.intel.com/sites/default/files/managed/48/88/329298-002.pdf

Regards

Shivananda

 

0 Kudos
Reply