Reverse engineering Intel Speed Step
Posted: Tue May 28, 2013 9:15 am
Key to doing power management on Intel processors seems to be the IA32_PERF_CTL and IA32_PERF_STATUS MSRs. The problem is that Intel doesn't document the 16-bit ID field in IA32_PERF_CTL, and neither the fields in IA32_PERF_STATUS.
However, on a real system (Intel Atom N455), trying to set different values seems indicative.
First, it seems like IA32_PERF_CTL is composed of two different values. The higher byte can range between 6 and 0xA on my CPU, while the lower byte can range between 0x13 and 0x24. Also, the CPU doesn't allow values higher than 0x3F in the lower byte. It seems like the lower byte should be the VID values documented in the Intel Atom manual. After boot, the frequency value is 0xA and the VID value is 0x24 (which corresponds to 1.05v and 1.66GHz according to BIOS).
The IA32_PERF_STATUS seems to echo the requested frequency and VID values in the lower word. The actual operating point seems to be in the higher 32-bits.
The question is how to design a power management system for Intel CPUs without relying on processor specific drivers (which you need to obtain from Intel, and they won't have those for your OS)? Could a driver just assume that frequency and VID values are coded in the low word, and try to change them and observe the effects?
The bad thing is that ACPI doesn't provide relevant objects for supported P-states and their frequencies (the HI0 and HC0 objects are undocumented, while the PDC and OSC objects are useless).
Also interesting is this web page: https://lkml.org/lkml/2007/6/4/238
However, on a real system (Intel Atom N455), trying to set different values seems indicative.
First, it seems like IA32_PERF_CTL is composed of two different values. The higher byte can range between 6 and 0xA on my CPU, while the lower byte can range between 0x13 and 0x24. Also, the CPU doesn't allow values higher than 0x3F in the lower byte. It seems like the lower byte should be the VID values documented in the Intel Atom manual. After boot, the frequency value is 0xA and the VID value is 0x24 (which corresponds to 1.05v and 1.66GHz according to BIOS).
The IA32_PERF_STATUS seems to echo the requested frequency and VID values in the lower word. The actual operating point seems to be in the higher 32-bits.
The question is how to design a power management system for Intel CPUs without relying on processor specific drivers (which you need to obtain from Intel, and they won't have those for your OS)? Could a driver just assume that frequency and VID values are coded in the low word, and try to change them and observe the effects?
The bad thing is that ACPI doesn't provide relevant objects for supported P-states and their frequencies (the HI0 and HC0 objects are undocumented, while the PDC and OSC objects are useless).
Also interesting is this web page: https://lkml.org/lkml/2007/6/4/238