cpuinfo and features shell commands.
Drivers in This Subsystem
CPUID Detection
cpu_init() issues CPUID leaves to populate a cpu_info_t and a cpu_capabilities_t for every subsequent kernel subsystem to consume. The following information is retrieved at boot:
- Vendor string — e.g.,
GenuineIntelorAuthenticAMD(viacpu_vendor()) - Brand string — human-readable model name, up to 48 characters (via
cpu_brand()) - Family, model, and stepping — computed from the extended family/model fields in CPUID leaf 1
- APIC ID and logical CPU count — reported by CPUID; MVH Kernel currently runs on a single boot processor
- Cache geometry — L1 data, L1 instruction, L2, and L3 sizes in KiB, plus cache line size in bytes
- TSC frequency — computed at boot and stored in
tsc_hz - Microcode revision — read from MSR
0x8Bwhen the MSR capability is present
FPU, SSE, and AVX Initialization
Thex86-fpu-xsave driver runs after CPUID detection and enables each SIMD tier only when the corresponding capability flag is set:
1
FPU
Sets CR0.MP and clears CR0.EM and CR0.TS to enable the x87 FPU. Required for any floating-point operation.
2
SSE / SSE2
Sets CR4.OSFXSR and CR4.OSXMMEXCPT. SSE2 is always present on x86_64 but the driver confirms the flags before enabling.
3
XSAVE
Sets CR4.OSXSAVE when the
xsave capability is present. This is the prerequisite for any extended state (AVX, AVX-512).4
AVX
Enables the YMM state component in the XCR0 register when the
avx capability is present.5
AVX-512F
Enables the ZMM, opmask, and hi-ZMM state components in XCR0 when the
avx512f capability is present.xsave_bytes field in cpu_info_t reports the size of the XSAVE area in bytes as returned by CPUID leaf 0xD.
Security State Initialization
After the FPU is initialized, the kernel enables all available hardware security features:
Each feature is only enabled when the matching capability flag is set.
cpu_get_security_state() returns the live state for all five flags.
Hardware RNG
Thex86-msr-rng driver exposes cpu_random64(), which issues the RDRAND instruction to generate a hardware-backed 64-bit random number. The function is capability-guarded: it checks the rdrand flag in cpu_capabilities_t before executing the instruction and returns 0 (failure) if the processor does not support RDRAND.
RDSEED capability detection is also present in cpu_capabilities_t (rdseed flag) for future use.
MSR Access
Thex86-msr-rng driver also provides capability-guarded MSR primitives:
msr flag in cpu_capabilities_t is set. Calling cpu_wrmsr on a processor that does not support MSRs will fault.
Temperature Backends
The kernel probes for a thermal backend in priority order and stores the result incpu_info_t. The temperature_available flag indicates whether a reading was obtained. When no supported backend is detected — such as when running inside QEMU without thermal emulation — the driver reports the temperature as unavailable and sets temperature_celsius to a sentinel value rather than crashing.
Intel Digital Thermal Sensor (DTS)
Intel Digital Thermal Sensor (DTS)
Used on supported Intel processors. The driver reads MSR
0x19C (IA32_THERM_STATUS) and MSR 0x1A2 (MSR_TEMPERATURE_TARGET) to compute the package temperature from the thermal margin. Reported in both temperature_celsius and temperature_millicelsius. The temperature_source string is set to "Intel DTS/MSR".AMD Northbridge (Families 10h–16h)
AMD Northbridge (Families 10h–16h)
Used on AMD processors from families 10h through 16h. The driver reads the Tctl register from the northbridge PCI device (bus 0, device 24, function 3, offset
0xA4) and converts the raw value to degrees Celsius. The temperature_source string is set to "AMD northbridge Tctl".AMD SMN (Families 17h–1Ah)
AMD SMN (Families 17h–1Ah)
Used on AMD Zen-architecture processors (families 17h through 1Ah). The driver accesses the System Management Network (SMN) via PCI indirect registers to read THM::CUR_TEMP and converts the Tctl value to degrees Celsius. The
temperature_source string is set to "AMD SMN Tctl".