The cpu/modalias
show you:
cpu:type:x86,ven0002fam0019mod0021:feature:[FEATURE LIST]
x86
in this context does not mean 32-bit, but that it is part of the x86 instruction set architecture family where one have both Intel and AMD. The x86 architecture has 16, 32 and 64 bits.
It further say (which is "translated" in /proc/cpuinfo
):
The kernel uses the CPUID instruction (specific for x86) to get a list of features from the CPU. (The article show how this can be done using assembly).
You are interested in long-mode (LM) which is identified by 61 (0x003D
) in the feature list.
Did a crude script to list the features by parsing the cpufeatures.h
file from the kernel source:
#! /bin/bash -
Hash-like map with features from cpufeatures.h
An ugly and likely unreliable sed parse :P
https://github.com/torvalds/linux/blob/10d4879f9ef01cc6190fafe4257d06f375bab92c/arch/x86/include/asm/cpufeatures.h
declare -A features=()
while IFS=$'\t' read -r a b c; do
a=$((a))
x=$(printf "%04X" $a)
features[$x]="$(printf "%s %3d\t%-24s\t%s" "$x" "$a" "$b" "$c")"
done< <(sed -n '
s;^#define X86_FEATURE_([^ ]+)\s+(([^)]+)) /*(.*) */$;\2\t\1\t\3;p'
cpufeatures.h)
Give any argument to script to print all
possible features defined in cpufeatures.h:
if [ $# = 1 ]; then
printf 'cpufeatures:\n'
printf '%s\n' "${features[@]}" | sort
printf '\n'
fi
Print all features from system's CPU.
Unknown are denoted by * (N/A)
printf '/sys/devices/system/cpu/modalias features:\n'
while IFS= read -r feature; do
ent=${features[$feature]}
if [ -z "$ent" ]; then
printf '%s %3d\t(N/A)\n' "$feature" "$((0x$feature))"
else
printf '%s\n' "$ent"
fi
done< <(sed 's/^.feature:,?(.*),?$/\1/;s/,/\n/g'
/sys/devices/system/cpu/modalias | sort)
Gives you a full list like:
/sys/devices/system/cpu/modalias features:
0000 0 FPU Onboard FPU
0001 1 VME Virtual Mode Extensions
0002 2 DE Debugging Extensions
0003 3 PSE Page Size Extensions
0004 4 TSC Time Stamp Counter
0005 5 MSR Model-Specific Registers
0006 6 PAE Physical Address Extensions
0007 7 MCE Machine Check Exception
0008 8 CX8 CMPXCHG8 instruction
0009 9 APIC Onboard APIC
000B 11 SEP SYSENTER/SYSEXIT
000C 12 MTRR Memory Type Range Registers
000D 13 PGE Page Global Enable
000E 14 MCA Machine Check Architecture
... and so on
Checking for long-mode this should for example give you:
./cpufeatures | grep Long
003D 61 LM Long Mode (x86-64, 64-bit support)
The list should be partially the same as flags
in /proc/cpuinfo
.
modalias
also includes vendor, family and model + feature-list. – ibuprofen Aug 28 '22 at 05:03x86
which is ether 32bit or 64bit. It also says x86_64, that is the 64bit variant. MS use the word x64 for 64 bit, which they contrast with x86 (which I assume they think is a 86 bit processor). – ctrl-alt-delor Aug 28 '22 at 07:44