1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
|
# CPUID feature bits, from LSB to MSB:
# (Names and descriptions gathered from various Intel and AMD sources)
cap_raw = (
# EAX=01H ECX:
"""SSE3
PCLMULQDQ
DTES64: 64-bit debug store
MONITOR: MONITOR/MWAIT
DS-CPL: CPL qualified debug store
VMX: virtual machine extensions
SMX: safer mode extensions
EST: enhanced SpeedStep
TM2: thermal monitor 2
SSSE3
CNXT-ID: L1 context ID
?(ecx11)
FMA: fused multiply add
CMPXCHG16B
xTPR: xTPR update control
PDCM: perfmon and debug capability
?(ecx16)
PCID: process context identifiers
DCA: direct cache access
SSE4_1
SSE4_2
x2APIC: extended xAPIC support
MOVBE
POPCNT
TSC-DEADLINE
AES
XSAVE: XSAVE instructions supported
OSXSAVE: XSAVE instructions enabled
AVX
F16C: half-precision convert
?(ecx30)
RAZ: used by hypervisor to indicate guest status
""" +
# EAX=01H EDX:
"""FPU
VME: virtual 8086 mode enhancements
DE: debugging extension
PSE: page size extension
TSC: time stamp counter
MSR: model specific registers
PAE: physical address extension
MCE: machine-check exception
CMPXCHG8
APIC
?(edx10)
SEP: fast system call
MTRR: memory type range registers
PGE: page global enable
MCA: machine-check architecture
CMOV
PAT: page attribute table
PSE-36: 36-bit page size extension
PSN: processor serial number
CLFSH: CLFLUSH
?(edx20)
DS: debug store
ACPI
MMX
FXSR: FXSAVE and FXSTOR
SSE
SSE2
SS: self-snoop
HTT: hyper-threading
TM: thermal monitor
?(edx30)
PBE: pending break enable
""" +
# EAX=80000001H ECX:
"""LAHF: LAHF/SAHF instructions
CMP: core multi-processing legacy mode
SVM: secure virtual machine
ExtApic
AltMovCr8
ABM: LZCNT instruction
SSE4A
MisAlignSse
3DNowPrefetch
OSVW: OS visible workaround
IBS: instruction based sampling
XOP: extended operation support
SKINIT
WDT: watchdog timer support
?(ext:ecx14)
LWP: lightweight profiling support
FMA4: 4-operand FMA
?(ext:ecx17)
?(ext:ecx18)
NodeId
?(ext:ecx20)
TBM: trailing bit manipulation extensions
TopologyExtensions
?(ext:ecx23)
?(ext:ecx24)
?(ext:ecx25)
?(ext:ecx26)
?(ext:ecx27)
?(ext:ecx28)
?(ext:ecx29)
?(ext:ecx30)
?(ext:ecx31)
""" +
# EAX=80000001H ECX:
"""FPU[2]
VME[2]
DE[2]
PSE[2]
TSC[2]
MSR[2]
PAE[2]
MCE[2]
CMPXCHG8[2]
APIC[2]
?(ext:edx10)
SYSCALL: SYSCALL/SYSRET instructions
MTRR[2]
PGE[2]
MCA[2]
CMOV[2]
PAT[2]
PSE36[2]
?(ext:edx18)
MP: MP-capable
NX: no execute bit
?(ext:edx21)
MmxExt
MMX[2]
FXSR[2]
FFXSR
1GB: 1GB pages
RDTSCP
?(ext:edx28)
x86-64
3DNowExt
3DNow
"""
)
cap_bits = []
cap_descs = {}
idx = 0
for c in cap_raw.strip().split('\n'):
s = c.split(':')
if len(s) == 1:
cap_bits.append((s[0], None, idx))
else:
cap_bits.append((s[0], s[1], idx))
cap_descs[s[0]] = s[1]
idx += 1
|