Skip to content

Commit 2d2b795

Browse files
authored
Merge pull request #133 from haitaohuang/master
Use cpuid instead of boot_cpu_has to check cpu features
2 parents 0373e2e + ed2c256 commit 2d2b795

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sgx_main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ static int sgx_drv_probe(struct platform_device *pdev)
313313
if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL)
314314
return -ENODEV;
315315

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

0 commit comments

Comments
 (0)