

Even if the hardware is new, there might be a ¶įor example, when a new kernel is running on old hardware or the feature is

a: The hardware does not enumerate support for it. Flags are missing when one or more of these happen ¶ 3.4.1. Its flag will not appear in /proc/cpuinfo. In the alternative runtime patching functionality. For example, X86_FEATURE_ALWAYS isĭefined in cpufeatures.h but that flag is an internal kernel feature used The feature shall be omitted from /proc/cpuinfo if it does not make sense for c: The naming override can be “”, which means it will not appear in /proc/cpuinfo. Shall override the new naming with the name already used in /proc/cpuinfo. If, for some reason, the naming of X86_FEATURE_ changes, one For instance, /proc/cpuinfo is a userspace interface and must remainĬonstant. There are situations in which overriding the displayed name of the flag is The comment “sse4_1” following the X86_FEATURE_XMM4_1 definition. For example, the flag “sse4_1” comes from If the comment on the line for the #define X86_FEATURE_* starts with aĭouble-quote character (“”), the string inside the double-quote characters ¶īy default, the flag in /proc/cpuinfo is extracted from the respective a: The name of the flag is from the string in X86_FEATURE_ by default. Of flags in the x86_cap/bug_flags are as follows: 3.3.1. Resulting x86_cap/bug_flags are used to populate /proc/cpuinfo. X86_cap/bug_flags arrays in kernel/cpu/capflags.c. #define X86_FEATURE_ from cpufeatures.h and generates the The script arch/x86/kernel/cpu/mkcapflags.sh processes the
#BASH RETURN PROC CPUINFO SOFTWARE#
Isolation is purely software feature and its feature flag X86_FEATURE_PTI isĪlso defined in cpufeatures.h. Software feature implemented in the kernel. These flags do not represent hardware features. d: Flags can represent purely software features. The flag “ring3mwait” will beĭisplayed only when running on INTEL_FAM6_XEON_PHI_ processors. The feature X86_FEATURE_SPLIT_LOCK_DETECT will be enabled and For example, if bit 5 is set in MSR_IA32_CORE_CAPS, If the neededĬonditions are met, the features are enabled by the set_cpu_cap or MSR_IA32_CORE_CAPS or specific CPU models are identified.

¶Įxamples of conditions include whether certain features are present in c: Flags can be created synthetically under certain conditions for hardware features. Since there is a struct cpuinfo_x86 for each possible CPU, the wasted Has only one feature and would waste 31 bits of space in the x86_capabilityĪrray. has 30 features and is dense, but the CPUID leaf The intent of scattering CPUID leaves is to not bloat structĬpuinfo_x86.x86_capability unnecessarily. This is done in init_scattered_cpuid_features().įor instance, X86_FEATURE_CQM_LLC is defined as 11*32 + 0 and its presence isĬhecked at runtime in the respective CPUID leaf bit EDX. Still, CPUID needs to be queried to determine Hardware features enumerated in sparsely populated CPUID leaves get b: Flags can be from scattered CPUID-based features. For example, the flag “avx2”Ĭomes from X86_FEATURE_AVX2 in cpufeatures.h. If a feature is defined with a X86_FEATURE_ definition inĬpufeatures.h, and if it is detected at run time, the flags will beĭisplayed accordingly in /proc/cpuinfo. In cpufeatures.h (see arch/x86/include/asm/cpufeatures.h for details). Leaves and grouped in words with offsets as mapped in enum cpuid_leafs These feature definitions are organized mirroring the layout of CPUID a: Feature flags can be derived from the contents of CPUID leaves. Which the CPU supports, use tools/arch/x86/kcpuid. Shows features which the kernel supports. Not support the feature and thus has not enabled it. Is missing in hardware, platform firmware did not enable it, the feature isĭisabled at build or run time, an old kernel is in use, or the kernel does There are several factors thatĬan explain missing flags: the expected feature failed to enable, the feature
#BASH RETURN PROC CPUINFO HOW TO#
How to enable it, which is not always easy. Users need to find out the reason why the flag is missing and find the way If the expected flag does not appear in /proc/cpuinfo, things are murkier. If such flag represents a hardware feature, it also means that the Means that the kernel supports it and is currently making it available. If users want to know if a feature is available on a given system, they These flags represent hardware features as Or KVM want to expose the feature to a KVM guest, it can and should haveĪn X86_FEATURE_* defined. On x86, flags appearing in /proc/cpuinfo have an X86_FEATURE definition
