Skip to content

Commit

Permalink
Merge pull request #133 from haitaohuang/master
Browse files Browse the repository at this point in the history
Use cpuid instead of boot_cpu_has to check cpu features
  • Loading branch information
haitaohuang committed Apr 20, 2021
2 parents 0373e2e + ed2c256 commit 2d2b795
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sgx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ static int sgx_drv_probe(struct platform_device *pdev)
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
return -ENODEV;

if (!boot_cpu_has(X86_FEATURE_SGX)) {
cpuid(7, &eax, &ebx, &ecx, &edx);
if(!((ebx >> 2) & 0x1)){
pr_err("intel_sgx: the CPU is missing SGX\n");
return -ENODEV;
}
Expand Down

0 comments on commit 2d2b795

Please sign in to comment.