Skip to content

Commit

Permalink
test-sgx: Support to show the status of SGX Launch Control
Browse files Browse the repository at this point in the history
Signed-off-by: Jia Zhang <zhang.jia@linux.alibaba.com>
  • Loading branch information
jiazhang0 committed Apr 4, 2019
1 parent 7c4bb49 commit 3ed97aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test-sgx.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ int main(int argc, char **argv)
//CPUID.(EAX=07H, ECX=0H):EBX.SGX = 1,
printf("sgx available: %d\n", (ebx >> 2) & 0x1);

//CPUID.(EAX=07H, ECX=0H):ECX.SGX_LC = 1
printf("sgx launch control: %d\n", (ecx >> 30) & 0x01);

/* SGX has to be enabled in MSR.IA32_Feature_Control.SGX_Enable
check with msr-tools: rdmsr -ax 0x3a
SGX_Enable is Bit 18
Expand Down

0 comments on commit 3ed97aa

Please sign in to comment.