Friday, February 12, 2021

[How To] check if Intel SGX is enabled


Steps to check if Intel SGX is enabled on your system:

1. Download test-sgx.c from https://github.com/ayeks/SGX-hardware

2. % gcc test-sgx.c -o test-sgx

3. % ./test-sgx

eax: 806ea ebx: 4100800 ecx: 7ffafbbf edx: bfebfbff

stepping 10

model 14

family 6

processor type 0

extended model 8

extended family 0

smx: 0


Extended feature bits (EAX=07H, ECX=0H)

eax: 0 ebx: 29c67af ecx: 0 edx: 9c002600

sgx available: 1

sgx launch control: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0

sgx 1 supported: 0

sgx 2 supported: 0

MaxEnclaveSize_Not64: 0

MaxEnclaveSize_64: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


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

eax: 0 ebx: 0 ecx: 0 edx: 0


4. sgx available = 1 means that the system has a CPU that supports Intel SGX


5. From sgx1 supported = 0 and max enclave size64 = 0 we infer that Intel SGX is disabled from BIOS

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.