Commit 68634bc1 authored by Reinette Chatre's avatar Reinette Chatre Committed by Lin Wang
Browse files

selftests: Provide local define of __cpuid_count()

mainline inclusion
from mainline-v5.19-rc1
commit a23039c7
category: bugfix
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I73H0T
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a23039c7306f53416ba35d230201398ea34f4640



Intel-SIG: commit a23039c7 selftests: Provide local define of
__cpuid_count().

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

Duplication of the CPUID wrappers should be avoided.

Both gcc and clang/LLVM provide __cpuid_count() macros but neither
the macro nor its header file are available in all the compiler
versions that need to be supported by the selftests. __cpuid_count()
as provided by gcc is available starting with gcc v4.4, so it is
not available if the latest tests need to be run in all the
environments required to support kernels v4.9 and v4.14 that
have the minimal required gcc v3.2.

Duplicate gcc's __cpuid_count() macro to provide a centrally defined
macro for __cpuid_count() to help eliminate the duplicate CPUID wrappers
while continuing to compile in older environments.

Suggested-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarLin Wang <lin.x.wang@intel.com>
parent 14a8c9f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment