Reputation:
Is the maximum CPUID standard leaf changeable, i.e. might it be reconfigured by the kernel to enable additional CPUID values ?
Are there CPUID feature-bits that are dependent on the configuration of certain MSRs ?
Upvotes: 0
Views: 316
Reputation: 12455
There are several CPUID results that can be affected by control registers or MSRs set by the OS.
leaf (subleaf) | register[bit] | controlled by |
---|---|---|
7 (0) | ECX[4] OSPKE | CR4.PKE |
9 | EAX[31:0] | IA32_PLATFORM_DCA_CAP |
D (0) | EBX[31:0] | XCR0 |
D (1) | EBX[31:0] | XCR0 and IA32_XSS |
80000001 | EDX[11] SYSCALL/SYSRET | IA32_EFER.LMA |
Upvotes: 1
Reputation: 37222
Is the maximum CPUID standard leaf changeable, i.e. might it be reconfigured by the kernel to enable additional CPUID values ?
In general, no (the max. standard leaf reported is the literal maximum), however...
A very long time ago a Windows NT kernel was buggy and crashed if the CPU reported a "too high" max. CPUID value (which wasn't detected when the kernel was released because CPUs didn't report as much back then); so to fix the problem Intel said "Software is soft, hardware is hard, let's add a hack to hardware for the next 20+ years so Microsoft doesn't need to write a 2 minute patch". The end result is a "Limit CPUID MAXVAL" flag at bit 22 of the IA32_MISC_ENABLE MSR (MSR 0x1A0); which (if set) will cause CPUID to report a max. value of 3 (and not the real, higher, max value).
For other 80x86 CPU manufacturers (AMD, VIA, Cyrix, NexGen, ..) they didn't mess with the max. standard CPUID leaf themselves (and created their own areas - e.g. the "0x80000000+ leafs" used by AMD and copied Intel for the standard leaves where they can); but a lot of them allow things like CPU vendor string or CPU brand string or CPU features flags to be modified so you can't trust them much (e.g. it wouldn't be hard to modify a boot loader to make old AMD Athlon chips report "Core i9 8765 @ 6 GHz" and sell the computers 2nd hand).
Upvotes: 2