Bug 2705 - Add support of turbo boost control interface for Zhaoxin CPUs
Summary: Add support of turbo boost control interface for Zhaoxin CPUs
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 18:02 UTC by LeoLiu-oc
Modified: 2023-02-28 19:34 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LeoLiu-oc zhaoxin_group 2022-11-02 18:02:44 UTC
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.

Version-Release number of selected component (if applicable):


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:
Comment 1 maqiao alibaba_cloud_group 2023-02-28 19:34:09 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/840