Commit 396338ac authored by Jarkko Sakkinen's avatar Jarkko Sakkinen Committed by Zhiquan Li
Browse files

selftests/sgx: Fix corrupted cpuid macro invocation

mainline inclusion
from mainline-5.17-rc1
commit 572a0a64
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I5USAM


CVE: NA

Intel-SIG: commit 572a0a64 selftests/sgx: Fix corrupted cpuid macro
invocation.
Backport for SGX EDMM support.

--------------------------------

The SGX selftest fails to build on tip/x86/sgx:

	main.c: In function ‘get_total_epc_mem’:
	main.c:296:17: error: implicit declaration of function ‘__cpuid’ [-Werror=implicit-function-declaration]
	  296 |                 __cpuid(&eax, &ebx, &ecx, &edx);
	      |                 ^~~~~~~

Include cpuid.h and use __cpuid_count() macro in order to fix the
compilation issue.

[ dhansen: tweak commit message ]

Fixes: f0ff2447 ("selftests/sgx: Add a new kselftest: Unclobbered_vdso_oversubscribed")
Signed-off-by: default avatarJarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Acked-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Link: https://lkml.kernel.org/r/20211204202355.23005-1-jarkko@kernel.org


Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: default avatarZhiquan Li <zhiquan1.li@intel.com>
parent 2289267d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment