Description of problem: For recent Zhaoxin platforms, the turbo boost can be dynamically enabled or disabled, so add boost control interface support for Zhaoxin CPUs when acpi_cpufreq driver is in use. How reproducible: Steps to Reproduce: Case1: dmesg 查看kernel boot log里,检查有没有warning log “acpi_cpufreq: acpi_cpufreq: failed to register hotplug callbacks“ Case2: cat /proc/cpuinfo |grep ida,检查CPU是否支持IDA feature; Case3: kernel boot起来之后,检查所有core的turbo setting是否一致 (MSR 0x1A0[38]) #rdmsr –a 0x1a0 Case4: 获取CPU turbo boost的当前状态enable/disable,跟MSR 0x1A0[38] 比较是否一致(MSR 0x1A0[38]=0 表示turbo enable,1表示turbo disable) #cat /sys/device/system/cpu/cpufreq/boost //1表示turbo enable,0 表示disable; #rdmsr –a 0x1a0 //[38]=0表示turbo enable,1表示disable Case5:通过sysfs 接口使能turbo enable,跑CPU stress测例,观察CPU频率是否会超出基频。 Case6: 通过sysfs接口disable turbo,跑CPU stress测例,观察CPU频率; Case7:offline core时,会clear boost disable flag; 先设置turbo disable,然后offline core3,再设置turbo enable,跑CPU stress,观察core 0-2是否能够turbo Actual results: Expected results: 1、 在kernel boot时,不再有warning log:acpi_cpufreq: acpi_cpufreq: failed to register hotplug callbacks; 2、 在/proc/cpuinfo中能看到ida support; 3、 Kernel boot完成后,所有core的boost setting,即 MSR 0x1A0[38] 是一样的; 4、 Sysfs (cat /sys/device/system/cpu/cpufreq/boost )中反应的boost状态和MSR 0x1A0[38] 是一致的; 5、 设置boost enable,允许CPU turbo; # echo 1 > /sys/device/system/cpu/cpufreq/boost CPU在符合boost的情况下,能turbo到基频以上的频点; MSR 0x1AD 可以获取4/3/2/1 core active频点; 控制active core number并发送高频请求,CPU能达到MSR 0x1AD 预设的频点。 6、设置boost disable,不允许CPU turbo; # echo 0 > /sys/device/system/cpu/cpufreq/boost 跑CPU stress程序,CPU不能turbo,最高频只能到P1频点处; 7、core3 offline时,会re-enable core3 turbo boost,剩下的3个core0-2,在turbo enable的情况下,跑CPU stress时,可以turbo到基频以上的频点。 Additional info:
merged: https://gitee.com/anolis/cloud-kernel/pulls/801